/* ============================================================
   Epoka · mapa — dirección F (Carbón · Tiza · Sol)
   Un solo HTML: en celular el mapa ocupa todo y la lista es un
   carrusel abajo; desde 900 px la lista pasa a una columna a la
   izquierda y el mapa crece a la derecha.
   ============================================================ */

/* ---------- Temas ---------- */
:root, [data-tema="tiza"] {
  --fondo: #F4F2ED; --sup: #FFFFFF; --sup2: #F1EEE8; --tinta: #100704; --gris: #5E5852; --gris2: #6B655E;
  --linea: #E4E0D8; --linea2: #D6D1C8; --acento: #FF5A36; --sobre-acento: #140502; --acento-txt: #C23F1C;
  --barra-dato: #100704; --sobre-dato: #FCF9F6; --dato-suave: #A39A91;
  --vidrio: rgba(255, 255, 255, 0.78); --vidrio-borde: rgba(255, 255, 255, 0.95);
  --sombra: 0 10px 28px rgba(16, 7, 4, 0.12); --sombra-fuerte: 0 18px 44px rgba(16, 7, 4, 0.18);
  --yo: #2F7BF0; --brillo1: #FF5A36; --brillo2: #B9C3E0; --mono1: #E9DCCF; --mono2: #CDB7A2; --mono-txt: #4B3A2E;
  --grueso: 1px;
  color-scheme: light;
}
[data-tema="carbon"] {
  --fondo: #0B0C0E; --sup: #151619; --sup2: #1C1D21; --tinta: #F4F1EC; --gris: #A5A7AD; --gris2: #8E9096;
  --linea: #2A2C31; --linea2: #34363C; --acento: #FF5A36; --sobre-acento: #140502; --acento-txt: #FF7A5C;
  --barra-dato: #050506; --sobre-dato: #F4F1EC; --dato-suave: #8E9096;
  --vidrio: rgba(21, 22, 25, 0.82); --vidrio-borde: rgba(255, 255, 255, 0.1);
  --sombra: 0 12px 30px rgba(0, 0, 0, 0.5); --sombra-fuerte: 0 20px 48px rgba(0, 0, 0, 0.6);
  --yo: #3D8BFF; --brillo1: #FF5A36; --brillo2: #34405F; --mono1: #3A2C24; --mono2: #221A16; --mono-txt: #E7D6C6;
  --grueso: 1px;
  color-scheme: dark;
}
[data-tema="sol"] {
  --fondo: #FFFFFF; --sup: #FFFFFF; --sup2: #F2F2F2; --tinta: #000000; --gris: #222222; --gris2: #333333;
  --linea: #000000; --linea2: #000000; --acento: #B8300C; --sobre-acento: #FFFFFF; --acento-txt: #B8300C;
  --barra-dato: #000000; --sobre-dato: #FFFFFF; --dato-suave: #D0D0D0;
  --vidrio: #FFFFFF; --vidrio-borde: #000000;
  --sombra: 0 0 0 transparent; --sombra-fuerte: 0 0 0 transparent;
  --yo: #0B57D0; --brillo1: transparent; --brillo2: transparent; --mono1: #FFFFFF; --mono2: #FFFFFF; --mono-txt: #000000;
  --grueso: 2px;
  color-scheme: light;
}

:root {
  --letra: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --arriba: env(safe-area-inset-top, 0px);
  --abajo: env(safe-area-inset-bottom, 0px);
  --curva: cubic-bezier(0.2, 0.8, 0.2, 1);
  --panel-ancho: 420px;
  --alto-panel: 236px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--letra); background: var(--fondo); color: var(--tinta); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
svg.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

#app { position: fixed; inset: 0; overflow: hidden; }
#mapa { position: absolute; inset: 0; background: var(--fondo); }

/* ---------- Marca ---------- */
.marca-sol { width: 34px; height: 34px; border-radius: 50%; background: var(--tinta); position: relative; flex-shrink: 0; }
.marca-sol::after {
  content: ""; position: absolute; inset: 9px; background: var(--fondo);
  clip-path: path("M8 0C8.6 5.6 10.4 7.4 16 8C10.4 8.6 8.6 10.4 8 16C7.4 10.4 5.6 8.6 0 8C5.6 7.4 7.4 5.6 8 0Z");
}
.marca-punto { width: 11px; height: 11px; border-radius: 50%; background: var(--acento); margin-left: 3px; flex-shrink: 0; }

/* ---------- Botones redondos ---------- */
.redondo {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--vidrio); border: var(--grueso) solid var(--vidrio-borde); box-shadow: var(--sombra);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: var(--tinta); flex-shrink: 0;
}
.redondo.texto { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }
.redondo[aria-pressed="true"] { background: var(--tinta); color: var(--fondo); border-color: var(--tinta); }
.redondo.activo { background: var(--tinta); color: var(--fondo); border-color: var(--tinta); }

/* ---------- Barra de arriba ---------- */
#barra {
  position: absolute; z-index: 20; left: 12px; right: 12px; top: calc(var(--arriba) + 12px);
  display: flex; align-items: center; gap: 10px;
}
.marca { display: flex; align-items: center; height: 44px; padding: 0 4px; }
.barra-titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barra-sub { font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; color: var(--gris2); }
.barra-nom { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-botones { display: flex; gap: 8px; }
/* Fundido para que la barra se lea encima del mapa */
#app::before {
  content: ""; position: absolute; z-index: 15; left: 0; right: 0; top: 0; height: calc(var(--arriba) + 140px);
  background: linear-gradient(to bottom, var(--fondo) 0%, color-mix(in srgb, var(--fondo) 75%, transparent) 50%, transparent 100%);
  pointer-events: none;
}
#app[data-vista="inicio"]::before, #app[data-vista="radar"]::before { display: none; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
#chips { position: absolute; z-index: 20; left: 0; right: 0; top: calc(var(--arriba) + 66px); padding: 0 12px 6px; }
.chip {
  flex-shrink: 0; height: 36px; padding: 0 15px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: var(--vidrio); border: var(--grueso) solid var(--linea); color: var(--tinta);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--tinta); color: var(--fondo); border-color: var(--tinta); font-weight: 700; }

/* ---------- Aviso ---------- */
.aviso {
  position: absolute; z-index: 25; left: 12px; right: 12px; top: calc(var(--arriba) + 112px);
  background: var(--tinta); color: var(--fondo); border-radius: 18px; padding: 12px 14px;
  font-size: 13px; line-height: 1.4; box-shadow: var(--sombra-fuerte); display: flex; gap: 12px; align-items: center;
}
.aviso b { font-weight: 700; }
.aviso .aviso-txt { flex: 1; }
.aviso button { flex-shrink: 0; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--fondo); color: var(--tinta); font-size: 12.5px; font-weight: 700; }

/* ---------- Controles del mapa ---------- */
.controles { position: absolute; z-index: 20; right: 12px; bottom: calc(var(--alto-panel) + 12px); display: flex; flex-direction: column; gap: 8px; transition: bottom 0.3s var(--curva); }

/* ---------- Panel / carrusel (celular) ---------- */
#panel {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; padding-bottom: calc(var(--abajo) + 14px);
  display: flex; flex-direction: column; pointer-events: none;
}
#panel::before {
  content: ""; position: absolute; inset: -60px 0 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, var(--fondo) 0%, color-mix(in srgb, var(--fondo) 88%, transparent) 55%, transparent 100%);
}
.panel-cabeza { display: none; }
.panel-titulo { display: flex; justify-content: space-between; align-items: baseline; padding: 0 16px 9px; pointer-events: auto; }
.panel-titulo span { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; }
.suave { color: var(--gris2); }
.tarjetas {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  padding: 2px 16px 4px; scrollbar-width: none; pointer-events: auto; overscroll-behavior-x: contain;
}
.tarjetas::-webkit-scrollbar { display: none; }
.frescura { font-size: 11px; color: var(--gris2); padding: 8px 16px 0; pointer-events: auto; }

/* min-width: 0 es clave: sin eso un menú largo (texto en una línea) estira la tarjeta
   más allá de su ancho y el carrusel la deja cortada. */
.tarjeta {
  flex: 0 0 min(310px, calc(100vw - 64px)); min-width: 0; scroll-snap-align: center; text-align: left;
  min-height: 170px; border-radius: 24px; padding: 14px; background: var(--sup);
  border: var(--grueso) solid var(--linea); box-shadow: var(--sombra);
  display: flex; flex-direction: column; gap: 10px; position: relative;
  transition: border-color 0.2s, transform 0.2s var(--curva), opacity 0.2s;
}
.tarjeta.sel { border-color: var(--tinta); }
.tarjeta:active { transform: scale(0.985); }
.tarjeta.apagada { opacity: 0.78; }
.t-cabeza { display: flex; gap: 12px; align-items: center; min-width: 0; }
.t-cabeza > span:last-child { min-width: 0; }
.mono {
  width: 58px; height: 58px; border-radius: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--mono1), var(--mono2)); color: var(--mono-txt);
  font-family: var(--serif); font-style: italic; font-size: 28px; line-height: 1; border: var(--grueso) solid var(--linea);
}
[data-tema="sol"] .mono { border-color: #000; }
.t-nom { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; }
.estado { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--gris2); }
.estado b { color: var(--tinta); font-weight: 600; }
.punto { width: 7px; height: 7px; border-radius: 50%; background: var(--acento); flex-shrink: 0; }
.punto.off { background: var(--gris2); opacity: 0.6; }
.t-menu { font-size: 13px; line-height: 1.35; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-menu .rotulo { font-size: 9px; font-weight: 700; letter-spacing: 0.16em; color: var(--gris2); margin-right: 7px; }
.t-pie { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.t-datos { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.precio { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: -0.05em; color: var(--acento-txt); }
.precio.min { color: var(--tinta); font-size: 21px; letter-spacing: -0.04em; }
.mins { font-family: var(--mono); font-size: 11.5px; color: var(--gris2); white-space: nowrap; }
.flecha { width: 44px; height: 44px; border-radius: 50%; background: var(--tinta); color: var(--fondo); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.esqueleto { background: linear-gradient(90deg, var(--sup2) 25%, var(--linea) 50%, var(--sup2) 75%); background-size: 200% 100%; animation: brillo 1.3s linear infinite; border-color: transparent; }
@keyframes brillo { to { background-position: -200% 0; } }
.vacio { flex: 0 0 calc(100vw - 32px); border-radius: 24px; padding: 18px; background: var(--sup); border: var(--grueso) solid var(--linea); font-size: 14px; line-height: 1.45; color: var(--gris); }
.vacio b { display: block; color: var(--tinta); font-size: 16px; margin-bottom: 4px; }
.vacio button { margin-top: 12px; height: 44px; padding: 0 18px; border-radius: 22px; background: var(--tinta); color: var(--fondo); font-weight: 700; font-size: 14px; }

/* ---------- Pines (marcadores HTML) ---------- */
/* OJO: los pines y el punto azul NO llevan `position`. MapLibre los pone en
   position:absolute (clase .maplibregl-marker); si aquí se pisa con relative,
   cada marcador se corre hacia abajo lo que miden los anteriores (bug del 22/09). */
.pin { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.pin-punto { width: 11px; height: 11px; border-radius: 50%; background: var(--tinta); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tinta) 16%, transparent); transition: transform 0.2s var(--curva); }
.pin.prospecto .pin-punto { background: var(--fondo); border: 2px solid var(--gris2); box-shadow: none; }
.pin-etq {
  position: absolute; left: 30px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tinta);
  text-shadow: 0 0 6px var(--fondo), 0 0 3px var(--fondo), 0 0 2px var(--fondo); pointer-events: none;
}
.pin-etq .m { font-family: var(--mono); font-weight: 500; letter-spacing: 0; color: var(--gris2); margin-left: 4px; text-transform: none; }
.pin-etq .mas { font-family: var(--mono); font-weight: 700; letter-spacing: 0; color: var(--acento-txt); margin-left: 4px; }
.pin-etq .mas:empty { display: none; }
.pin.sin-etq .pin-etq { opacity: 0; }
.pin-pildora {
  position: absolute; left: 50%; bottom: 30px; transform: translate(-50%, 6px) scale(0.9); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 7px 13px 7px 8px; border-radius: 99px; white-space: nowrap;
  background: var(--acento); color: var(--sobre-acento); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s, transform 0.25s var(--curva);
}
.pin-pildora .ic { width: 24px; height: 24px; border-radius: 50%; background: var(--sobre-acento); color: var(--acento); display: flex; align-items: center; justify-content: center; }
.pin-pildora .ic svg { width: 14px; height: 14px; }
.pin-pildora .p { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: -0.04em; }
.pin-pildora .n { font-size: 12px; font-weight: 800; }
.pin.sel { z-index: 5; }
.pin.sel .pin-punto { background: var(--acento); box-shadow: 0 0 0 4px var(--fondo), 0 0 0 5px var(--acento); transform: scale(1.1); }
.pin.sel .pin-etq { opacity: 0; }
.pin.sel .pin-pildora { opacity: 1; transform: translate(-50%, 0) scale(1); }
.pin.oculto { display: none; }

.yo { width: 22px; height: 22px; border-radius: 50%; background: var(--yo); border: 3px solid #FFFFFF; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 3px 10px rgba(0, 0, 0, 0.35); }
.yo::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--yo); opacity: 0; animation: latido 2.4s ease-out infinite; }
@keyframes latido { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Ficha ---------- */
.ficha {
  position: absolute; z-index: 40; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--arriba) - 70px);
  background: var(--sup); border-radius: 30px 30px 0 0; box-shadow: 0 -16px 44px rgba(0, 0, 0, 0.2);
  border-top: var(--grueso) solid var(--linea); display: flex; flex-direction: column;
  transform: translateY(0); transition: transform 0.32s var(--curva);
}
.ficha.entrando { transform: translateY(105%); }
.f-asa { width: 38px; height: 4px; border-radius: 4px; background: var(--linea2); margin: 10px auto 0; flex-shrink: 0; }
.f-cuerpo { overflow-y: auto; min-height: 0; padding: 8px 20px calc(var(--abajo) + 18px); overscroll-behavior: contain; }
.f-arriba { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.f-arriba .redondo { box-shadow: none; background: var(--sup2); border-color: var(--linea); }
.f-kicker { margin-top: 16px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; color: var(--gris2); }
.f-nom { font-size: 38px; font-weight: 900; letter-spacing: -0.045em; line-height: 1; margin-top: 10px; }
.f-coord { font-family: var(--mono); font-size: 10px; color: var(--gris2); margin-top: 8px; letter-spacing: 0.02em; }
.f-estado { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.datos {
  margin-top: 16px; border-radius: 18px; background: var(--barra-dato); color: var(--sobre-dato);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dato { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dato + .dato { border-left: 1px solid color-mix(in srgb, var(--sobre-dato) 14%, transparent); }
.dato span { font-size: 8.5px; font-weight: 700; letter-spacing: 0.18em; color: var(--dato-suave); }
.dato b { font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: -0.04em; white-space: nowrap; }
.dato b.acento { color: var(--acento); }
[data-tema="sol"] .dato b.acento { color: #FF8A6A; }
.f-seccion { margin-top: 20px; }
.f-titulo { display: flex; align-items: baseline; gap: 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.f-titulo em { font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -0.01em; }
.plato { display: flex; gap: 12px; align-items: baseline; margin-top: 9px; }
.plato > span { width: 66px; flex-shrink: 0; font-size: 9px; font-weight: 700; letter-spacing: 0.16em; color: var(--gris2); }
.plato p { font-size: 15px; font-weight: 500; line-height: 1.4; }
.plato .o { color: var(--gris2); }
.plato s { color: var(--gris2); }
.nota { font-size: 13.5px; color: var(--gris); line-height: 1.5; margin-top: 8px; }
.pasos { margin-top: 10px; padding-left: 20px; position: relative; list-style: none; }
.pasos::before { content: ""; position: absolute; left: 5px; top: 7px; bottom: 9px; width: 2px; background: var(--linea2); }
.pasos li { position: relative; padding-bottom: 10px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.pasos li::before { content: ""; position: absolute; left: -20px; top: 4px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--tinta); background: var(--sup); }
.pasos li:last-child::before { background: var(--acento); border-color: var(--acento); }
.pasos li small { display: block; font-size: 12.5px; font-weight: 400; color: var(--gris2); margin-top: 1px; }
.f-acciones { display: flex; gap: 10px; margin-top: 22px; }
.btn-principal {
  flex: 1; height: 58px; border-radius: 29px; background: var(--tinta); color: var(--fondo); text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 15.5px; font-weight: 700;
}
.btn-principal.off { background: var(--sup2); color: var(--gris2); pointer-events: none; }
.btn-ir {
  width: 58px; height: 58px; flex-shrink: 0; border-radius: 20px; background: var(--acento); color: var(--sobre-acento);
  display: flex; align-items: center; justify-content: center;
}
.btn-ir svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; }
.f-links { display: flex; justify-content: center; gap: 18px; margin-top: 14px; }
.f-links a, .enlace { font-size: 13px; font-weight: 600; color: var(--tinta); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Rumbo (caminando) ---------- */
.rumbo { position: absolute; z-index: 45; inset: 0; pointer-events: none; }
.r-arriba, .r-abajo {
  position: absolute; left: 12px; right: 12px; pointer-events: auto; background: var(--sup);
  border: var(--grueso) solid var(--linea); box-shadow: var(--sombra-fuerte); border-radius: 26px; padding: 16px;
}
.r-arriba { top: calc(var(--arriba) + 12px); }
.r-abajo { bottom: calc(var(--abajo) + 14px); border-radius: 28px; }
.r-fila { display: flex; align-items: center; gap: 14px; }
.r-flecha { width: 54px; height: 54px; border-radius: 17px; background: var(--acento); color: var(--sobre-acento); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.r-flecha svg { width: 26px; height: 26px; stroke-width: 2.6; transition: transform 0.4s var(--curva); }
.r-mini { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--gris2); }
.r-dest { font-size: 24px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-top: 2px; }
.r-google { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--linea); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--gris); }
.r-google a { flex-shrink: 0; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--sup2); border: var(--grueso) solid var(--linea); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--tinta); }
.r-barra { height: 3px; border-radius: 3px; background: var(--linea); overflow: hidden; margin-bottom: 14px; }
.r-barra i { display: block; height: 100%; width: 0; background: var(--acento); transition: width 0.6s var(--curva); }
.r-num { display: flex; align-items: baseline; gap: 6px; }
.r-num b { font-size: 46px; font-weight: 900; letter-spacing: -0.05em; line-height: 0.95; }
.r-num span { font-size: 16px; font-weight: 700; color: var(--gris); }
.r-abajo .r-fila { justify-content: space-between; }
.r-sub { font-family: var(--mono); font-size: 11.5px; color: var(--gris2); margin-top: 6px; }
.r-botones { display: flex; gap: 8px; flex-shrink: 0; }
.r-carta { height: 52px; padding: 0 18px; border-radius: 26px; background: var(--tinta); color: var(--fondo); display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; text-decoration: none; }
.r-cerrar { width: 52px; height: 52px; border-radius: 50%; background: var(--sup2); border: var(--grueso) solid var(--linea); display: flex; align-items: center; justify-content: center; }
.r-recentrar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--abajo) + 150px); pointer-events: auto; height: 42px; padding: 0 16px; border-radius: 21px; background: var(--tinta); color: var(--fondo); font-size: 13px; font-weight: 700; box-shadow: var(--sombra-fuerte); }
#app.en-rumbo #barra, #app.en-rumbo #chips, #app.en-rumbo #panel, #app.en-rumbo .controles, #app.en-rumbo::before { opacity: 0; pointer-events: none; }
#barra, #chips, #panel, .controles { transition: opacity 0.25s; }

/* ---------- Botón secundario (dentro de la ficha) ---------- */
.btn-secundario {
  margin-top: 12px; height: 46px; padding: 0 18px; border-radius: 23px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--sup2); border: var(--grueso) solid var(--linea); font-size: 14px; font-weight: 700; color: var(--tinta);
}

/* ---------- Radar (mientras llega el GPS) ---------- */
.radar {
  position: absolute; z-index: 70; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: color-mix(in srgb, var(--fondo) 90%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.radar-disco { width: min(300px, 76vw); aspect-ratio: 1; border-radius: 50%; position: relative; overflow: hidden; background: var(--sup); border: var(--grueso) solid var(--linea); box-shadow: var(--sombra-fuerte); }
.anillo { position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--tinta) 14%, transparent); left: 50%; top: 50%; transform: translate(-50%, -50%); }
.a1 { width: 25%; height: 25%; } .a2 { width: 50%; height: 50%; } .a3 { width: 75%; height: 75%; } .a4 { width: 99%; height: 99%; }
.barrido { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, color-mix(in srgb, var(--acento) 38%, transparent), transparent 70deg); animation: gira 2.2s linear infinite; }
.centro { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--yo); border: 3px solid #FFFFFF; }
@keyframes gira { to { transform: rotate(360deg); } }
.radar-txt { font-size: 15px; font-weight: 600; }

/* ---------- Inicio ---------- */
.inicio { position: absolute; z-index: 80; inset: 0; background: var(--fondo); overflow: hidden; display: flex; flex-direction: column; }
.inicio-brillo { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.b1 { width: 380px; height: 380px; left: -110px; bottom: 60px; background: var(--brillo1); opacity: 0.2; }
.b2 { width: 320px; height: 320px; right: -80px; bottom: 140px; background: var(--brillo2); opacity: 0.55; }
.inicio-anillos { position: absolute; width: 470px; height: 470px; right: -150px; top: -90px; fill: none; stroke: var(--tinta); stroke-opacity: 0.12; stroke-width: 1; pointer-events: none; }
.inicio-marca { position: absolute; left: 26px; top: calc(var(--arriba) + 32px); display: flex; align-items: center; }
.inicio-cuerpo { margin-top: auto; padding: 0 28px calc(var(--abajo) + 20px); position: relative; }
.inicio-pre { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--gris); }
.inicio h1 { margin-top: 24px; font-size: clamp(42px, 12vw, 64px); font-weight: 300; letter-spacing: -0.04em; line-height: 1.02; }
.inicio h1 em { font-family: var(--serif); font-weight: 400; font-size: 1.24em; letter-spacing: -0.01em; }
.inicio-cuenta { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 99px; background: var(--vidrio); border: var(--grueso) solid var(--vidrio-borde); }
.btn-grande {
  margin-top: 26px; width: 100%; height: 64px; border-radius: 32px; background: var(--tinta); color: var(--fondo);
  display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 26px; font-size: 17px; font-weight: 700;
  box-shadow: var(--sombra-fuerte);
}
.btn-grande svg { width: 44px; height: 44px; padding: 12px; border-radius: 50%; background: var(--acento); color: var(--sobre-acento); fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.inicio-nota { margin-top: 14px; font-size: 12px; line-height: 1.45; color: var(--gris2); text-align: center; }
.inicio .enlace { display: flex; margin: 2px auto 0; justify-content: center; }
.inicio-nota.error { color: var(--tinta); font-weight: 600; }

/* Transiciones de vista */
.inicio, .radar { transition: opacity 0.35s var(--curva); }
.saliendo { opacity: 0; pointer-events: none; }

/* ---------- Demo ---------- */
.demo-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; background: var(--acento); color: var(--sobre-acento); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; }
.demo-aviso { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--gris); }
#app.demo .barra-sub { color: var(--acento-txt); }
.desde { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--gris2); text-transform: uppercase; margin-right: -4px; }

/* ---------- Carta nueva (pedir dentro del mapa) ---------- */
.carta {
  position: absolute; z-index: 50; inset: 0; background: var(--fondo); display: flex; flex-direction: column;
  transform: translateY(0); transition: transform 0.32s var(--curva);
}
.carta.entrando { transform: translateY(100%); }
.c-cabeza {
  flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: calc(var(--arriba) + 12px) 16px 12px;
  border-bottom: var(--grueso) solid var(--linea); background: var(--fondo);
}
.c-cabeza .redondo { box-shadow: none; background: var(--sup); border-color: var(--linea); }
.c-local { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.c-local b { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-local > span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gris2); }
.c-cuerpo { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 130px; overscroll-behavior: contain; }
.c-cerrado { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: var(--sup2); font-size: 13px; color: var(--gris); }
.c-hero { padding: 26px 0 8px; }
.c-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.2em; color: var(--gris2); }
.c-titulo { margin-top: 10px; font-size: 46px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.c-titulo em { font-family: var(--serif); font-weight: 400; font-size: 1.22em; letter-spacing: -0.01em; }
.c-nota { margin-top: 10px; font-size: 14px; color: var(--gris); line-height: 1.45; }
.c-precio { margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: var(--barra-dato); color: var(--sobre-dato); }
.c-precio b { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -0.05em; color: var(--acento); }
[data-tema="sol"] .c-precio b { color: #FF8A6A; }
.c-precio span { font-size: 13px; line-height: 1.35; color: var(--dato-suave); }
.c-paso { margin: 24px 0 10px; font-size: 10px; font-weight: 800; letter-spacing: 0.2em; color: var(--tinta); }
.opciones { display: flex; flex-direction: column; gap: 8px; }
.opcion {
  min-height: 54px; padding: 0 12px 0 16px; border-radius: 16px; border: var(--grueso) solid var(--linea); background: var(--sup);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font-size: 15.5px; font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.opcion small { font-weight: 500; color: var(--gris2); }
.opcion .check { width: 28px; height: 28px; border-radius: 50%; border: var(--grueso) solid var(--linea2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: transparent; }
.opcion[aria-pressed="true"] { border-color: var(--tinta); box-shadow: inset 0 0 0 1px var(--tinta); }
.opcion[aria-pressed="true"] .check { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.opcion:disabled { opacity: 0.55; cursor: not-allowed; }
.opcion:disabled > span:first-child { text-decoration: line-through; }
.c-agregar { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.c-agregar .btn-principal { height: 56px; }
.btn-principal:disabled { background: var(--sup2); color: var(--gris2); cursor: not-allowed; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 26px; background: var(--sup); border: var(--grueso) solid var(--linea); flex-shrink: 0; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--sup2); }
.stepper b { min-width: 22px; text-align: center; font-family: var(--mono); font-size: 16px; font-weight: 700; }
.c-seccion { margin-top: 26px; }
.c-seccion h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; padding-bottom: 6px; border-bottom: var(--grueso) solid var(--tinta); }
.c-chips { position: sticky; top: 0; z-index: 2; margin: 16px -20px 0; padding: 10px 20px; background: var(--fondo); }
.c-chips .chip { background: var(--sup); -webkit-backdrop-filter: none; backdrop-filter: none; }
.plato-fila { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.plato-fila.en .pf-txt b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acento); margin-left: 7px; vertical-align: middle; }
.pf-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pf-txt b { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.pf-txt small { font-size: 13px; color: var(--gris); line-height: 1.35; }
.pf-precio { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--acento-txt); }
.btn-mas { width: 44px; height: 44px; border-radius: 50%; background: var(--tinta); color: var(--fondo); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.c-barra { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(var(--abajo) + 14px); background: linear-gradient(to top, var(--fondo) 65%, transparent); }
.btn-pedido {
  width: 100%; height: 62px; border-radius: 31px; background: var(--tinta); color: var(--fondo); display: flex; align-items: center; gap: 14px;
  padding: 0 22px 0 9px; font-size: 16px; font-weight: 700; box-shadow: var(--sombra-fuerte);
}
.btn-pedido span:nth-child(2) { flex: 1; text-align: left; }
.btn-pedido b { font-family: var(--mono); font-size: 17px; }
.bp-n { width: 44px; height: 44px; border-radius: 50%; background: var(--acento); color: var(--sobre-acento); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 800; }
.pedido { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0.4); }
.p-caja { width: 100%; max-height: 90%; overflow-y: auto; background: var(--sup); border-radius: 28px 28px 0 0; padding: 18px 20px calc(var(--abajo) + 20px); display: flex; flex-direction: column; }
.p-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.p-cabeza h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.035em; }
.p-cabeza h2 em { font-family: var(--serif); font-weight: 400; font-size: 1.15em; }
.p-cabeza .redondo { box-shadow: none; background: var(--sup2); border-color: var(--linea); }
.p-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.p-item .pf-precio { min-width: 52px; text-align: right; }
.segmento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; border-radius: 18px; background: var(--sup2); }
.segmento button { height: 44px; border-radius: 14px; font-size: 13.5px; font-weight: 700; color: var(--gris); }
.segmento button[aria-pressed="true"] { background: var(--sup); color: var(--tinta); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.campo { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.campo span { font-size: 12px; font-weight: 700; color: var(--gris); }
.campo input { height: 50px; border-radius: 14px; border: var(--grueso) solid var(--linea2); background: var(--fondo); padding: 0 14px; font-size: 16px; outline: none; }
.campo input:focus-visible { border-color: var(--tinta); }
.p-error { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--acento-txt); }
.p-total { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 12px; padding-top: 14px; border-top: var(--grueso) solid var(--tinta); }
.p-total span { font-size: 14px; font-weight: 700; }
.p-total b { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: -0.05em; }
.p-caja > .btn-principal { flex: none; height: 58px; }
.burbuja { margin: 14px 0 18px; align-self: flex-end; max-width: 92%; background: #D9FDD3; color: #111B21; border-radius: 16px 4px 16px 16px; padding: 12px 14px 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
[data-tema="carbon"] .burbuja { background: #005C4B; color: #E9EDEF; }
.burbuja pre { font-family: var(--letra); font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.b-hora { display: block; text-align: right; font-size: 11px; opacity: 0.6; margin-top: 4px; }

/* ---------- Estilo de MapLibre ---------- */
.maplibregl-ctrl-attrib { font-family: var(--letra); font-size: 10px; }
.maplibregl-ctrl-attrib.maplibregl-compact { background: var(--vidrio); color: var(--gris); }
.maplibregl-ctrl-attrib a { color: var(--gris); }
.maplibregl-ctrl-bottom-left { bottom: calc(var(--alto-panel) + 4px); transition: bottom 0.3s var(--curva); }
.sin-mapa #mapa, .sin-mapa .controles { display: none; }
.sin-mapa .aviso { top: auto; bottom: calc(var(--abajo) + 16px); }
.sin-js { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 30px; text-align: center; }

/* Sin mapa (sin WebGL o si no carga): la lista ocupa la pantalla */
.sin-mapa #panel { top: calc(var(--arriba) + 114px); }
.sin-mapa .tarjetas { flex-direction: column; overflow-x: hidden; overflow-y: auto; scroll-snap-type: none; padding-bottom: 20px; }
.sin-mapa .tarjeta { flex: none; width: 100%; }
.sin-mapa #panel::before { inset: 0; background: var(--fondo); }

/* ============================================================
   Compu: desde 900 px
   ============================================================ */
@media (min-width: 900px) {
  #mapa { left: var(--panel-ancho); }
  #app::before { left: var(--panel-ancho); height: 110px; }
  #barra { left: calc(var(--panel-ancho) + 20px); right: 20px; top: 18px; }
  .marca { display: none; }
  .barra-nom { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
  #chips { display: none; }
  .aviso { left: calc(var(--panel-ancho) + 20px); right: auto; max-width: 520px; top: 80px; }
  .controles { right: 20px; bottom: 28px; }
  .maplibregl-ctrl-bottom-left { bottom: 0; }

  #panel {
    left: 0; top: 0; bottom: 0; width: var(--panel-ancho); padding: 22px 0 0; pointer-events: auto;
    background: var(--fondo); border-right: var(--grueso) solid var(--linea);
  }
  #panel::before { display: none; }
  .panel-cabeza { display: block; padding: 0 22px; }
  .panel-marca { display: flex; align-items: center; gap: 0; }
  .panel-marca b { font-size: 21px; font-weight: 900; letter-spacing: -0.04em; margin-left: 10px; }
  .busca { display: flex; margin-top: 18px; }
  .busca input { width: 100%; height: 48px; border-radius: 24px; border: var(--grueso) solid var(--linea); background: var(--sup); padding: 0 18px; font-size: 14px; outline: none; }
  .busca input:focus-visible { border-color: var(--tinta); outline: none; }
  #chips-panel { margin-top: 12px; }
  #chips-panel .chip { background: var(--sup); -webkit-backdrop-filter: none; backdrop-filter: none; }
  #chips-panel .chip[aria-pressed="true"] { background: var(--tinta); color: var(--fondo); }
  .panel-titulo { padding: 20px 22px 10px; }
  .tarjetas { flex-direction: column; overflow-x: hidden; overflow-y: auto; scroll-snap-type: none; padding: 2px 22px 22px; gap: 10px; flex: 1; }
  .tarjeta { flex: none; width: 100%; min-height: 0; box-shadow: none; cursor: pointer; }
  .tarjeta:hover { border-color: var(--linea2); }
  .tarjeta.sel { border-color: var(--tinta); box-shadow: var(--sombra); }
  .vacio { flex: none; }
  .frescura { padding: 0 22px 14px; }

  .ficha { left: 0; right: auto; top: 0; width: var(--panel-ancho); max-height: none; border-radius: 0; border-top: none; border-right: var(--grueso) solid var(--linea); box-shadow: var(--sombra-fuerte); }
  .ficha.entrando { transform: translateX(-105%); }
  .f-asa { display: none; }
  .f-cuerpo { padding: 22px 24px 28px; height: 100%; }

  .r-arriba { left: calc(var(--panel-ancho) + 20px); right: auto; width: 440px; top: 20px; }
  .r-abajo { left: calc(var(--panel-ancho) + 20px); right: auto; width: 440px; bottom: 24px; }
  #app.en-rumbo #panel { opacity: 1; pointer-events: auto; }
  #app.en-rumbo #barra { opacity: 0; }

  .hoja-zonas { align-items: center; justify-content: center; }
  .z-caja { width: 440px; border-radius: 28px; max-height: 70%; }

  .radar { left: var(--panel-ancho); }
  .inicio-cuerpo { margin: auto 0 auto 8vw; max-width: 520px; padding: 0; }
  .inicio-anillos { width: 900px; height: 900px; right: -200px; top: -150px; }
  .b1 { width: 560px; height: 560px; left: 10%; bottom: -120px; }
  .b2 { width: 520px; height: 520px; right: 8%; bottom: 10%; }
}

/* Carta en compu: columna de 460 px sobre el panel, el mapa sigue a la vista */
@media (min-width: 900px) {
  .carta { right: auto; width: 460px; border-right: var(--grueso) solid var(--linea); box-shadow: var(--sombra-fuerte); }
  .carta.entrando { transform: translateX(-105%); }
  .c-cabeza { padding-top: 16px; }
  .pedido { align-items: center; justify-content: center; }
  .p-caja { width: calc(100% - 32px); border-radius: 28px; max-height: 86%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
