/* ==========================================================================
   Dispatch Coverage Map — scoped styles
   Hosted on Webflow CDN. All rules are scoped to #dsp-cov so nothing
   leaks into the rest of the dispatchit.com page.
   ========================================================================== */

#dsp-cov {
  --navy: #003A5D;
  --primary-blue: #0072ED;
  --deep-blue: #004EA1;
  --orange: #FF8300;
  --light-blue: #D5EBFF;
  --very-light-blue: #E8F3FD;
  --lt-orange: #FEE9D2;
  --neutral: #FBFCFF;
  --white: #FFFFFF;
  --text: #000000;

  font-family: 'Nunito Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--very-light-blue);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 18px rgba(0, 58, 93, 0.08);
}

#dsp-cov *,
#dsp-cov *::before,
#dsp-cov *::after { box-sizing: border-box; }

/* ── SPLIT LAYOUT ───────────────────────────────────────────────── */
#dsp-cov .content-layout {
  display: flex;
  min-height: 560px;
}

#dsp-cov .sidebar {
  width: 380px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--very-light-blue);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#dsp-cov .eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 8px;
}

#dsp-cov .sb-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 6px;
}

#dsp-cov .sb-sub {
  font-size: 14px;
  font-weight: 300;
  color: #555;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ── SEARCH BAR ─────────────────────────────────────────────────── */
#dsp-cov .search-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

#dsp-cov .input-wrap {
  position: relative;
  display: flex;
  width: 100%;
}

#dsp-cov .addr-input {
  flex: 1;
  padding: 13px 40px 13px 16px;
  border: 2px solid var(--very-light-blue);
  border-radius: 8px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.18s;
  width: 100%;
}

#dsp-cov .addr-input:focus { border-color: var(--primary-blue); }
#dsp-cov .addr-input::placeholder { color: #bbb; font-weight: 300; }

#dsp-cov .clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}

#dsp-cov .clear-btn:hover { background: #aaa; }
#dsp-cov .clear-btn.visible { display: flex; }

#dsp-cov .check-btn {
  padding: 13px 26px;
  background: var(--primary-blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

#dsp-cov .check-btn:hover { background: var(--deep-blue); }
#dsp-cov .check-btn:disabled { background: #aaa; cursor: not-allowed; }

#dsp-cov .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: dsp-cov-spin 0.7s linear infinite;
  display: none;
}

#dsp-cov .check-btn.loading .spinner { display: block; }
#dsp-cov .check-btn.loading .btn-text { display: none; }

@keyframes dsp-cov-spin { to { transform: rotate(360deg); } }

/* ── RESULT BANNER ──────────────────────────────────────────────── */
#dsp-cov .result-wrap {
  margin-top: 14px;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#dsp-cov .result-banner {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
}

#dsp-cov .result-banner.show { display: flex; }

#dsp-cov .result-banner.covered {
  background: #E8F5E9;
  border: 1.5px solid #4CAF50;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 16px 18px 14px;
}

#dsp-cov .result-banner.not-covered {
  background: var(--lt-orange);
  border: 1.5px solid var(--orange);
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 16px 18px 14px;
}

#dsp-cov .result-banner.near-edge {
  background: #FFF8E1;
  border: 1.5px solid #F9A825;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 16px 18px 14px;
}

#dsp-cov .near-edge .result-icon { display: none; }
#dsp-cov .near-edge .result-body { width: 100%; }
#dsp-cov .near-edge .result-action { align-self: center; margin-top: 6px; }

#dsp-cov .result-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

#dsp-cov .covered .result-icon { display: none; }
#dsp-cov .not-covered .result-icon { display: none; }

#dsp-cov .result-body { flex: 1; min-width: 0; }

#dsp-cov .result-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
}

#dsp-cov .not-covered .result-title {
  font-size: 14px;
  font-weight: 700;
  width: 100%;
}

#dsp-cov .result-detail {
  font-size: 12px;
  font-weight: 300;
  color: #555;
  margin-top: 2px;
}

#dsp-cov .not-covered .result-detail {
  font-size: 12px;
  font-weight: 400;
  color: #555;
  width: 100%;
  margin-top: 2px;
}

#dsp-cov .not-covered .result-body { width: 100%; }

#dsp-cov .result-action {
  padding: 9px 18px;
  background: var(--primary-blue);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

#dsp-cov .result-action:hover { background: var(--deep-blue); }

#dsp-cov .covered .result-action {
  align-self: center;
  margin-top: 6px;
}

#dsp-cov .not-covered .result-action {
  background: var(--orange);
  align-self: center;
  margin-top: 6px;
}

#dsp-cov .not-covered .result-action:hover { background: #e07200; }

/* ── MAP ────────────────────────────────────────────────────────── */
#dsp-cov .map-wrap {
  position: relative;
  flex: 1;
  min-height: 560px;
}

#dsp-cov #map {
  width: 100%;
  height: 100%;
  min-height: 560px;
}

#dsp-cov .map-badge {
  position: absolute;
  bottom: 36px;
  left: 16px;
  background: var(--white);
  border: 1.5px solid var(--very-light-blue);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
  pointer-events: none;
}

#dsp-cov .map-badge span { color: var(--primary-blue); font-weight: 800; }

#dsp-cov .map-legend {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--white);
  border: 1.5px solid var(--very-light-blue);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--navy);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  z-index: 10;
  pointer-events: none;
}

#dsp-cov .legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

#dsp-cov .legend-row:last-child { margin-bottom: 0; }

#dsp-cov .legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  flex-shrink: 0;
}

#dsp-cov .legend-dot.market { background: var(--primary-blue); box-shadow: 0 1px 4px rgba(0, 114, 237, 0.4); }
#dsp-cov .legend-dot.search { background: var(--orange); box-shadow: 0 1px 4px rgba(255, 131, 0, 0.4); }

/* ── CUSTOM MARKERS ─────────────────────────────────────────────── */
.mkt-marker {
  width: 13px;
  height: 13px;
  background: #0072ED;
  border: 2.5px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 114, 237, 0.35);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.mkt-marker:hover,
.mkt-marker.hovered {
  transform: scale(1.5);
  box-shadow: 0 2px 8px rgba(0, 114, 237, 0.5);
}

.mkt-marker.active-market {
  background: #0072ED;
  transform: scale(1.7);
  box-shadow: 0 2px 10px rgba(0, 114, 237, 0.55);
}

/* ── MAPLIBRE POPUP OVERRIDES ───────────────────────────────────── */
.maplibregl-popup-content,
.mapboxgl-popup-content {
  font-family: 'Nunito Sans', sans-serif !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  box-shadow: 0 4px 18px rgba(0, 58, 93, 0.14) !important;
  border-top: 3px solid #0072ED;
  min-width: 150px;
}

.maplibregl-popup-tip,
.mapboxgl-popup-tip { border-top-color: #FFFFFF !important; }

.pop-name { font-weight: 700; font-size: 13px; color: #003A5D; }
.pop-state { font-size: 11px; font-weight: 300; color: #777; margin-top: 1px; }

.pop-pill {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: #D5EBFF;
  color: #0072ED;
  padding: 3px 8px;
  border-radius: 4px;
}

.pop-pill.served { background: #E8F5E9; color: #2E7D32; }
.pop-pill.near-edge { background: #FFF3CD; color: #856404; }

/* ── HOST-STYLESHEET OVERRIDES ──────────────────────────────────
   dispatchit.com's Webflow stylesheet applies `appearance: button` to
   <button> elements. In that situation some browsers drop a
   `background: var(--token)` shorthand and fall back to the UA default
   grey. These re-declare the same colours as literal `background-color`
   values so the buttons render correctly on the live page.
   ──────────────────────────────────────────────────────────────── */
/* The Locations section sets `text-align: center`, which otherwise inherits
   into this component and centres the sidebar copy. Reset it at the root and
   stop the absolutely-positioned overlays from stretching. */
#dsp-cov { text-align: left; }
#dsp-cov .map-legend {
  right: auto;
  width: auto;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#dsp-cov .legend-row { width: auto; white-space: nowrap; margin-bottom: 0; flex: 0 0 auto; }
#dsp-cov .map-badge { right: auto; width: auto; max-width: 230px; display: inline-block; }

#dsp-cov .check-btn { background-color: #0072ED; }
#dsp-cov .check-btn:hover { background-color: #004EA1; }
#dsp-cov .check-btn:disabled { background-color: #AAAAAA; }
#dsp-cov .clear-btn { background-color: #CCCCCC; }
#dsp-cov .clear-btn:hover { background-color: #AAAAAA; }
#dsp-cov .result-action { background-color: #0072ED; }
#dsp-cov .result-action:hover { background-color: #004EA1; }
#dsp-cov .not-covered .result-action { background-color: #FF8300; }
#dsp-cov .not-covered .result-action:hover { background-color: #E07200; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  #dsp-cov .content-layout { flex-direction: column; }
  #dsp-cov .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--very-light-blue);
    padding: 20px;
  }
  #dsp-cov .map-legend { display: none; }
  #dsp-cov .map-wrap,
  #dsp-cov #map { min-height: 420px; }
}
