/*
 * Balasto Marketplace — styles (v1.0.0)
 *
 * Design tokens are extracted from "Balasto Design System - v3" (navy ink +
 * amber ochre + bone cream + stone neutrals; Hanken Grotesk UI / Newsreader
 * display / Spline Sans Mono figures) and SCOPED to .bmp-root so they never
 * leak into the theme or collide with the supply-map plugin.
 *
 * Operational, restrained, Spanish-first. First viewport = the search itself.
 */

.bmp-root {
  /* ---- palette ---- */
  --bmp-navy-900: #14233F;
  --bmp-navy-800: #1F3357;
  --bmp-navy-700: #284069;
  --bmp-amber-500: #E0922F;
  --bmp-amber-600: #C97E22;
  --bmp-amber-50: #FDF6EB;
  --bmp-bone-50: #FCFAF4;
  --bmp-bone-100: #F6F0E4;
  --bmp-bone-200: #ECE3D1;
  --bmp-spruce-500: #2E7D5B;
  --bmp-spruce-50: #EEF6F1;
  --bmp-clay-500: #C0492F;
  --bmp-clay-50: #FBEEE9;

  --bmp-surface-page: var(--bmp-bone-100);
  --bmp-surface-card: #FFFDF9;
  --bmp-surface-sunken: var(--bmp-bone-200);

  --bmp-text-strong: var(--bmp-navy-900);
  --bmp-text-body: #283449;
  --bmp-text-muted: #5E6677;
  --bmp-text-subtle: #8B92A2;
  --bmp-text-on-accent: #0C1626;

  --bmp-border-subtle: rgba(20, 35, 64, 0.08);
  --bmp-border-default: rgba(20, 35, 64, 0.14);
  --bmp-border-strong: rgba(20, 35, 64, 0.26);
  --bmp-focus-ring: rgba(224, 146, 47, 0.55);

  /* ---- type ---- */
  --bmp-font-sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bmp-font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --bmp-font-mono: 'Spline Sans Mono', ui-monospace, Menlo, monospace;

  /* ---- spacing / shape ---- */
  --bmp-control: 42px;
  --bmp-radius-sm: 6px;
  --bmp-radius-md: 10px;
  --bmp-radius-lg: 14px;
  --bmp-shadow-sm: 0 1px 2px rgba(20, 35, 64, 0.05), 0 2px 6px rgba(20, 35, 64, 0.06);
  --bmp-shadow-md: 0 2px 4px rgba(20, 35, 64, 0.05), 0 8px 20px rgba(20, 35, 64, 0.08);

  box-sizing: border-box;
  position: relative;        /* anchors the absolute results panel (PR7D) */
  width: 100%;
  max-width: none;          /* span the full content width (Expedia-style) */
  margin: 0;
  padding: 0;
  background: transparent;   /* the search BAR carries the surface, not the root */
  font-family: var(--bmp-font-sans);
  color: var(--bmp-text-body);
  -webkit-font-smoothing: antialiased;
}
.bmp-root *,
.bmp-root *::before,
.bmp-root *::after { box-sizing: border-box; }

/* Theme-margin reset. WordPress themes inject large default margins on inputs,
   labels, paragraphs and lists inside .entry-content, which blows the form
   apart vertically. :where() has ZERO specificity, so every .bmp-* rule below
   still wins — this only neutralizes the inherited theme defaults. */
.bmp-root :where(h2, p, ul, li, label) { margin: 0; padding: 0; }
.bmp-root :where(ul) { list-style: none; }
.bmp-root :where(input, select, button) { margin: 0; font-family: inherit; line-height: normal; }
/* [hidden] must beat component display rules (e.g. .bmp-state--loading{display:flex}),
   otherwise hidden states render on initial load. */
.bmp-root [hidden] { display: none !important; }

/* ====== MAP HERO (navy) ====== */
.bmp-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--bmp-radius-lg);
  background: var(--bmp-navy-900);
  /* PR7C: tall enough to host the live Leaflet map; the search floats at top. */
  min-height: 560px;
}
.bmp-hero__bg { position: absolute; inset: 0; z-index: 0; background: var(--bmp-navy-900); }
.bmp-hero__facets { width: 100%; height: 100%; display: block; }
.bmp-hero__inner {
  position: relative;
  z-index: 3;                 /* above the map (0) and map overlay UI (2) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: clamp(20px, 4vw, 36px) 18px;
  min-height: inherit;
  pointer-events: none;       /* empty hero areas pass drags to the map below */
}
.bmp-hero__prompt, .bmp-search { pointer-events: auto; }
.bmp-hero__prompt { text-align: center; max-width: 640px; margin-bottom: 22px; }
.bmp-hero__title {
  margin: 0 0 8px;
  font-family: var(--bmp-font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: var(--bmp-bone-50);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}
.bmp-hero__em { font-style: italic; color: var(--bmp-amber-500); }
.bmp-hero__sub {
  margin: 0;
  font-size: clamp(14px, 1.6vw, 16px);
  color: rgba(246, 240, 228, 0.82);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.5);
}

/* ---- floating search (collapsed pill <-> expanded form) ---- */
.bmp-form { margin: 0; }
/* Wide enough to host the full-width dispatch console; the pill stays narrow. */
.bmp-search { width: min(1080px, calc(100vw - 48px)); display: flex; flex-direction: column; align-items: center; }

.bmp-search__pill {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 6px 6px 6px 20px;
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-default);
  border-radius: 999px;
  box-shadow: 0 18px 50px rgba(10, 19, 34, 0.4);
  cursor: text;
  font-family: var(--bmp-font-sans);
  text-align: left;
}
.bmp-search__pill-icon { display: inline-flex; color: var(--bmp-text-muted); flex: 0 0 auto; }
.bmp-search__pill-text {
  flex: 1 1 auto; min-width: 0;
  font-size: 15px; font-weight: 600; color: var(--bmp-text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bmp-search__pill-text.is-placeholder { color: var(--bmp-text-subtle); font-weight: 500; }
.bmp-search__pill-cta {
  flex: 0 0 auto;
  display: inline-flex; align-items: center;
  height: 46px; padding: 0 22px;
  font-size: 15px; font-weight: 700; color: var(--bmp-text-on-accent);
  background: var(--bmp-amber-500); border-radius: 999px;
}
.bmp-search__pill:hover .bmp-search__pill-cta { background: var(--bmp-amber-600); }

/* expanded form = full-width dispatch console. The open/close animation is driven
   by the .is-search-open class on the .bmp-search wrapper (NOT by [hidden]), so a
   caching layer or the hidden attribute can't defeat the transition. */
.bmp-search__form {
  width: 100%;
  max-width: 1080px;
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-lg);
  box-shadow: 0 24px 60px rgba(10, 19, 34, 0.45);
  padding: 16px 18px;
  transform-origin: top center;
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.bmp-search.is-search-open .bmp-search__form { opacity: 1; transform: none; }
.bmp-search__formhead {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.bmp-search__formtitle {
  font-family: var(--bmp-font-display); font-style: italic; font-size: 18px; color: var(--bmp-text-strong);
}
.bmp-search__close {
  background: none; border: none; cursor: pointer;
  font-family: var(--bmp-font-sans); font-size: 13px; font-weight: 600; color: var(--bmp-text-muted);
}
.bmp-search__close:hover { color: var(--bmp-text-strong); }

/* Three flex rows — deliberately NOT grid, so page-builder/theme CSS or grid
   auto-flow quirks can't stagger the fields. Widths are flex-grow ratios that add
   up per row (6+6, 4+3+5, 3+2+7). !important guards the few layout-critical props
   against aggressive theme resets. */
.bmp-search__row {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}
.bmp-search__row:last-of-type { margin-bottom: 0; }
.bmp-search__row--end { align-items: flex-end; }
.bmp-search__row > .bmp-field { flex: 1 1 0; min-width: 0; }
.bmp-fx-2 { flex: 2 1 0 !important; }
.bmp-fx-3 { flex: 3 1 0 !important; }
.bmp-fx-4 { flex: 4 1 0 !important; }
.bmp-fx-5 { flex: 5 1 0 !important; }
.bmp-fx-6 { flex: 6 1 0 !important; }
.bmp-fx-7 { flex: 7 1 0 !important; }
.bmp-search__submitcell .bmp-btn { width: 100%; padding: 0 20px; }

.bmp-field { display: flex; flex-direction: column; min-width: 0; position: relative; }

/* phone: stack each row into a single column */
@media (max-width: 640px) {
  .bmp-hero__inner { padding: 60px 12px 14px; }   /* clear the top filter toggle */
  .bmp-search__row { flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bmp-search__form { transition: none; }
}

.bmp-label {
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--bmp-text-strong);
  white-space: nowrap;
}
.bmp-label-note { font-weight: 400; color: var(--bmp-text-subtle); }

.bmp-input,
.bmp-select {
  width: 100%;
  height: var(--bmp-control);
  padding: 0 13px;
  font-family: var(--bmp-font-sans);
  font-size: 14.5px;
  color: var(--bmp-text-body);
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-md);
  appearance: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.bmp-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235E6677' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
  cursor: pointer;
}
.bmp-input::placeholder { color: var(--bmp-text-subtle); }
.bmp-input:focus,
.bmp-select:focus {
  outline: none;
  border-color: var(--bmp-amber-500);
  box-shadow: 0 0 0 3px var(--bmp-focus-ring);
}
.bmp-input.bmp-input--invalid { border-color: var(--bmp-clay-500); }

/* ---- multi-select unit type (checkbox dropdown) ---- */
.bmp-units { position: relative; }
.bmp-units__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}
.bmp-units__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bmp-units__text.is-placeholder { color: var(--bmp-text-subtle); }
.bmp-units__chev {
  flex: 0 0 auto;
  width: 12px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235E6677' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.bmp-units__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  min-width: 100%;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-md);
  box-shadow: var(--bmp-shadow-md);
}
.bmp-units__opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--bmp-radius-sm);
  font-size: 14px;
  color: var(--bmp-text-body);
  cursor: pointer;
  white-space: nowrap;
}
.bmp-units__opt:hover { background: var(--bmp-amber-50); }
.bmp-units__opt input { width: 16px; height: 16px; accent-color: var(--bmp-amber-500); cursor: pointer; }
.bmp-units__hint { padding: 6px 10px 2px; font-size: 12px; color: var(--bmp-text-subtle); }

/* ---- combobox / autocomplete ---- */
.bmp-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 264px;
  overflow-y: auto;
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-md);
  box-shadow: var(--bmp-shadow-md);
}
.bmp-suggest__item {
  padding: 9px 12px;
  border-radius: var(--bmp-radius-sm);
  font-size: 14px;
  color: var(--bmp-text-body);
  cursor: pointer;
}
.bmp-suggest__item:hover,
.bmp-suggest__item.is-active {
  background: var(--bmp-amber-50);
  color: var(--bmp-text-strong);
}
.bmp-suggest__empty {
  padding: 9px 12px;
  font-size: 14px;
  color: var(--bmp-text-subtle);
}

/* ---- submit button (sits at the end of the bar, aligned to inputs) ---- */
.bmp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--bmp-control);
  padding: 0 24px;
  font-family: var(--bmp-font-sans);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--bmp-radius-md);
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 60ms ease;
}
.bmp-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bmp-focus-ring); }
.bmp-btn--primary {
  color: var(--bmp-text-on-accent);
  background: var(--bmp-amber-500);
}
.bmp-btn--primary:hover { background: var(--bmp-amber-600); }
.bmp-btn--primary:active { transform: translateY(1px); }
.bmp-btn--ghost {
  color: var(--bmp-text-strong);
  background: var(--bmp-surface-sunken);
  border-color: var(--bmp-border-default);
}
.bmp-btn--ghost:hover { background: var(--bmp-bone-200); }
.bmp-btn--sm { height: 38px; padding: 0 16px; font-size: 13.5px; }
.bmp-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---- spinner ---- */
.bmp-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(12, 22, 38, 0.25);
  border-top-color: var(--bmp-text-on-accent);
  border-radius: 50%;
  animation: bmp-spin 0.7s linear infinite;
}
.bmp-spinner--lg { width: 24px; height: 24px; border-color: rgba(20,35,64,0.18); border-top-color: var(--bmp-navy-700); }
@keyframes bmp-spin { to { transform: rotate(360deg); } }

/* ---- form error ---- */
.bmp-form-error {
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--bmp-clay-500);
  background: var(--bmp-clay-50);
  border: 1px solid rgba(192, 73, 47, 0.25);
  border-radius: var(--bmp-radius-md);
}

/* ---- results PANEL (PR7D) — [hidden] until a search runs or a saved preview is
       restored. Desktop: floats over the map, top-right (never covers the top-left
       filters or the centered search). Mobile: stacked below the hero. ---- */
.bmp-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 360px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 168px);     /* leaves the bottom-right zoom visible */
  display: flex;
  flex-direction: column;
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-lg);
  box-shadow: 0 24px 60px rgba(10, 19, 34, 0.4);
  overflow: hidden;
}
.bmp-panel__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 13px 15px 11px; border-bottom: 1px solid var(--bmp-border-subtle); flex: 0 0 auto;
}
.bmp-panel__title { margin: 0; font-family: var(--bmp-font-display); font-size: 17px; font-weight: 600; color: var(--bmp-text-strong); }
.bmp-panel__sub { margin: 2px 0 0; font-size: 12.5px; color: var(--bmp-text-muted); overflow: hidden; text-overflow: ellipsis; }
.bmp-panel__close { background: none; border: none; cursor: pointer; color: var(--bmp-text-subtle); font-size: 15px; line-height: 1; padding: 2px 4px; }
.bmp-panel__close:hover { color: var(--bmp-text-strong); }
.bmp-panel__body { flex: 1 1 auto; overflow-y: auto; padding: 12px; }

.bmp-state {
  padding: 14px 16px;
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-subtle);
  border-radius: var(--bmp-radius-md);
}
.bmp-state p { margin: 0; }
.bmp-state--empty, .bmp-state--error { padding: 18px; text-align: center; }
.bmp-state--loading { display: flex; flex-direction: row; align-items: center; gap: 12px; color: var(--bmp-text-muted); font-size: 14px; }
.bmp-state__title { margin: 0 0 6px; font-weight: 700; color: var(--bmp-text-strong); }
.bmp-state__text { margin: 0; color: var(--bmp-text-muted); font-size: 13.5px; }
.bmp-state--error .bmp-state__title { color: var(--bmp-clay-500); }

.bmp-cards { display: flex; flex-direction: column; gap: 10px; }
.bmp-results-head {
  margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--bmp-text-muted);
}

/* commercial result card: numbered carrier line, distance, recency, reveal CTA */
.bmp-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 13px 14px;
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-subtle);
  border-radius: var(--bmp-radius-md);
  box-shadow: var(--bmp-shadow-sm);
}
.bmp-card__head { margin: 0 0 4px; font-size: 14.5px; line-height: 1.35; color: var(--bmp-text-strong); }
.bmp-card__rank { font-family: var(--bmp-font-mono); font-weight: 600; color: var(--bmp-text-muted); }
.bmp-card__carrier { font-weight: 700; }
.bmp-card__carrier.is-verified { color: var(--bmp-spruce-500); }
.bmp-card__line { margin: 1px 0 0; font-size: 13px; color: var(--bmp-text-body); }
.bmp-card__line--muted { color: var(--bmp-text-muted); }
.bmp-card__tag {
  display: inline-block; margin-top: 7px; padding: 2px 9px; font-size: 11px; font-weight: 600;
  color: var(--bmp-amber-600); background: var(--bmp-amber-50);
  border: 1px solid rgba(224, 146, 47, 0.3); border-radius: 999px;
}
.bmp-card__cov { margin-top: 6px; font-size: 12px; color: var(--bmp-text-subtle); }

/* reveal CTA — opens the registration-gate popover (real auth lands in PR8) */
.bmp-reveal-cta {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  height: 36px; padding: 0 14px;
  font-family: var(--bmp-font-sans); font-size: 13px; font-weight: 600; color: var(--bmp-text-strong);
  background: var(--bmp-bone-100); border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-md); cursor: pointer; white-space: nowrap;
  transition: background-color 120ms ease;
}
.bmp-reveal-cta:hover { background: var(--bmp-bone-200); }
.bmp-reveal-cta:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bmp-focus-ring); }

.bmp-disclaimer { margin: 12px 2px 2px; font-size: 11.5px; color: var(--bmp-text-subtle); }

/* desktop: shift the zoom controls left while the panel is open so they stay usable */
.bmp-root.bmp-has-results .bmp-map-zoom { right: calc(360px + 28px); }

@media (max-width: 860px) {
  /* stacked below the hero, full width */
  .bmp-panel {
    position: static; width: auto; max-width: none; max-height: none;
    margin-top: 14px; box-shadow: var(--bmp-shadow-md);
  }
  .bmp-panel__body { max-height: none; }
  .bmp-root.bmp-has-results .bmp-map-zoom { right: 12px; }   /* reset: panel no longer overlays */
}

/* ---- reveal CTA popover (registration gate) ---- */
.bmp-reveal-pop {
  position: fixed;
  z-index: 1000;
  width: min(300px, calc(100vw - 28px));
  padding: 16px 16px 14px;
  background: var(--bmp-surface-card);
  border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-lg);
  box-shadow: 0 18px 50px rgba(10, 19, 34, 0.32);
  text-align: left;
}
.bmp-reveal-pop__close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; cursor: pointer;
  color: var(--bmp-text-subtle); font-size: 14px; line-height: 1;
}
.bmp-reveal-pop__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-bottom: 10px;
  color: var(--bmp-amber-600);
  background: var(--bmp-amber-50);
  border: 1px solid rgba(224, 146, 47, 0.3);
  border-radius: var(--bmp-radius-md);
}
.bmp-reveal-pop__title { margin: 0 0 5px; font-size: 15px; font-weight: 700; color: var(--bmp-text-strong); }
.bmp-reveal-pop__text { margin: 0 0 13px; font-size: 12.5px; line-height: 1.45; color: var(--bmp-text-muted); }
.bmp-reveal-pop__actions { display: flex; gap: 8px; }
.bmp-reveal-pop__actions .bmp-btn { flex: 1 1 auto; }
.bmp-reveal-pop__soon { margin: 10px 0 0; font-size: 11.5px; color: var(--bmp-text-subtle); text-align: center; }

/* ====== PR7C — live supply map ====== */
/* Leaflet mounts into .bmp-hero__bg. Give the map a distinct, darker "ocean" tone
   (deep ink-blue) so inactive states read as land, not sea. */
.bmp-hero .leaflet-container { background: #081426; font-family: var(--bmp-font-sans); }
.bmp-hero .leaflet-interactive:focus { outline: none; }

/* Overlay layer sits between the map (z0) and the floating search (z3). The
   container ignores pointer events; only the actual controls capture them, so
   the map stays draggable on empty areas. */
.bmp-mapui { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.bmp-mapui > * { pointer-events: auto; }

/* filter toolbar (top-left) — compact */
.bmp-mapf { position: absolute; left: 14px; top: 14px; width: 232px; max-width: calc(100% - 28px); display: flex; flex-direction: column; gap: 6px; }
.bmp-mapf__toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: rgba(20, 35, 64, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--bmp-radius-md);
  color: var(--bmp-bone-50); font-family: var(--bmp-font-sans); font-size: 12.5px; font-weight: 700;
  padding: 9px 12px; cursor: pointer; text-align: left;
}
.bmp-mapf__toggle > svg { color: var(--bmp-amber-500); flex: 0 0 auto; }
.bmp-mapf__count { margin-left: auto; font-family: var(--bmp-font-mono); font-size: 11px; font-weight: 600; color: var(--bmp-amber-500); }
.bmp-mapf__panel {
  display: flex; flex-direction: column; gap: 9px;
  background: rgba(20, 35, 64, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--bmp-radius-md);
  padding: 10px 11px; max-height: min(58vh, 420px); overflow-y: auto;
}
.bmp-mapf.is-collapsed .bmp-mapf__panel { display: none; }
.bmp-mapf__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bmp-mapf__switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--bmp-bone-50); cursor: pointer; }
.bmp-mapf__switch input { width: 16px; height: 16px; accent-color: var(--bmp-amber-500); cursor: pointer; flex: 0 0 auto; }
.bmp-mapf__field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bmp-mapf__label { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--bmp-amber-300, #f0b357); }
.bmp-mapselect {
  width: 100%; height: 32px; padding: 0 26px 0 9px; font-family: var(--bmp-font-sans); font-size: 12.5px;
  color: var(--bmp-bone-50); background-color: rgba(12, 22, 38, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--bmp-radius-sm);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23E0922F' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.bmp-mapselect option, .bmp-mapselect optgroup { color: #14233F; }
.bmp-mapf__details { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 9px; }
.bmp-mapf__details > summary { font-size: 12.5px; font-weight: 600; color: var(--bmp-bone-50); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.bmp-mapf__details > summary::-webkit-details-marker { display: none; }
.bmp-mapf__chip { margin-left: auto; font-family: var(--bmp-font-mono); font-size: 10.5px; color: var(--bmp-amber-500); }
.bmp-mapf__checks { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.bmp-mapf__checks--scroll { max-height: 150px; overflow-y: auto; padding-right: 4px; }
.bmp-mapf__check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--bmp-bone-50); cursor: pointer; }
.bmp-mapf__check input { width: 15px; height: 15px; accent-color: var(--bmp-amber-500); cursor: pointer; flex: 0 0 auto; }

/* zoom controls (bottom-right) */
.bmp-map-zoom { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.bmp-map-zoom button {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--bmp-surface-card); border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-md); box-shadow: var(--bmp-shadow-md);
  color: var(--bmp-text-strong); font-size: 19px; line-height: 1; cursor: pointer;
}
.bmp-map-zoom button:hover { background: var(--bmp-bone-100); }

/* legend (bottom-left) */
.bmp-map-legend {
  position: absolute; left: 16px; bottom: 16px; display: flex; align-items: baseline; gap: 8px;
  background: rgba(20, 35, 64, 0.84); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--bmp-radius-md); padding: 9px 13px; max-width: 220px;
}
.bmp-map-legend__num { font-family: var(--bmp-font-mono); font-size: 20px; font-weight: 600; color: var(--bmp-bone-50); letter-spacing: -0.02em; }
.bmp-map-legend__lbl { font-size: 11.5px; color: rgba(246, 240, 228, 0.7); line-height: 1.2; }

/* buscar esta zona (bottom-center) */
.bmp-map-zone {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  background: var(--bmp-surface-card); border: 1px solid var(--bmp-border-default);
  border-radius: 999px; box-shadow: var(--bmp-shadow-md);
  font-family: var(--bmp-font-sans); font-size: 14px; font-weight: 600; color: var(--bmp-text-strong); cursor: pointer;
}
.bmp-map-zone > svg { color: var(--bmp-amber-600); }

/* status overlay (top-center) */
.bmp-map-status {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  background: rgba(20, 35, 64, 0.92); color: var(--bmp-bone-50);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.bmp-map-status.is-error { background: var(--bmp-clay-500); border-color: transparent; }
.bmp-map-status.is-soft { background: rgba(20, 35, 64, 0.82); color: rgba(246, 240, 228, 0.85); font-weight: 500; }

/* aggregate popup / tooltip (NO carrier identity — totals + unit breakdown only) */
.bmp-hero .leaflet-popup-content-wrapper { background: var(--bmp-surface-card); border-radius: var(--bmp-radius-md); box-shadow: var(--bmp-shadow-md); }
.bmp-hero .leaflet-popup-content { margin: 13px 15px; font-family: var(--bmp-font-sans); }
.bmp-hero .leaflet-popup-tip { background: var(--bmp-surface-card); }
.bmp-maptip {
  background: var(--bmp-surface-card); border: 1px solid var(--bmp-border-default);
  border-radius: var(--bmp-radius-md); box-shadow: var(--bmp-shadow-md); padding: 11px 13px;
}
.bmp-maptip::before { display: none; }
.bmp-mappop__eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bmp-amber-700); }
.bmp-mappop__name { margin: 2px 0 0; font-family: var(--bmp-font-display); font-size: 17px; font-weight: 600; color: var(--bmp-text-strong); }
.bmp-mappop__total { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 6px; }
.bmp-mappop__total b { font-family: var(--bmp-font-mono); font-size: 22px; font-weight: 600; color: var(--bmp-text-strong); }
.bmp-mappop__total span { font-size: 12px; color: var(--bmp-text-muted); }
.bmp-mappop__empty { margin: 6px 0 0; font-size: 12.5px; color: var(--bmp-text-muted); }
.bmp-mappop__units { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 0; max-height: 134px; overflow-y: auto; }
.bmp-mappop__unit { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 12.5px; color: var(--bmp-text-body); }
.bmp-mappop__unit b { font-family: var(--bmp-font-mono); color: var(--bmp-text-strong); }
.bmp-mappop__ts { margin: 9px 0 0; font-family: var(--bmp-font-mono); font-size: 11px; color: var(--bmp-text-subtle); }

@media (max-width: 640px) {
  .bmp-hero { min-height: 520px; }
  /* toolbar becomes a top, full-width drawer (collapsed by default via JS); the
     hero content is padded down to clear it, so nothing overlaps. */
  .bmp-mapf { left: 12px; right: 12px; top: 12px; width: auto; max-width: none; }
  .bmp-mapf__panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 56vh; }
  .bmp-map-status { top: auto; bottom: 64px; }
  .bmp-map-zoom { right: 12px; bottom: 12px; }
  .bmp-map-zoom button { width: 36px; height: 36px; font-size: 17px; }
  .bmp-map-legend { display: none; }            /* avoid bottom-edge clutter on small screens */
  .bmp-map-zone { bottom: 12px; }
}
