/* ============================================================
   mapa.bebamaat.com.br — pagina publica de pontos de venda
   tokens: copia enxuta de maat-design-system/project/colors_and_type.css
   regra dura: laranja SO no CTA de rota. nunca em fundo, pin ou massa.
   mobile-first: o base e o celular; o desktop entra em min-width 900px.
   ============================================================ */

/* ---------- fontes self-hosted (woff2 subsetado) ----------
   syne-var.woff2      32 KB  — latin + pt-BR, eixo wght 400..800
   yapari-maat.woff2  2,8 KB  — subset com 3 glifos: M, A, T

   LICENCA (decisao do Lucas, 28/08/2026): o arquivo de origem e
   YapariTrial-BoldWide.ttf, da Power Type Foundry, cuja licenca trial proibe
   uso comercial. A licenca sera resolvida depois; ate la a marca segue como
   esta — a palavra MAAT e wordmark e usa Yapari SEMPRE, nunca a fonte do corpo.
   Comprar em power-type.com/yapari exige desktop (artes) + webfont (por
   dominio: bebamaat.com.br, mapa.bebamaat.com.br, pedidos.bebamaat.com.br).
   A mesma pendencia existe hoje na loja Shopify, que ja publica a trial.
   ---------------------------------------------------------- */
@font-face {
  font-family: 'Syne';
  src: url('/fonts/syne-var.woff2') format('woff2-variations'),
       url('/fonts/syne-var.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Yapari';
  src: url('/fonts/yapari-maat.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: block; /* block, nao swap: o wordmark nao pode piscar em outra fonte */
}

:root {
  /* marca */
  --maat-floresta: #19433A;
  --maat-agua:     #B9DFFC;
  --maat-branco:   #FDFDFD;
  --maat-folha:    #58AA43;
  --maat-laranja:  #E07434;

  --floresta-900: #0E2A24;
  --floresta-800: #123530;
  --floresta-600: #245A4F;
  --floresta-500: #2E7265;
  --agua-200: #D2EAFD;
  --laranja-600: #C45E24;
  --laranja-700: #A94F1E;
  --folha-600: #468E36;

  /* semanticos */
  --bg:           var(--maat-floresta);
  --bg-alt:       var(--floresta-800);
  --surface:      var(--maat-branco);
  --surface-soft: #F4F0E9;
  --fg:           var(--maat-agua);
  --fg-strong:    var(--maat-branco);
  --fg-muted:     rgba(185, 223, 252, 0.7);
  --fg-on-light:  var(--maat-floresta);
  --fg-on-light-muted: rgba(25, 67, 58, 0.7);
  --border:       rgba(185, 223, 252, 0.22);
  --border-strong:rgba(185, 223, 252, 0.4);
  --border-light: rgba(25, 67, 58, 0.14);

  /* CTA — fundo em laranja-600 (#C45E24): branco sobre ele da 4,15:1,
     que passa AA como TEXTO GRANDE. por isso o botao e 19px/700
     (>= 14pt bold). laranja-500 puro daria 3,07:1 e reprovaria. */
  --cta:       var(--laranja-600);
  --cta-hover: var(--laranja-700);

  /* familias de pin — 3 cores, nao 7: a paleta MAAT nao comporta 7 e o
     guia manda diferenciar por rotulo. cor + forma, nunca so cor. */
  --pin-comer:   var(--maat-floresta);
  --pin-padaria: var(--floresta-500);
  --pin-mercado: var(--folha-600);

  --font-sans: 'Syne', 'Inter', system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.82rem, 0.78rem + 0.2vw, 0.875rem);
  --step-0:  clamp(0.95rem, 0.9rem + 0.25vw, 1rem);
  --step-4:  clamp(1.55rem, 1.2rem + 1.4vw, 2.4rem);

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px;

  --r-xs: 6px; --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;

  --shadow-sm:  0 1px 2px rgba(14, 42, 36, 0.16);
  --shadow-md:  0 6px 20px rgba(14, 42, 36, 0.22);
  --shadow-lg:  0 -12px 40px rgba(14, 42, 36, 0.32);
  --shadow-cta: 0 8px 24px rgba(224, 116, 52, 0.35);
  --ring:     0 0 0 3px rgba(185, 223, 252, 0.55);
  --ring-cta: 0 0 0 3px rgba(224, 116, 52, 0.45);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;

  --alvo: 44px;                       /* alvo minimo de toque */
  --painel-w: clamp(340px, 30vw, 420px);
  --topo-h: 108px;                    /* medido em JS */
  --sheet-peek: 152px;
  --sheet-meio: 54dvh;
  --sheet-cheio: min(86dvh, calc(100dvh - var(--topo-h) - 12px));
  --attrib-b: 160px;                  /* ajustado em JS conforme o sheet */
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ============================================================
   base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

/* componentes com display explicito (grid/flex) ignoram o [hidden] da UA */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;                 /* a pagina nunca rola na horizontal */
  overscroll-behavior-y: none;
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--fg-strong); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-xs);
}

.maat-word {
  font-family: 'Yapari', var(--font-sans);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.pular {
  position: absolute; left: var(--sp-3); top: -120px; z-index: 60;
  background: var(--maat-agua); color: var(--fg-on-light);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm);
  font-weight: 700; text-decoration: none;
  transition: top var(--dur-fast) var(--ease-out);
}
.pular:focus { top: var(--sp-3); }

.eyebrow {
  margin: 0;
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-muted);
}

.noscript {
  position: fixed; inset: auto var(--sp-4) var(--sp-4);
  z-index: 50; background: var(--bg-alt); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-4); max-width: 480px;
}

/* ============================================================
   shell — mobile: mapa cheio + bottom sheet. desktop: sidebar.
   ============================================================ */
.shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* --- topo --- */
.topo {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  padding: calc(var(--sp-3) + env(safe-area-inset-top, 0px)) var(--sp-4) var(--sp-3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topo__eyebrow {
  margin: 0 0 2px;
  font-size: 0.625rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-muted);
}
.topo__h1 {
  margin: 0;
  font-size: var(--step-4); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.05;
  text-wrap: balance; color: var(--fg-strong);
}
.topo__h1 .maat-word { font-size: 0.86em; }
.topo__resumo {
  margin: var(--sp-2) 0 0;
  font-size: var(--step--1); color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* --- mapa --- */
.mapa-wrap { position: absolute; inset: 0; z-index: 1; background: #eceff1; }
.mapa { position: absolute; inset: 0; }

.mapa__vazio {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  z-index: 3; pointer-events: none;
  background: var(--surface); color: var(--fg-on-light);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-5);
  box-shadow: var(--shadow-md);
  font-size: var(--step--1); font-weight: 600;
  max-width: min(320px, 80vw); text-align: center;
}
.mapa__vazio p { margin: 0; }

/* --- painel: bottom sheet no celular ---
   anima ALTURA (nao translate) para que rodape e atribuicao nunca
   fiquem abaixo da dobra e a lista role dentro do que se ve. --- */
.painel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex; flex-direction: column;
  height: var(--sheet-meio);
  overflow: hidden;
  background: var(--bg);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
  transition: height var(--dur-base) var(--ease-out);
}
.painel[data-estado="peek"]  { height: var(--sheet-peek); }
.painel[data-estado="meio"]  { height: var(--sheet-meio); }
.painel[data-estado="cheio"] { height: var(--sheet-cheio); }
.painel[data-arrastando="1"] { transition: none; }

.painel__alca {
  flex: none; width: 100%; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0;
  cursor: grab; touch-action: none;
}
.painel__alca:active { cursor: grabbing; }
.painel__alca-risco {
  width: 44px; height: 4px; border-radius: var(--r-pill);
  background: var(--border-strong);
}

.painel__topo {
  flex: none;
  display: flex; gap: var(--sp-2); align-items: center;
  padding: var(--sp-1) var(--sp-4) var(--sp-3);
}

.painel__corpo {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* --- busca --- */
.busca { position: relative; flex: 1 1 auto; min-width: 0; }
.busca__lupa {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--fg-on-light-muted); pointer-events: none; display: flex;
}
.busca__input {
  width: 100%; min-height: var(--alvo);
  padding: 0 40px 0 42px;
  font: inherit;
  /* 16px CRAVADO, nao --step-0. O token fluido resolve pra 15,3px num 360px, e
     abaixo de 16px o Safari do iOS da zoom no foco do campo — e nao desfaz
     sozinho: o usuario fica com o mapa esticado ate reenquadrar na mao.
     Aqui a acessibilidade do toque vence a escala tipografica. */
  font-size: 16px;
  color: var(--fg-on-light);
  background: var(--surface-soft);   /* o ui-kit usa --maat-cream, token fantasma */
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  appearance: none;
}
.busca__input::placeholder { color: var(--fg-on-light-muted); opacity: 1; }
.busca__input::-webkit-search-cancel-button { display: none; }
.busca__input:focus-visible { box-shadow: var(--ring); border-color: var(--maat-branco); }
.busca__limpar {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--r-pill);
  color: var(--fg-on-light-muted); cursor: pointer;
}
.busca__limpar:hover { color: var(--fg-on-light); }
.busca__limpar:focus-visible { box-shadow: var(--ring-cta); }

/* --- perto de mim (secundario: agua, nunca laranja) --- */
.btn-perto {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--alvo); min-width: var(--alvo);
  padding: 0 var(--sp-3);
  background: transparent; color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  font-size: var(--step--1); font-weight: 600; cursor: pointer;
  transition: color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.btn-perto:hover { color: var(--fg-strong); border-color: var(--maat-agua); }
.btn-perto[aria-pressed="true"] {
  background: var(--maat-agua); color: var(--fg-on-light); border-color: var(--maat-agua);
}
.btn-perto[data-carregando="1"] { opacity: 0.55; pointer-events: none; }
.btn-perto__txt { display: none; }

/* --- aviso sempre visivel no peek do sheet --- */
.aviso-fixo {
  flex: none; margin: 0;
  padding: 0 var(--sp-4) var(--sp-3);
  font-size: 0.6875rem; line-height: 1.4;
  color: var(--fg-muted);
}

/* --- filtros / legenda clicavel --- */
.filtros { flex: none; padding: 0 0 var(--sp-3); }
.filtros .eyebrow { margin-bottom: var(--sp-2); padding: 0 var(--sp-4); }
/* trilho horizontal no celular: empilhado, 7 tipos comiam ~200px de altura e
   sobrava nada pra lista. o trilho rola dentro de si — a pagina, nunca. */
.chips {
  display: flex; flex-wrap: nowrap; gap: var(--sp-2);
  overflow-x: auto; overflow-y: hidden;
  padding: 2px var(--sp-4) 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--alvo); padding: 0 var(--sp-3);
  background: transparent; color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  font-size: 0.8125rem; font-weight: 600; text-transform: lowercase;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
}
.chip:hover { border-color: var(--border-strong); color: var(--fg-strong); }
.chip[aria-pressed="false"] { opacity: 0.42; }
.chip[aria-pressed="true"] { background: rgba(185, 223, 252, 0.12); border-color: var(--border-strong); }
/* sobre o painel floresta, um dot floresta desapareceria: leva anel agua de
   2px, que e exatamente a leitura do pin no mapa em miniatura. */
.chip__ponto {
  width: 10px; height: 10px; border-radius: var(--r-pill); flex: none;
  background: var(--ponto, var(--maat-agua));
  box-shadow: 0 0 0 2px var(--maat-agua);
}
.chip__n { font-variant-numeric: tabular-nums; color: var(--fg-muted); font-weight: 700; }

/* --- lista --- */
.lista {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0; padding: 0 var(--sp-3) var(--sp-2);
  list-style: none;
}
.lista:focus-visible { box-shadow: none; }

.item {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  width: 100%; min-height: 56px;
  padding: var(--sp-3);
  background: transparent; border: 0; border-radius: var(--r-md);
  text-align: left; cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out);
}
.item:hover { background: rgba(185, 223, 252, 0.08); }
.item[aria-current="true"] {
  background: rgba(185, 223, 252, 0.14);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.item__ponto {
  flex: none; margin-top: 7px;
  width: 10px; height: 10px; border-radius: var(--r-pill);
  background: var(--ponto, var(--maat-agua));
  box-shadow: 0 0 0 2px var(--maat-agua);
}
.item__txt { min-width: 0; flex: 1 1 auto; }
.item__nome {
  display: block;
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.012em;
  line-height: 1.25; color: var(--fg-strong);
}
.item__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  margin-top: 5px;
}
.item__bairro { font-size: var(--step--1); color: var(--fg-muted); }
.item__dist {
  display: block; margin-top: 3px;
  font-size: 0.75rem; font-weight: 700; color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* badge de tipo — Syne 700, 10px, caixa alta, 0.08em */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.625rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: rgba(185, 223, 252, 0.12);
  color: var(--fg); white-space: nowrap;
}
.badge__ponto {
  width: 8px; height: 8px; border-radius: var(--r-pill); flex: none;
  background: var(--ponto, var(--maat-agua));
  box-shadow: 0 0 0 2px var(--maat-agua);
}

/* --- estados: erro / zero --- */
.estado {
  flex: none; margin: var(--sp-2) var(--sp-4) var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-alt);
}
.estado__msg { margin: 0 0 var(--sp-3); font-size: var(--step--1); color: var(--fg); }

.btn-secundario {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--alvo); padding: 0 var(--sp-5);
  background: var(--maat-agua); color: var(--fg-on-light);
  border: 0; border-radius: var(--r-pill);
  font-size: var(--step--1); font-weight: 700; cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out);
}
.btn-secundario:hover { background: var(--agua-200); }

/* --- skeleton --- */
.sk { padding: var(--sp-3); }
.sk__l {
  display: block; height: 12px; border-radius: var(--r-xs);
  background: linear-gradient(90deg,
    rgba(185,223,252,0.10) 0%, rgba(185,223,252,0.20) 50%, rgba(185,223,252,0.10) 100%);
  background-size: 200% 100%;
  animation: sk 1400ms linear infinite;
}
.sk__l--a { width: 62%; height: 15px; }
.sk__l--b { width: 40%; margin-top: 9px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- rodape --- */
.rodape {
  flex: none;
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + var(--safe-b));
  border-top: 1px solid var(--border);
}
.rodape p { margin: 0 0 var(--sp-2); }
.rodape p:last-child { margin-bottom: 0; }
.rodape__aviso { font-size: 0.75rem; color: var(--fg); }
.rodape__attrib { font-size: 0.6875rem; line-height: 1.5; color: var(--fg-muted); }
.rodape__attrib a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.rodape__attrib a:hover { color: var(--fg-strong); }
.rodape__maat { font-size: 0.6875rem; color: var(--fg-muted); }
.rodape__maat .maat-word { color: var(--fg); }

/* ============================================================
   marcadores — elementos DOM (tabulaveis, com aria-label)
   o MapLibre escreve transform inline no ELEMENTO do marcador,
   entao todo efeito visual vai no filho .pin__i / .cluster__i.
   ============================================================ */
.pin {
  width: 44px; height: 46px; padding: 0 6px;
  display: flex; align-items: flex-end; justify-content: center;
  background: none; border: 0; border-radius: var(--r-sm);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pin__i {
  display: block; transform-origin: 50% 100%;
  transition: transform var(--dur-base) var(--ease-out);
  filter: drop-shadow(0 2px 4px rgba(14, 42, 36, 0.35));
}
.pin:hover .pin__i { transform: translateY(-2px); }
.pin[aria-pressed="true"] { z-index: 3; }
.pin[aria-pressed="true"] .pin__i { transform: scale(1.15); }
.pin:focus-visible {
  outline: 3px solid var(--maat-floresta);
  outline-offset: 1px;
  background: rgba(185, 223, 252, 0.9);
  box-shadow: none;
}

.cluster {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--maat-floresta);
  border: 2px solid var(--maat-agua);
  color: var(--maat-agua);
  font-size: 0.875rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer; box-shadow: var(--shadow-md);
  transition: background-color var(--dur-base) var(--ease-out);
}
.cluster:hover { background: var(--floresta-600); }
.cluster:focus-visible {
  outline: 3px solid var(--maat-floresta);
  outline-offset: 2px; box-shadow: none;
}

.eu {
  width: 18px; height: 18px; border-radius: var(--r-pill);
  background: var(--maat-agua);
  border: 3px solid var(--maat-floresta);
  box-shadow: 0 0 0 4px rgba(185, 223, 252, 0.4);
}

/* ============================================================
   popup — sobrescreve o chrome cinza do MapLibre
   ============================================================ */
.maplibregl-popup-content {
  background: var(--surface);
  color: var(--fg-on-light);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
  font-family: var(--font-sans);
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }

.maplibregl-popup-close-button {
  width: 36px; height: 36px; right: 6px; top: 6px;
  border-radius: var(--r-pill);
  color: var(--fg-on-light-muted);
  font-size: 20px; line-height: 1; background: transparent;
}
.maplibregl-popup-close-button:hover { background: rgba(25, 67, 58, 0.08); color: var(--fg-on-light); }
.maplibregl-popup-close-button:focus-visible { box-shadow: var(--ring-cta); }

.pop { outline: none; max-width: 280px; }
.pop .badge { background: rgba(25, 67, 58, 0.08); color: var(--fg-on-light); }
.pop .badge__ponto { box-shadow: 0 0 0 1px rgba(25, 67, 58, 0.25); }
.pop__nome {
  margin: var(--sp-2) 0 var(--sp-1);
  font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.012em;
  line-height: 1.2; color: var(--fg-on-light); text-wrap: balance;
}
.pop__end, .pop__local {
  margin: 0; font-size: 0.875rem; line-height: 1.5;
  color: var(--fg-on-light-muted);
}
.pop__local { margin-top: 2px; font-weight: 600; }
.pop__dist {
  margin: var(--sp-2) 0 0;
  font-size: 0.8125rem; font-weight: 700;
  color: var(--fg-on-light); font-variant-numeric: tabular-nums;
}

/* o unico laranja da pagina */
.btn-rota {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  margin-top: var(--sp-4);
  min-height: 48px; padding: 0 var(--sp-5);
  background: var(--cta); color: var(--maat-branco);
  border-radius: var(--r-pill);
  font-size: 1.1875rem;              /* 19px/700 = texto grande p/ WCAG (>= 14pt bold) */
  font-weight: 700; letter-spacing: -0.01em;
  text-decoration: none; box-shadow: var(--shadow-cta);
  transition: background-color var(--dur-base) var(--ease-out);
}
.btn-rota:hover { background: var(--cta-hover); color: var(--maat-branco); }
.btn-rota:focus-visible { box-shadow: var(--shadow-cta), var(--ring-cta); }
.btn-rota svg { flex: none; }

/* ============================================================
   controles do MapLibre — icones redesenhados em floresta
   (o icone default e um SVG quase preto; filtro de cor nao resolve)
   ============================================================ */
.maplibregl-ctrl-group {
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-light);
}
.maplibregl-ctrl-group button { width: var(--alvo); height: var(--alvo); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--border-light); }
.maplibregl-ctrl-group button:hover { background: var(--surface-soft); }
.maplibregl-ctrl-group button:focus-visible { box-shadow: var(--ring-cta); }
.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 4.5v11M4.5 10h11' fill='none' stroke='%2319433A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10h11' fill='none' stroke='%2319433A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* atribuicao: obrigatoria por licenca, sempre visivel, nunca atras de toggle */
.maplibregl-ctrl-attrib {
  background: rgba(253, 253, 253, 0.88);
  font-family: var(--font-sans);
  font-size: 10px; line-height: 1.5;
  color: var(--fg-on-light-muted);
  padding: 2px 8px; border-radius: var(--r-xs) 0 0 0;
  max-width: min(100%, 94vw);
}
.maplibregl-ctrl-attrib a { color: var(--fg-on-light); text-decoration: underline; }
.maplibregl-ctrl-bottom-right { z-index: 4; }
.maplibregl-ctrl-logo { display: none; }

/* mobile: afasta os controles do topo e do sheet */
@media (max-width: 899.98px) {
  .maplibregl-ctrl-top-right { margin-top: calc(var(--topo-h) + 12px); }
  .maplibregl-ctrl-bottom-right,
  .maplibregl-ctrl-bottom-left { margin-bottom: var(--attrib-b); }
  .rodape__aviso { display: none; }   /* ja aparece em .aviso-fixo, sempre visivel */
  .rodape__maat { display: none; }    /* decorativo: cede a altura pra lista */

  /* A ficha e mais estreita no celular (ver larguraFicha() no app.js: e o que
     impede o MapLibre de jogar parte dela pra fora da tela quando ancora pela
     lateral). Com menos largura, o respiro interno cede pro conteudo — senao a
     sobra util fica menor que o CTA e o botao estoura o cartao. */
  .maplibregl-popup-content { padding: 16px; }
  .btn-rota { padding: 0 var(--sp-3); }
}

/* ============================================================
   desktop: sidebar fixa, sem sheet
   os seletores repetem [data-estado] para vencer a especificidade
   das regras de estado do sheet.
   ============================================================ */
@media (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: var(--painel-w) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .topo {
    position: relative; grid-area: 1 / 1 / 2 / 2;
    padding: var(--sp-6) var(--sp-5) var(--sp-4);
    border-bottom: 0;
  }
  .painel, .painel[data-estado] {
    position: relative; grid-area: 2 / 1 / 3 / 2;
    height: auto; min-height: 0;
    border: 0; border-radius: 0; box-shadow: none;
    transition: none;
  }
  .mapa-wrap { position: relative; grid-area: 1 / 2 / 3 / 3; inset: auto; }
  .painel__alca { display: none; }
  .painel__topo { padding: 0 var(--sp-5) var(--sp-3); }
  .aviso-fixo { display: none; }
  .filtros { padding: 0 0 var(--sp-4); }
  .filtros .eyebrow { padding: 0 var(--sp-5); }
  .chips { flex-wrap: wrap; overflow: visible; padding: 0 var(--sp-5); }
  .lista { padding: 0 var(--sp-4) var(--sp-2); }
  .estado { margin: var(--sp-2) var(--sp-5) var(--sp-4); }
  .rodape { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
  .btn-perto { padding: 0 var(--sp-4); }
  .btn-perto__txt { display: inline; }
}

@media (min-width: 1400px) { :root { --painel-w: 440px; } }

/* ============================================================
   preferencias do usuario
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pin:hover .pin__i { transform: none; }
}

@media (prefers-contrast: more) {
  :root {
    --fg-muted: rgba(185, 223, 252, 0.92);
    --border: rgba(185, 223, 252, 0.5);
    --fg-on-light-muted: rgba(25, 67, 58, 0.92);
  }
}

@media print {
  .painel, .painel[data-estado], .topo { position: static; height: auto; }
  .mapa-wrap { position: static; height: 60vh; }
}
