/* mama map — every sale as a dot on a globe.
   Brand: peach #fff5ea, ink #0b0b0b, 30px pills, Space Mono labels, serif
   headings. Uses Fable theme CSS vars where available, on-brand fallbacks.
   Self-contained for the store (theme widgets never link brand.css). */

/* media shell — same treatment as the shipping map page: the map leads,
   chrome recedes, near edge-to-edge on mobile. */
.mama-map-page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
@media (max-width: 767px) {
  .mama-map-page { padding: 8px 6px 24px; }
  .mama-map { border-radius: 14px; }
}

/* Intro line above the globe card */
.mama-map__intro {
  font-family: var(--FONT-STACK-HEADING, "Petrona", Georgia, serif);
  color: var(--COLOR-HEADING, #0b0b0b);
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.45;
  max-width: 40rem;
  margin: 28px auto 0;
}
.mama-map__subtext {
  font-family: var(--FONT-STACK-LABEL, "Space Mono", ui-monospace, monospace);
  color: var(--COLOR-HEADING, #0b0b0b);
  opacity: .55;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .075em;
  font-size: .62rem;
  margin: 8px auto 0;
}
@media (max-width: 540px) {
  .mama-map__intro { font-size: 1rem; padding: 0 8px; }
}

.mama-map {
  --mms-peach: var(--COLOR-INPUT-BG, #fff5ea);
  --mms-ink: var(--COLOR-HEADING, #0b0b0b);
  --mms-border: var(--COLOR-BORDER, #0b0b0b);
  --mms-radius: var(--RADIUS, 30px);
  --mms-label: var(--FONT-STACK-LABEL, "Space Mono", ui-monospace, monospace);
  --mms-heading: var(--FONT-STACK-HEADING, "Petrona", Georgia, serif);
  --mms-ocean: #cfeaf2;

  position: relative;
  width: 100%;
  /* Near full-viewport, pure CSS. svh is frozen while the mobile URL bar
     moves, so no jitter; the vh line is the fallback for older browsers.
     170px ≈ announcement bar + header + shell padding. */
  height: clamp(420px, 78vh, 760px);
  height: clamp(420px, calc(100svh - 170px), 960px);
  border-radius: var(--mms-radius);
  overflow: hidden;
  border: 1px solid var(--mms-border);
  background: var(--mms-ocean);
  font-family: var(--FONT-STACK-BODY, system-ui, sans-serif);
  color: var(--mms-ink);
  -webkit-tap-highlight-color: transparent;
}

.mama-map__canvas { position: absolute; inset: 0; }
.mama-map .mapboxgl-ctrl-logo,
.mama-map .mapboxgl-ctrl-bottom-right { opacity: .55; }

/* Title chip (top-left) */
.mama-map__title {
  position: absolute; top: 14px; left: 14px; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--mms-peach);
  border: 1px solid var(--mms-border);
  border-radius: var(--mms-radius);
  font-family: var(--mms-heading);
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.mama-map__title small {
  font-family: var(--mms-label);
  text-transform: uppercase;
  letter-spacing: .075em;
  font-size: .58rem;
  opacity: .7;
}
.mms-live-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #e0483e;
  animation: mms-live-pulse 1.6s ease-in-out infinite;
}
@keyframes mms-live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(224,72,62,.45); }
  50% { opacity: .6; box-shadow: 0 0 0 5px rgba(224,72,62,0); }
}

/* Country pills (top-right) — same treatment as the shipping map's chips */
.mama-map__legend {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  display: flex; flex-direction: column; gap: 8px;
  align-items: stretch; /* pills all match the widest one */
}
.mama-map__chip {
  padding: 8px 12px;
  text-align: center;
  background: var(--mms-peach);
  color: var(--mms-ink);
  border: 1px solid var(--mms-border);
  border-radius: var(--mms-radius);
  font-family: var(--mms-label);
  text-transform: uppercase; letter-spacing: .075em;
  font-size: .68rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  transition: transform .15s ease, background .15s ease;
}
.mama-map__chip:hover { transform: translateY(-1px); }
.mama-map__chip[aria-pressed="true"] { background: var(--mms-ink); color: #fff5ea; }

/* Zoom buttons sit above the attribution, rounded to match the brand */
.mama-map .mapboxgl-ctrl-group {
  border-radius: 12px;
  border: 1px solid var(--mms-border);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

/* Loading / error states */
.mama-map__msg {
  position: absolute; inset: 0; z-index: 7; display: grid; place-items: center;
  text-align: center; padding: 24px;
  font-family: var(--mms-label); text-transform: uppercase; letter-spacing: .075em; font-size: .68rem;
  background: var(--mms-ocean);
}
.mama-map__msg.is-hidden { display: none; }

@media (max-width: 540px) {
  .mama-map__title { font-size: .92rem; }
}
