/*
 * MIQ Shipping page styles.
 * Loaded only on /shipping/ — see class-miq-frontend-shipping.php
 */

:root {
  --miq-navy:       #00344B;
  --miq-navy-2:     #0A4A66;
  --miq-navy-deep:  #002335;
  --miq-teal:       #04A1B8;
  --miq-teal-dark:  #038092;
  --miq-teal-soft:  #E5F5F8;
  --miq-teal-light: #7DD3E8;
  --miq-line:       #E1E6EA;
  --miq-line-soft:  #EEF1F3;
  --miq-bg:         #F7F9FA;
  --miq-muted:      #8E9AA5;
  --miq-text:       #2E3A42;
  --miq-good:       #2BAE6A;
  --miq-good-soft:  #E3F5EC;
  --miq-warn:       #F4B53F;
  --miq-warn-soft:  #FFF7E4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--miq-text);
  background: var(--miq-bg);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.miq-ship-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}

/* ─────────── Hero ─────────── */
.miq-ship-hero {
  text-align: center;
  margin-bottom: 48px;
}
.miq-ship-hero h1 {
  font-family: 'Lato', sans-serif !important;
  font-size: 44px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  color: var(--miq-navy);
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}
.miq-ship-hero h1 .accent { color: var(--miq-teal); }
.miq-ship-hero p {
  font-size: 17px;
  color: var(--miq-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ─────────── Quick chips strip ─────────── */
.miq-ship-quickchips {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 22px 0 0;
  flex-wrap: wrap;
}
.miq-ship-quickchip {
  background: white;
  border: 1px solid var(--miq-line);
  color: var(--miq-navy);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.miq-ship-quickchip:hover {
  background: var(--miq-teal);
  color: white;
  border-color: var(--miq-teal);
  transform: translateY(-1px);
}

/* ─────────── Grid layout ─────────── */
.miq-ship-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 32px;
}

/* ─────────── Map card ─────────── */
.miq-ship-mapwrap {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--miq-line);
}
.miq-ship-maplabel {
  font-size: 12px;
  font-weight: 700;
  color: var(--miq-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
#miq-europe-map {
  width: 100%;
  height: 540px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg, #F7F9FA 0%, #EEF1F3 100%);
  position: relative;
}
.miq-ship-fallback {
  display: none;
  padding: 20px;
  text-align: center;
  color: var(--miq-muted);
}
#miq-europe-map.failed .miq-ship-fallback { display: block; }
#miq-europe-map.failed > svg { display: none; }
.miq-ship-country-pick {
  margin-top: 10px;
}
.miq-ship-country-pick select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--miq-line);
  background: white;
  font-size: 14px;
  color: var(--miq-navy);
  font-weight: 600;
  cursor: pointer;
}
.miq-ship-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--miq-line-soft);
  font-size: 12px;
  color: var(--miq-muted);
  font-weight: 500;
}
.miq-ship-legend .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.miq-ship-legend .swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
}

/* ─────────── Side panel ─────────── */
.miq-ship-panel {
  background: white;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid var(--miq-line);
  min-height: 540px;
  position: sticky;
  top: 24px;
}
.miq-ship-panel.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  color: var(--miq-muted);
}
.miq-ship-panel.empty svg { opacity: 0.4; margin-bottom: 14px; }
.miq-ship-panel.empty p { margin: 0; font-size: 15px; max-width: 240px; }

.miq-ship-country-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--miq-line-soft);
  margin-bottom: 18px;
}
.miq-ship-flag {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--miq-teal) 0%, var(--miq-teal-dark) 100%);
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(4, 161, 184, 0.25);
}
.miq-ship-country-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--miq-navy);
  line-height: 1.2;
}
.miq-ship-country-zone {
  font-size: 11px;
  color: var(--miq-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Weight selector */
.miq-ship-weightsel {
  background: var(--miq-bg);
  border: 1px solid var(--miq-line-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.miq-ship-weightsel-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--miq-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.miq-ship-weightsel-value {
  background: var(--miq-teal);
  color: white;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}
.miq-ship-weightsel input[type="range"] {
  width: 100%;
  accent-color: var(--miq-teal);
}
.miq-ship-weightsel-quick {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.miq-ship-weightsel-quick button {
  background: white;
  border: 1px solid var(--miq-line);
  color: var(--miq-navy);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.miq-ship-weightsel-quick button:hover {
  border-color: var(--miq-teal);
  color: var(--miq-teal-dark);
}
.miq-ship-weightsel-quick button.active {
  background: var(--miq-teal-soft);
  border-color: var(--miq-teal);
  color: var(--miq-teal-dark);
}

/* Service blocks */
.miq-ship-svc {
  padding: 16px 0;
  border-bottom: 1px solid var(--miq-line-soft);
}
.miq-ship-svc:last-of-type { border-bottom: 0; }
.miq-ship-svc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.miq-ship-svc-name {
  font-weight: 700;
  color: var(--miq-navy);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.miq-ship-svc-name svg {
  width: 18px; height: 18px;
  color: var(--miq-teal);
}
.miq-ship-svc-time {
  background: var(--miq-teal-soft);
  color: var(--miq-teal-dark);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.3px;
}

.miq-ship-svc-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0;
}
.miq-ship-svc-price .amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--miq-navy);
  letter-spacing: -0.5px;
}
.miq-ship-svc-price .unit {
  color: var(--miq-muted);
  font-size: 13px;
}
.miq-ship-svc-meta {
  font-size: 11px;
  color: var(--miq-muted);
  margin-top: 2px;
}

/* Bracket grid (alternative view) */
.miq-ship-bracket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.miq-ship-bracket {
  background: var(--miq-bg);
  border: 1px solid var(--miq-line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.miq-ship-bracket .wt {
  font-size: 10px;
  color: var(--miq-muted);
  font-weight: 700;
  text-transform: uppercase;
}
.miq-ship-bracket .pr {
  font-size: 14px;
  color: var(--miq-navy);
  font-weight: 700;
  margin-top: 2px;
}

/* Custom transport callout */
.miq-ship-custom {
  background: linear-gradient(135deg, var(--miq-navy) 0%, var(--miq-navy-2) 100%);
  color: white;
  padding: 18px 20px;
  border-radius: 12px;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}
.miq-ship-custom::after {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(4, 161, 184, 0.18);
}
.miq-ship-custom h4 {
  margin: 0 0 6px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.miq-ship-custom h4::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--miq-teal-light);
  box-shadow: 0 0 8px var(--miq-teal-light);
}
.miq-ship-custom p {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
  position: relative;
}

/* No-rate state */
.miq-ship-norate {
  background: var(--miq-warn-soft);
  border: 1px solid #F0DBA5;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  color: #7A5A0F;
  margin-top: 8px;
}
.miq-ship-norate strong {
  display: block;
  color: var(--miq-navy);
  font-size: 13px;
  margin-bottom: 2px;
}

/* Region split note */
.miq-ship-regionsplit {
  background: var(--miq-bg);
  border-left: 3px solid var(--miq-teal);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--miq-text);
  margin-bottom: 14px;
}
.miq-ship-regionsplit .tabs {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
}
.miq-ship-regionsplit .tabs button {
  background: white;
  border: 1px solid var(--miq-line);
  color: var(--miq-navy);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  cursor: pointer;
}
.miq-ship-regionsplit .tabs button.active {
  background: var(--miq-teal);
  color: white;
  border-color: var(--miq-teal);
}

/* ─────────── "How it works" ─────────── */
.miq-ship-howitworks {
  margin-top: 56px;
}
.miq-ship-howitworks h2 {
  text-align: center;
  font-size: 28px;
  color: var(--miq-navy);
  margin-bottom: 32px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.miq-ship-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.miq-ship-card {
  background: white;
  border-radius: 12px;
  padding: 26px;
  border: 1px solid var(--miq-line);
}
.miq-ship-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--miq-teal-soft);
  color: var(--miq-teal-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.miq-ship-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--miq-navy);
  font-weight: 700;
}
.miq-ship-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--miq-muted);
  line-height: 1.6;
}

/* ─────────── Europe SVG map ─────────── */
#miq-eumap {
  width: 100%;
  height: 100%;
  display: block;
}
#miq-eumap path {
  stroke: white;
  stroke-width: 0.6;
  transition: fill-opacity .15s;
}
#miq-eumap path:hover {
  fill-opacity: 0.76;
}
#miq-eumap path.selected {
  fill: #038092 !important;
  stroke: var(--miq-navy);
  stroke-width: 1.2;
}
.miq-eumap-tooltip {
  position: fixed;
  display: none;
  background: var(--miq-navy);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 52, 75, 0.25);
}

/* ─────────── Country search ─────────── */
.miq-ship-search {
  max-width: 520px;
  margin: 22px auto 0;
  position: relative;
}
.miq-ship-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--miq-muted);
  pointer-events: none;
  z-index: 1;
}
#miq-country-search {
  width: 100%;
  padding: 16px 48px 16px 48px;
  border-radius: 100px;
  border: 1.5px solid var(--miq-line);
  background: white;
  font-size: 15px;
  font-weight: 500;
  color: var(--miq-navy);
  font-family: inherit;
  outline: none;
  transition: all .15s;
  box-shadow: 0 4px 14px rgba(0, 52, 75, 0.04);
}
#miq-country-search::placeholder { color: var(--miq-muted); font-weight: 400; }
#miq-country-search:focus {
  border-color: var(--miq-teal);
  box-shadow: 0 0 0 4px rgba(4, 161, 184, 0.12), 0 6px 18px rgba(0, 52, 75, 0.08);
}
.miq-ship-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--miq-line-soft);
  border: 0;
  color: var(--miq-navy);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.miq-ship-search-clear:hover { background: var(--miq-line); }
.miq-ship-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: white;
  border-radius: 14px;
  border: 1px solid var(--miq-line);
  box-shadow: 0 14px 40px rgba(0, 52, 75, 0.12);
  overflow: hidden;
  display: none;
  z-index: 50;
}
.miq-ship-search-dropdown.open { display: block; }
.miq-ship-search-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  width: 100%;
  background: white;
  border: 0;
  border-bottom: 1px solid var(--miq-line-soft);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  transition: background .12s;
}
.miq-ship-search-item:last-child { border-bottom: 0; }
.miq-ship-search-item:hover { background: var(--miq-teal-soft); }
.miq-ship-search-flag {
  background: var(--miq-teal-soft);
  color: var(--miq-teal-dark);
  font-weight: 700;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.miq-ship-search-name {
  color: var(--miq-navy);
  font-weight: 600;
}
.miq-ship-search-zones {
  color: var(--miq-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.miq-ship-search-empty {
  padding: 18px;
  color: var(--miq-muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}
.miq-ship-search-empty strong { color: var(--miq-navy); }

@media (max-width: 920px) {
  .miq-ship-grid { grid-template-columns: 1fr; }
  .miq-ship-cards { grid-template-columns: 1fr; }
  .miq-ship-panel { position: relative; top: 0; }
  #miq-europe-map { height: 380px; }
}
