/* Lo que comparten el Planner y la Despensa: el mismo mundo oscuro de la portada. Un solo tema, a propósito. */
:root {
  --noche: #07060a;
  --crema: #f3ead8;
  --gris: #a39c90;
  --oro: #e9b44c;
  --vidrio: rgba(243, 234, 216, .08);
  --borde: rgba(243, 234, 216, .16);
  --letra: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-ios: cubic-bezier(.32, .72, 0, 1);
  color-scheme: dark;
}
[hidden] { display: none !important; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
html, body { height: 100%; margin: 0; }
body { background: var(--noche); color: var(--crema); font-family: var(--letra); overflow: hidden; }
button, [role="button"], .chip { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; font-family: inherit; }
input, textarea, select { font-size: 16px; }

/* fondo: vídeo de León desenfocado y oscurecido */
.fondo { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.fondo video { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(16px) saturate(1.15); transition: opacity 600ms ease; }
.fondo::after { content: ""; position: absolute; inset: 0; background: rgba(7, 6, 10, .64); }
/* En el móvil el vídeo ya viene desenfocado de fábrica (leon-fondo-movil.mp4): se ve igual y el teléfono no tiene que
   desenfocar 30 fotogramas por segundo, que es lo que más pesaba al deslizar. */
@media (max-width: 700px) { .fondo video { filter: none; } }

/* cabecera: progreso, volver, nombre de la sección y cerrar */
.cabeza { position: relative; z-index: 2; padding-top: max(10px, env(safe-area-inset-top, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.progreso { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 4px; }
.progreso span { height: 3px; border-radius: 3px; background: rgba(243, 234, 216, .2); overflow: hidden; }
.progreso span::after { content: ""; display: block; height: 100%; background: var(--crema); transform: scaleX(var(--lleno, 0)); transform-origin: left; transition: transform 420ms var(--ease-out); }
.barra { display: flex; justify-content: space-between; align-items: center; height: 52px; }
.icono { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--crema); display: grid; place-items: center; cursor: pointer; transition: transform 140ms ease-out, opacity 200ms ease; }
.icono:active { transform: scale(.92); }
.icono[disabled] { opacity: 0; pointer-events: none; }
.icono svg { width: 24px; height: 24px; }
.marca { font-weight: 900; font-stretch: 62%; text-transform: uppercase; font-size: 18px; letter-spacing: .02em; }

.pregunta { margin: 0; font-weight: 900; font-stretch: 62%; text-transform: uppercase; font-size: clamp(44px, 13vw, 72px); line-height: .86; letter-spacing: -.005em; text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--borde); background: var(--vidrio); color: var(--crema); font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform 120ms ease-out, background-color 180ms ease, border-color 180ms ease, color 180ms ease; }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--crema); color: var(--noche); border-color: var(--crema); }

.principal { width: 100%; height: 56px; border: 0; border-radius: 999px; background: var(--crema); color: var(--noche); font-size: 17px; font-weight: 800; cursor: pointer;
  transition: transform 140ms ease-out, opacity 200ms ease, background-color 160ms ease; }
.principal:active { transform: scale(.97); }
.principal[hidden], .secundario[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .principal:hover { background: #fffaf0; }
  .chip:hover { border-color: rgba(243, 234, 216, .4); }
  .icono:hover { background: var(--vidrio); }
}
:focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; }
textarea:focus-visible, input:focus-visible { outline: none; }
/* Todo botón responde al dedo aunque no tenga su propio estilo (:where no pisa a los que ya lo tienen) */
:where(button, [role="button"]) { transition: transform 140ms ease-out; }
:where(button, [role="button"]):active { transform: scale(.97); }
/* Las fotos entran con un fundido corto en vez de aparecer de golpe (la clase la pone cada página al cargar la foto) */
@keyframes foto-entra { from { opacity: 0; } }
img.entra { animation: foto-entra 320ms ease both; }
@media (prefers-reduced-motion: reduce) { .progreso span::after, .chip, .principal { transition-duration: 1ms !important; } img.entra { animation: none; } }

/* mapa oscuro (mapa.js) */
/* isolation: las capas de Leaflet (z-index 400+) se quedan dentro del mapa y no tapan las sugerencias de búsqueda */
.mapa-osc { position: relative; isolation: isolate; overflow: hidden; border-radius: 26px; background: #050506; border: 1px solid var(--borde); }
.mapa-osc.niega { animation: niega 360ms ease; }
@keyframes niega { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .mapa-osc .capa { transition-duration: 1ms; } }

/* buscador de sitio + usar mi ubicación (igual que en la web actual) */
.donde { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; position: relative; }
.campo { width: 100%; box-sizing: border-box; height: 52px; border-radius: 16px; border: 1px solid var(--borde); background: rgba(7, 6, 10, .55); color: var(--crema); font: 500 16px var(--letra); padding: 0 16px; outline: none; transition: border-color 160ms ease; }
.campo:focus { border-color: var(--oro); }
.campo::placeholder { color: rgba(243, 234, 216, .42); }
.boton { height: 52px; padding: 0 18px; border-radius: 16px; border: 0; background: var(--crema); color: var(--noche); font: 800 15px var(--letra); cursor: pointer; transition: transform 120ms ease-out; }
.boton:active { transform: scale(.96); }
.ubicacion { justify-self: start; align-self: flex-start; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--borde); background: var(--vidrio); color: var(--crema); font: 700 14px var(--letra); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; transition: transform 120ms ease-out; }
.ubicacion:active { transform: scale(.96); }
.ubicacion svg { width: 18px; height: 18px; }
.estado-zona { font-size: 14px; color: var(--gris); min-height: 1.2em; margin: 0; }
.sugerencias { position: absolute; z-index: 6; left: 0; right: 0; top: 58px; margin: 0; padding: 6px; list-style: none; border-radius: 16px; background: #15131b; border: 1px solid var(--borde); max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.sugerencias button { width: 100%; height: 46px; text-align: left; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--crema); font-size: 16px; cursor: pointer; }
.sugerencias button:active, .sugerencias button.marcada { background: var(--vidrio); }
.sugerencias .nada { padding: 12px; color: var(--gris); font-size: 14px; }
.distancia { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.distancia label { font-weight: 700; font-size: 15px; }
.km-caja { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--vidrio); border: 1px solid var(--borde); }
.km-caja input { width: 52px; background: transparent; border: 0; color: var(--crema); font: 800 17px var(--letra); text-align: right; outline: none; font-variant-numeric: tabular-nums; }
.km-caja span { color: var(--gris); font-weight: 700; }
.rango { width: 100%; height: 40px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; }
.rango::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: rgba(243, 234, 216, .2); }
.rango::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: var(--crema); border: 0; }
.rango::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(243, 234, 216, .2); }
.rango::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--crema); border: 0; }

/* mapa real (Leaflet): teselas de OpenStreetMap pasadas a oscuro, chinchetas numeradas y punto elegido */
.mapa-osc.leaflet-container { background: #0b0a0e; font-family: var(--letra); }
.mapa-osc .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(.92) saturate(.6); }
.mapa-osc .leaflet-control-attribution { background: rgba(7, 6, 10, .6); color: var(--gris); font-size: 10px; border-radius: 8px 0 0 0; padding: 1px 12px 1px 6px; }
.mapa-osc .leaflet-control-attribution a { color: var(--gris); }
.pin-num span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--crema); color: var(--noche); font: 900 15px var(--letra); border: 3px solid var(--noche); box-sizing: border-box; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.pin-punto span { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--crema); border: 5px solid rgba(7, 6, 10, .6); box-sizing: border-box; }

/* aviso flotante (sustituye a los alert de antes) */
.aviso-flot { position: fixed; z-index: 60; left: 50%; top: max(16px, env(safe-area-inset-top, 0px)); transform: translate(-50%, -140%); max-width: min(92vw, 420px); padding: 12px 16px; border-radius: 16px;
  background: #1c1922; border: 1px solid var(--borde); color: var(--crema); font: 600 15px/1.35 var(--letra); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); transition: transform 420ms var(--ease-ios); }
.aviso-flot.on { transform: translate(-50%, 0); }
.principal:disabled { opacity: .4; cursor: default; transform: none; }

/* enlaces legales, pequeñitos al final de cada pantalla */
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 8px 0 0; font-size: 11px; color: #6d675e; }
.legal a { color: inherit; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .legal a:hover { color: var(--gris); text-decoration: underline; } }
