/* Promap — sistema de diseño en docs/Web.md */

/* Fuentes propias (subset latin de Google Fonts, licencia OFL): sin depender de un tercero para el primer render. */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/space-grotesk-700-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("/fonts/dm-sans-latin.woff2") format("woff2"); }

:root {
  --noche: #0B1B3A; --fluor: #B8F34A; --bg: #F6F7F2; --surface: #FFFFFF; --border: #E6E8E1;
  --text: #0B1B3A; --text2: #5B6472; --text3: #8A93A0;
  --red: #C62F35; --amber: #A1580A;
  --t-2x1: #FF5A5F; --t-desc: #7B61FF; --t-precio: #0FA3B1; --t-happy: #FF9F1C; --t-regalo: #2EC4B6; --t-evento: #8D99AE;
  --e1: 0 1px 2px rgba(11,27,58,.06); --e2: 0 6px 20px rgba(11,27,58,.10);
  --r-card: 20px; --r-sheet: 24px; --r-btn: 14px; --r-chip: 999px;
  --ease: cubic-bezier(.2,.8,.2,1); --fast: 150ms; --sheet: 250ms;
  --font-d: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-b: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hh: 56px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --tab: calc(64px + var(--safe-b));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hh) + 16px); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 16px/24px var(--font-b); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: var(--tab);
}
/* Con un sheet abierto la página de atrás no se bloquea con overflow (eso recalcula toda la página):
   el fondo oscuro no deja scrollear (touch-action) y los sheets no pasan el scroll (overscroll-behavior). */
a, button, input, select, textarea, label { touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }
/* Vistas: las muestra html[data-view] (lo pone un script inline antes del primer render y después app.js). */
.view { display: none; }
html[data-view="inicio"] #v-inicio, html[data-view="explorar"] #v-explorar, html[data-view="favoritos"] #v-favoritos { display: block; }
html[data-view="error"] #v-error { display: flex; }
:focus-visible { outline: 2px solid var(--noche); outline-offset: 2px; border-radius: 8px; }
.hdr :focus-visible, .hero :focus-visible, .tabbar :focus-visible { outline-color: var(--fluor); }

.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 18px; height: 18px; }
.i-xs { width: 16px; height: 16px; }

/* Tipografía */
.display { font: 700 56px/60px var(--font-d); letter-spacing: -.03em; }
.h1 { font: 700 28px/32px var(--font-d); letter-spacing: -.02em; }
.h2 { font: 700 22px/28px var(--font-d); letter-spacing: -.015em; }
.h3 { font: 700 18px/24px var(--font-d); letter-spacing: -.01em; }
.small { font-size: 14px; line-height: 20px; }
.caption { font-size: 12px; line-height: 16px; }
.muted { color: var(--text2); }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -48px; z-index: 100; background: var(--fluor); color: var(--noche); padding: 8px 16px; border-radius: var(--r-btn); font-weight: 700; }
.skip:focus { top: calc(var(--safe-t) + 8px); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: var(--r-btn); font-weight: 700; font-size: 16px; line-height: 24px; white-space: nowrap;
  transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn:active, .chip:active, .icon-btn:active, .card:active, .opt:active, .zone-btn:active { transform: scale(.97); }
.btn-fluor { background: var(--fluor); color: var(--noche); }
.btn-noche { background: var(--noche); color: #fff; }
.btn-line { background: var(--surface); color: var(--noche); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; transition: transform var(--fast) var(--ease), background-color var(--fast); }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn-light { color: var(--noche); background: var(--bg); }
.icon-btn-light:hover { background: var(--border); }

/* Header */
.hdr {
  position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; gap: 12px;
  height: calc(var(--hh) + var(--safe-t)); padding: var(--safe-t) 12px 0 16px; background: var(--noche); color: #fff;
  transition: transform var(--sheet) var(--ease);
}
/* Al scrollear se achica a 48 px moviendo capas (transform), no cambiando alturas: no recalcula la página. */
.hdr::after { content: ""; position: absolute; inset: 0; box-shadow: 0 6px 20px rgba(11,27,58,.25); opacity: 0; transition: opacity var(--sheet) var(--ease); pointer-events: none; }
.hdr > * { transition: transform var(--sheet) var(--ease); }
html.compact .hdr { transform: translateY(-8px); }
html.compact .hdr::after { opacity: 1; }
html.compact .hdr > * { transform: translateY(4px); }
html.compact .hdr > .logo { transform: translateY(4px) scale(.92); }
.logo { display: flex; align-items: center; gap: 8px; font: 700 22px/1 var(--font-d); letter-spacing: -.03em; transform-origin: left center; }
.logo img { width: 32px; height: 32px; }
.zone-btn {
  margin-left: auto; display: flex; align-items: center; gap: 6px; height: 40px; max-width: 58vw; padding: 0 12px 0 10px;
  border-radius: var(--r-chip); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  font-weight: 500; font-size: 14px;
}
.zone-btn .i:first-child { color: var(--fluor); width: 18px; height: 18px; }
.zone-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding-top: calc(var(--hh) + var(--safe-t)); outline: none; }

/* Hero */
.hero { position: relative; min-height: 380px; background: var(--noche); color: #fff; overflow: hidden; isolation: isolate; }
.hero-map { position: absolute; inset: 0; z-index: -3; background: var(--noche); pointer-events: none; }
.hero-map .leaflet-tile-pane { opacity: .9; }
.hero-dots { position: absolute; inset: 0; z-index: 450; width: 100%; height: 100%; pointer-events: none; }
.hero .hero-map .leaflet-control-attribution { background: none; color: rgba(255,255,255,.7); margin: 4px 8px 0 0; }

.hero-map .leaflet-container, .hero-map.leaflet-container { background: var(--noche); }
.hero-shade { position: absolute; inset: 0; z-index: -2; background:
  linear-gradient(90deg, rgba(11,27,58,.7) 0%, rgba(11,27,58,.25) 55%, transparent 80%),
  linear-gradient(180deg, rgba(11,27,58,.2) 0%, rgba(11,27,58,.45) 30%, rgba(11,27,58,.9) 58%, var(--noche) 100%),
  radial-gradient(120% 80% at 80% 0%, rgba(184,243,74,.10), transparent 60%); }
.hero-radar { position: absolute; z-index: -1; width: 440px; height: 440px; left: 50%; top: -60px; margin-left: -220px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(184,243,74,.09), transparent 14%), repeating-radial-gradient(circle, transparent 0 59px, rgba(184,243,74,.10) 59px 60px);
  -webkit-mask: radial-gradient(circle, #000 0 70%, transparent 71%); mask: radial-gradient(circle, #000 0 70%, transparent 71%);
  animation: sweep 6s linear infinite; }
@keyframes sweep { to { transform: rotate(1turn); } }
.hero-in { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px; padding: 88px 16px 20px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--fluor); font: 700 12px/16px var(--font-b); letter-spacing: .16em; }
.eyebrow i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--fluor); }
.eyebrow i::after, .live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ring 1.6s var(--ease) infinite; }
@keyframes ring { from { transform: scale(1); opacity: .6; } to { transform: scale(3.2); opacity: 0; } }
/* Un solo bloque de texto (spans en línea): es el elemento más grande del primer render (LCP). */
.hero-title { margin-top: 8px; font: 700 28px/32px var(--font-d); letter-spacing: -.02em; }
.hero-title .display { color: var(--fluor); }
.hero-sub { font: 700 28px/32px var(--font-d); letter-spacing: -.02em; }
.hero-where { margin-top: 4px; color: rgba(255,255,255,.78); }
.hero-where b { color: #fff; font-weight: 700; }
.hero-form { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.hero-form .search { flex: none; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 14px;
  border-radius: var(--r-btn); background: #fff; color: var(--noche); box-shadow: var(--e2);
}
.search .i { color: var(--text2); width: 20px; height: 20px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px; }
.search input::placeholder { color: var(--text2); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { box-shadow: 0 0 0 2px var(--fluor), var(--e2); }
.search-light { background: var(--surface); border: 1px solid var(--border); box-shadow: none; height: 44px; }
.search-light:focus-within { border-color: var(--noche); box-shadow: 0 0 0 1px var(--noche); }
.clear { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--text2); }
.clear:hover { background: var(--bg); }

/* Cinta */
.ticker { overflow: hidden; background: var(--fluor); color: var(--noche); height: 40px; display: flex; align-items: center; }
.ticker-track { display: flex; flex: none; gap: 0; white-space: nowrap; animation: marquee 60s linear infinite; will-change: transform; }
.tk { display: inline-flex; align-items: center; gap: 8px; padding-right: 20px; font-size: 14px; font-weight: 500; }
.tk b { font: 700 14px/20px var(--font-d); letter-spacing: .01em; background: var(--noche); color: var(--fluor); padding: 2px 8px; border-radius: 6px; }
.tk::after { content: ""; width: 5px; height: 5px; margin-left: 12px; border-radius: 50%; background: var(--noche); opacity: .5; }
@keyframes marquee { to { transform: translateX(-50%); } }
.paused .ticker-track, .paused.hero-radar, .eyebrow.paused i::after,
body.locked .ticker-track, body.locked .hero-radar, body.locked .eyebrow i::after, body.locked .live::after { animation-play-state: paused; }

/* Nuevas promos: cuadrados amarillo flúor debajo de la cinta, con brillo que pasa y punto que late */
.nv-sec { --nueva: #E4FF3A; padding-top: 20px; }
.nv-sec .live-nv { background: #7FB800; }
.nv-rail { padding-bottom: 12px; }
.nv {
  position: relative; flex: none; width: 164px; aspect-ratio: 1; padding: 12px 12px 12px 14px; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 4px; border-radius: 24px; background: var(--nueva); color: var(--noche);
  box-shadow: 0 6px 18px rgba(150,190,0,.28), inset 0 0 0 1px rgba(11,27,58,.06); container-type: inline-size;
  transition: transform var(--fast) var(--ease);
}
.nv:active { transform: scale(.97); }
.nv::after {
  content: ""; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%);
  transform: translateX(-120%); animation: nv-sheen 5.5s var(--ease) infinite; animation-delay: calc(var(--i) * .35s + 1s);
}
@keyframes nv-sheen { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.nv-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.nv-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-chip); background: var(--noche); color: var(--nueva); font: 700 11px/1 var(--font-b); letter-spacing: .08em; }
.nv-tag i { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--nueva); }
.nv-tag i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ring 1.6s var(--ease) infinite; }
.nv-ago { font: 600 12px/16px var(--font-b); opacity: .7; white-space: nowrap; }
.nv-badge { --bpad: 26px; --bmax: 30px; margin-top: 2px; flex: none; }
.nv > * { flex-shrink: 0; }
.nv-pr { font: 500 13px/17px var(--font-b); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.nv-who { margin-top: auto; display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 16px; }
.nv-who .lnk { font: 700 14px/18px var(--font-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-who .lnk::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.nv-who .lnk:focus-visible { outline: none; }
.nv:has(.lnk:focus-visible) { outline: 2px solid var(--noche); outline-offset: 2px; }
.nv-who span { opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paused .nv::after, .paused .nv-tag i::after, .paused .live::after,
body.locked .nv::after, body.locked .nv-tag i::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .nv::after { display: none; } }

/* Chips */
.scroller { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.scroller::-webkit-scrollbar { display: none; }
.chips { padding: 16px; }
.chips:empty { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-chip);
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: transform var(--fast) var(--ease), background-color var(--fast), border-color var(--fast), color var(--fast);
}
.chip:hover { border-color: #CBD0C5; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.chip .n { color: var(--text2); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"], .chip.on { background: var(--noche); border-color: var(--noche); color: #fff; }
.chip[aria-pressed="true"] .n, .chip.on .n { color: rgba(255,255,255,.75); }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px #fff; }
.chip .i { width: 18px; height: 18px; }
.chip-sep { flex: none; width: 1px; margin: 8px 4px; background: var(--border); }

/* Secciones y carruseles */
.sec { padding-top: 16px; padding-bottom: 8px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 16px 12px; }
.sec-head p { margin-top: 2px; }
.sec-t { flex: 1; min-width: 0; }
.live { position: relative; display: inline-block; width: 10px; height: 10px; margin: 0 8px 3px 2px; border-radius: 50%; background: var(--t-2x1); vertical-align: middle; }
.live::after { animation-duration: 1.8s; }
.more { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 700; font-size: 14px; color: var(--noche); border-radius: 8px; }
.more .i { width: 18px; height: 18px; transition: transform var(--fast) var(--ease); }
.more:hover .i { transform: translateX(3px); }
.rail { padding: 4px 16px 16px; gap: 12px; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; }
.rail > * { scroll-snap-align: start; }

/* Tarjeta — cabecera por tipo */
.t-2x1 { --c: var(--t-2x1); --on: #fff; }
.t-desc { --c: var(--t-desc); --on: #fff; }
.t-precio { --c: var(--t-precio); --on: #fff; }
.t-happy { --c: var(--t-happy); --on: var(--noche); }
.t-regalo { --c: var(--t-regalo); --on: var(--noche); }
.t-evento { --c: var(--t-evento); --on: var(--noche); }
.cover { position: relative; overflow: hidden; background: var(--c); color: var(--on); container-type: inline-size; isolation: isolate; }
/* La cabecera deja pasar el toque al link de la tarjeta; solo el corazón lo captura. */
.card .cover { z-index: 2; pointer-events: none; }
.card .cover .fav { pointer-events: auto; }
.cover::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .12; }
.cover::after { content: ""; position: absolute; z-index: -1; width: 150px; height: 150px; right: -40px; bottom: -70px; border-radius: 50%; border: 22px solid currentColor; opacity: .12; }
.t-2x1 .cover::before { background: repeating-linear-gradient(45deg, currentColor 0 2px, transparent 2px 12px); }
.t-desc .cover::before { background: radial-gradient(currentColor 1.6px, transparent 1.8px) 0 0 / 12px 12px; }
.t-precio .cover::before { background: repeating-radial-gradient(circle at 100% 0, currentColor 0 2px, transparent 2px 14px); }
.t-happy .cover::before { background: repeating-conic-gradient(from 180deg at 100% 100%, currentColor 0 5deg, transparent 5deg 15deg); }
.t-regalo .cover::before { background: linear-gradient(90deg, transparent 7px, currentColor 7px 9px, transparent 9px) 0 0 / 16px 16px, linear-gradient(transparent 7px, currentColor 7px 9px, transparent 9px) 0 0 / 16px 16px; }
.t-evento .cover::before { background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 11px); -webkit-mask: linear-gradient(0deg, #000, transparent 90%); mask: linear-gradient(0deg, #000, transparent 90%); }
.badge {
  display: block; font-family: var(--font-d); font-weight: 700; letter-spacing: -.03em; line-height: 1; white-space: nowrap;
  font-size: min(var(--bmax, 44px), calc((100cqi - var(--bpad, 32px)) / var(--w)));
}
.tags { display: flex; gap: 4px; flex-wrap: wrap; overflow: hidden; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-chip); background: #fff; color: var(--noche); font: 700 12px/16px var(--font-b); letter-spacing: .04em; white-space: nowrap; }
.tag-new { background: var(--fluor); }
.tag-hoy { background: var(--noche); color: #fff; }
.tag-hoy::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--t-2x1); }
.tag-off { background: var(--border); color: var(--text2); }
.tags-in .tag { background: var(--bg); height: 20px; padding: 0 6px; }
.tags-in .tag-new { background: var(--fluor); }
.tags-in .tag-hoy { background: var(--noche); }

.fav {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,.92); color: var(--noche); box-shadow: var(--e1); transition: transform var(--fast) var(--ease);
}
.fav:active { transform: scale(.9); }
.fav .i { width: 20px; height: 20px; }
.fav[aria-pressed="true"] .i { fill: var(--t-2x1); stroke: var(--t-2x1); }
.fav.pop .i { animation: pop .45s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }

.card { position: relative; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--e1); border: 1px solid var(--border); overflow: hidden; transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.card:hover { box-shadow: var(--e2); }
.card .lnk::after { content: ""; position: absolute; inset: 0; z-index: 1; }
/* El link del nombre ocupa toda la línea (24 px): área táctil mínima aunque la tarjeta entera sea tocable. */
.nm .lnk { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .fav { position: relative; z-index: 2; }
.card .lnk:focus-visible { outline: none; }
.card:has(.lnk:focus-visible) { outline: 2px solid var(--noche); outline-offset: 2px; }
.av { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--c); color: var(--on); font: 700 19px/1 var(--font-d); letter-spacing: -.02em; }
.nm { font: 700 18px/24px var(--font-d); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct { font-size: 12px; line-height: 16px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.row { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; line-height: 20px; color: var(--text2); }
.row .i { width: 16px; height: 16px; }
.row .addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row .dist { flex: none; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.vig { font-weight: 500; color: var(--text); }
.vig.red { color: var(--red); font-weight: 700; }
.vig.amber { color: var(--amber); }
.vig .i { color: currentColor; }

/* carrusel */
.card-c { flex: none; width: 280px; }
.card-c .cover { height: 96px; padding: 12px 12px 12px 16px; display: flex; flex-direction: column; justify-content: space-between; --bpad: 64px; --bmax: 44px; }
.card-c .cover .fav { position: absolute; top: 12px; right: 12px; }
.card-c .tags { max-width: calc(100% - 52px); height: 24px; }
.card-c .body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who > div { min-width: 0; flex: 1; }
.card-c .pr { min-height: 48px; }
.card-c .rows { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.card-c { display: flex; flex-direction: column; }
.card-c .body { flex: 1; }

/* lista */
.card-l { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 152px; }
.card-l .cover { display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; --bpad: 24px; --bmax: 40px; }
.card-l .cover::after { width: 110px; height: 110px; right: -50px; bottom: auto; top: -50px; border-width: 16px; }
.card-l .body { padding: 12px 12px 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-l .top { display: flex; align-items: flex-start; gap: 8px; }
.card-l .top > div { flex: 1; min-width: 0; }
.card-l .nm { font-size: 16px; line-height: 24px; }
.card-l .fav { width: 36px; height: 36px; margin: -4px -4px 0 0; background: var(--bg); box-shadow: none; }
.card-l .pr { font-size: 14px; line-height: 20px; margin-top: 2px; }
.card-l .tags-in { margin-bottom: 2px; }
.card-l .rows { margin-top: auto; padding-top: 4px; display: flex; flex-direction: column; gap: 0; }

/* mini (mapa) */
.card-m { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 112px; box-shadow: var(--e2); }
.card-m .cover { display: flex; align-items: flex-end; padding: 10px; --bpad: 20px; --bmax: 32px; }
.card-m .cover::after { display: none; }
.card-m .body { padding: 12px 44px 12px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-m .nm { font-size: 16px; line-height: 24px; }
.card-m .pr { font-size: 14px; line-height: 20px; }

.card-x { min-height: 96px; box-shadow: var(--e1); }
.card-x .body { padding: 12px 52px 12px 12px; gap: 4px; justify-content: center; }
.card-x .pr { font-weight: 500; }
.card-x > .fav { position: absolute; top: 50%; right: 8px; margin-top: -18px; width: 36px; height: 36px; background: var(--bg); box-shadow: none; }

/* estados */
.card.is-expired .cover { filter: grayscale(1); opacity: .55; }
.card.is-expired .body > *:not(.top):not(.tags-in) { opacity: .7; }

/* Skeletons */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, #ECEEE7 0%, #F6F7F2 50%, #ECEEE7 100%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.hero .sk { background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.16), rgba(255,255,255,.08)) 0 0 / 200% 100%; }
.sk-title { width: 180px; height: 24px; }
.sk-chip { flex: none; width: 96px; height: 40px; border-radius: 999px; }
.sk-num { display: inline-block; vertical-align: bottom; width: 120px; height: 52px; margin: 4px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { flex: none; width: 280px; height: 276px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.sk-card .sk:first-child { height: 96px; border-radius: 0; }
.sk-line { height: 14px; margin: 16px 16px 0; }
.sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; } .sk-line.w40 { width: 40%; }
.sk-row { height: 152px; border-radius: var(--r-card); }

/* Explorar */
.fbar { position: sticky; top: calc(var(--hh) + var(--safe-t)); z-index: 30; background: var(--bg); padding: 12px 16px 0; border-bottom: 1px solid transparent; transition: transform var(--sheet) var(--ease); }
html.compact .fbar { transform: translateY(-8px); }
.fbar.stuck { box-shadow: 0 8px 16px -12px rgba(11,27,58,.25); border-bottom-color: var(--border); }
.fbar-row { display: flex; gap: 8px; align-items: center; }
.fbar-row + .fbar-row { margin-top: 8px; }
.fbar-chips { margin: 0 -16px; padding: 8px 16px 12px; }
.fbar-chips .chip { height: 36px; padding: 0 12px; }
.fbar-chips .sk-chip { height: 36px; }
.seg { display: flex; padding: 3px; border-radius: var(--r-chip); background: #ECEEE7; flex: none; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-chip); font-size: 14px; font-weight: 500; color: var(--text2); white-space: nowrap; transition: background-color var(--fast), color var(--fast); }
.seg button[aria-pressed="true"] { background: var(--noche); color: #fff; font-weight: 700; box-shadow: var(--e1); }
.seg-view button { padding: 0 10px; height: 38px; }
.seg-fecha { flex: 1; }
.sort-btn { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--noche); transition: transform var(--fast) var(--ease); }
.sort-btn:active { transform: scale(.94); }
.sort-btn.on { background: var(--noche); border-color: var(--noche); color: #fff; }
.seg-fecha button { flex: 1; }
.ex-count { padding: 8px 16px 12px; color: var(--text2); }
.ex-count b { color: var(--text); font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 24px; }
.list > .card-l { content-visibility: auto; contain-intrinsic-size: auto 152px; }
.sentinel { height: 1px; }
/* El mapa queda fijo entre los filtros y la barra inferior, en su propia capa: las capas internas de
   Leaflet (z-index 400-1000) no pueden quedar por encima del header, los filtros ni los sheets. */
.ex-map { position: fixed; left: 0; right: 0; top: var(--map-top, 250px); bottom: var(--tab); z-index: 1; isolation: isolate; }
.map { position: absolute; inset: 0; z-index: 0; background: #E9ECE4; }
.map-fab { position: absolute; right: 16px; top: 16px; z-index: 500; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-btn); background: var(--surface); color: var(--noche); box-shadow: var(--e2); }
.map-mini { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 500; animation: up var(--sheet) var(--ease); }
.map-mini .x { position: absolute; top: 8px; right: 8px; z-index: 3; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); color: var(--noche); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
body.map-mode { padding-bottom: 0; overflow: hidden; overscroll-behavior: none; }
body.map-mode .ex-count { position: absolute; left: -9999px; }

/* Pins */
.pin { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: var(--on); border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(11,27,58,.3); font: 700 12px/1 var(--font-d); letter-spacing: -.02em; transition: transform var(--fast) var(--ease); }
.pin.on { transform: scale(1.25); box-shadow: 0 0 0 4px var(--fluor), 0 4px 12px rgba(11,27,58,.35); }
.leaflet-marker-icon.pin-wrap { background: none; border: 0; }
.cl { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--noche); color: var(--fluor); border: 3px solid rgba(184,243,74,.55); font: 700 14px/1 var(--font-d); box-shadow: 0 2px 10px rgba(11,27,58,.35); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2F6BFF; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,107,255,.2); }
.leaflet-container { font-family: var(--font-b); }
.leaflet-control-attribution { font-size: 12px !important; line-height: 16px; }
.leaflet-control-attribution a { color: #2E4A7D; }

/* Páginas */
.page-head { padding: 24px 16px 16px; }
.page-head p { margin-top: 4px; }
/* Sin display: la vista de error solo se muestra con html[data-view="error"] (antes quedaba visible al pie de todas las páginas). */
.state { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; min-height: calc(100dvh - var(--hh) - var(--safe-t) - var(--tab)); padding: 32px; }
.state .btn { margin-top: 12px; }
.state-ico { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 24px; background: var(--noche); color: var(--fluor); margin-bottom: 8px; }
.state-ico .i { width: 32px; height: 32px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 24px; background: var(--surface); border: 1px dashed #CBD0C5; border-radius: var(--r-card); }
.empty .state-ico { width: 56px; height: 56px; border-radius: 18px; }
.empty .btn { margin-top: 8px; }
.zone-empty { margin: 16px; display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border); }
.zone-empty .i { color: var(--amber); }
.zone-empty .btn { margin-top: 12px; min-height: 40px; padding: 0 16px; }

/* Categorías */
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 16px 16px; }
.cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: var(--r-btn); background: var(--surface); border: 1px solid var(--border); font-weight: 500; transition: transform var(--fast) var(--ease), border-color var(--fast); }
.cat:hover { border-color: #CBD0C5; }
.cat:active { transform: scale(.97); }
.cat .n { color: var(--text2); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Pie */
.foot { padding: 24px 16px 32px; display: flex; flex-direction: column; gap: 12px; }
.foot-card { display: block; width: 100%; text-align: left; padding: 20px 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border); }
.foot-card .h3 { display: flex; align-items: center; gap: 8px; }
.foot-card .h3 .i { color: var(--noche); }
.foot-card > p { margin-top: 4px; }
.foot-local { display: flex; align-items: center; gap: 12px; transition: transform var(--fast) var(--ease); }
.foot-local:active { transform: scale(.98); }
.foot-local > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.foot-note { text-align: center; padding: 0 8px; }
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 20px; font-weight: 500; }
.fld input, .fld select, .fld textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-btn); border: 1px solid #CBD0C5; background: var(--surface); font-size: 16px; line-height: 24px; font-weight: 400; }
.fld input::placeholder, .fld textarea::placeholder { color: var(--text2); opacity: 1; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 0; border-color: var(--noche); box-shadow: 0 0 0 1px var(--noche); }
.form-msg:empty { display: none; }

/* Barra inferior */
.tabbar {
  position: fixed; inset: auto 0 0; z-index: 45; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  height: var(--tab); padding: 8px 8px calc(8px + var(--safe-b)); background: var(--noche); box-shadow: 0 -6px 20px rgba(11,27,58,.12);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 16px; color: #AEB7C6; font-size: 12px; line-height: 16px; font-weight: 500; transition: color var(--fast), background-color var(--fast), transform var(--fast) var(--ease); }
.tabbar a:active { transform: scale(.94); }
.tabbar a[aria-current="page"] { color: var(--fluor); font-weight: 700; background: rgba(184,243,74,.1); }
.tabbar a[aria-current="page"] .i { stroke-width: 2.1; }
.tab-ico { position: relative; }
.tab-count { position: absolute; top: -4px; left: 16px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fluor); color: var(--noche); font: 700 12px/18px var(--font-b); text-align: center; }

/* Sheets */
.layer { position: fixed; inset: 0; z-index: 60; }
.scrim { position: absolute; inset: 0; background: rgba(11,27,58,.5); opacity: 0; transition: opacity var(--sheet) var(--ease); touch-action: none; }
.layer.open .scrim { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: 0 -8px 32px rgba(11,27,58,.2);
  transform: translateY(100%); transition: transform var(--sheet) var(--ease);
  padding-bottom: var(--safe-b); outline: none; overscroll-behavior: contain; will-change: transform; contain: layout paint;
}
.layer.open .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grab { flex: none; height: 24px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grab::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: #CBD0C5; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px 8px; touch-action: none; }
.sheet-body { overflow-y: auto; padding: 8px 16px 24px; overscroll-behavior: contain; }
.opts { display: flex; flex-direction: column; gap: 4px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border-radius: var(--r-btn); text-align: left; transition: transform var(--fast) var(--ease), background-color var(--fast); }
.opt:hover { background: var(--bg); }
.opt[aria-checked="true"], .opt[aria-pressed="true"] { background: var(--bg); box-shadow: inset 0 0 0 2px var(--noche); }
.opt .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg); color: var(--noche); flex: none; }
.opt[aria-checked="true"] .ico, .opt[aria-pressed="true"] .ico { background: var(--noche); color: var(--fluor); }
.opt .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.opt .t b { font-weight: 700; }
.opt .t span { font-size: 14px; line-height: 20px; color: var(--text2); }
.opt .n { color: var(--text2); font-size: 14px; font-variant-numeric: tabular-nums; }
.opt .ok { color: var(--noche); opacity: 0; }
.opt[aria-checked="true"] .ok, .opt[aria-pressed="true"] .ok { opacity: 1; }
.opt-sep { height: 1px; margin: 4px 12px; background: var(--border); }
.opts-sec { margin: 12px 12px 6px; font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.opts-sec:first-child { margin-top: 0; }
.opts-dias { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 4px; }
.opts-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px; margin-top: 8px; background: var(--surface); border-top: 1px solid var(--border); }
.opts-foot .btn { flex: 1; }
.opt-foot { display: flex; gap: 8px; padding-top: 12px; }
.opt-foot .btn { flex: 1; }

/* Detalle */
/* El detalle mide siempre 100dvh: abrirlo "a medias" o a pantalla completa es solo moverlo (transform),
   así expandirlo mientras scrolleás no recalcula el contenido (antes animaba la altura y trababa el scroll). */
.sheet-detail { --gap: 8dvh; top: 0; height: 100dvh; max-height: none; overflow: hidden; padding-bottom: 0; }
.layer.open .sheet-detail { transform: translateY(var(--gap)); }
.layer.open .sheet-detail.full { transform: translateY(0); }
.grab-over { position: absolute; top: 0; left: 0; right: 0; z-index: 5; height: 28px; }
.grab-over::before { background: rgba(255,255,255,.75); transition: opacity var(--fast); }
.sheet-detail.scrolled .grab-over::before { opacity: 0; }
.t-happy .grab-over::before, .t-regalo .grab-over::before, .t-evento .grab-over::before { background: rgba(11,27,58,.4); }
.d-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); padding-bottom: calc(72px + var(--safe-b) + var(--gap)); }
.d-cover { height: calc(208px + var(--safe-t)); padding: calc(28px + var(--safe-t)) 16px 20px; display: flex; flex-direction: column; justify-content: space-between; --bpad: 32px; --bmax: 88px; }
.d-cover .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.d-cover .icon-btn { background: rgba(255,255,255,.92); color: var(--noche); position: relative; z-index: 6; }
.d-cover .icon-btn:hover { background: #fff; }
.d-cover .kind { font: 700 12px/16px var(--font-b); letter-spacing: .12em; text-transform: uppercase; opacity: .9; margin-top: 4px; }
.d-body { padding: 20px 16px 24px; display: flex; flex-direction: column; gap: 20px; }
.d-who { display: flex; gap: 12px; align-items: center; }
.d-who .av { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
.d-who > div { min-width: 0; }
.d-promo { font: 500 20px/28px var(--font-b); overflow-wrap: anywhere; }
.d-block { display: flex; gap: 12px; padding: 16px; border-radius: 16px; background: var(--bg); }
.d-block > .i { margin-top: 2px; color: var(--noche); }
.d-block > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.d-block .lbl { font: 700 12px/16px var(--font-b); letter-spacing: .08em; text-transform: uppercase; color: var(--text2); }
.d-block .big { font-weight: 700; }
.d-block .big.red { color: var(--red); }
.d-block.ext { background: #F1FBDF; }
.week { display: flex; gap: 4px; margin-top: 8px; }
.week span { flex: 1; display: grid; place-items: center; height: 32px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text2); }
.week span.on { background: var(--noche); border-color: var(--noche); color: #fff; }
.week span.hoy { box-shadow: 0 0 0 2px var(--fluor); }
.d-map { height: 160px; border-radius: 16px; overflow: hidden; margin-top: 8px; background: #E9ECE4; position: relative; z-index: 0; }
.d-actions { display: flex; }
.d-actions .btn { flex: 1; }
.d-sub { padding: 0 16px; margin-bottom: 12px; }
.d-list { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 8px; }
.d-foot { padding: 8px 16px 24px; text-align: center; }
/* Barra de acciones pegada abajo de la pantalla: se corre lo mismo que el sheet pero al revés. */
.d-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); transform: translateY(calc(-1 * var(--gap))); transition: transform var(--sheet) var(--ease); }
.sheet-detail.full .d-bar, .sheet-detail.dragging .d-bar { transition: none; }
.sheet-detail.full .d-bar { transform: none; }
.d-bar .fav { background: var(--bg); box-shadow: none; width: 48px; height: 48px; border-radius: var(--r-btn); }
.d-bar .sq { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-btn); background: var(--bg); color: var(--noche); flex: none; transition: transform var(--fast) var(--ease); }
.d-bar .sq:active { transform: scale(.94); }
.d-bar .btn { flex: 1; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab) + 16px); z-index: 80; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: var(--r-btn); background: var(--noche); color: #fff; font-size: 14px; line-height: 20px; font-weight: 500; box-shadow: var(--e2); transition: transform var(--sheet) var(--ease), opacity var(--sheet) var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .i { color: var(--fluor); width: 20px; height: 20px; }

@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; width: 480px; margin-left: -240px; }
  .list { max-width: 720px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .ticker { overflow-x: auto; scrollbar-width: none; }
  .ticker-track { animation: none; }
  .hero-radar { display: none; }
}

/* ---------- Descuentos con tarjetas (bancos, billeteras y clubes): aparte de las promos del local ---------- */
.bnf { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 4px; font-size: 12px; line-height: 16px; min-width: 0; }
.bnf-t { color: var(--mc, var(--text2)); font-weight: 700; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bnf-mas { color: var(--text2); font-weight: 500; }
.card-c .bnf { margin-top: 6px; }
.hero-bnf { margin-top: 2px; font-size: 14px; line-height: 20px; color: rgba(255,255,255,.78); }
.hero-bnf b { color: #fff; font-weight: 700; }
.bnf-cnt { white-space: nowrap; }
.bnf-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bnf-i { display: flex; flex-direction: column; gap: 2px; }
.bnf-i .bnf-t { font-size: 12px; letter-spacing: .02em; }
.bnf-i b { font-weight: 700; }
.bnf-i a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; width: fit-content; }
.bnf-i:not(.hoy) b::after { content: " · hoy no"; font-weight: 500; color: var(--text3); }
.bnf-aviso { margin-top: 8px; }
.bnf-nom { color: var(--mc); }
.pin.pin-bnf { width: 30px; height: 30px; background: var(--text3); color: #fff; border-width: 2px; font-size: 13px; box-shadow: 0 1px 4px rgba(11,27,58,.25); }
.card-bnf .cover { background: var(--text3); color: #fff; }
.card-bnf .body { gap: 4px; }
.map-mini .bnf-ir { width: 100%; margin-top: 8px; }

/* Banner de campañas del Inicio ("Hoy sábado: Nación 30% en Gastronomía") y pantalla "Descuentos con tu banco" */
.camp-banner { display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); margin: 12px 16px 0; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left;
  font: 500 14px/20px var(--font-b); box-shadow: var(--e1); cursor: pointer; }
.camp-banner[hidden] { display: none; }
.camp-banner > .i { flex: none; color: var(--noche); }
.camp-banner .cb-t { flex: 1; min-width: 0; }
.camp-banner .cb-dia { font-weight: 700; }
.camp-banner b { color: var(--mc, var(--text)); font-weight: 700; }
.camp-g { padding: 8px 12px 12px; }
.camp-g .h3 { margin-bottom: 4px; }
.card-bnf .ct { font-size: 12px; line-height: 16px; color: var(--text2); }
.bnf-rating { color: var(--text); font-weight: 600; }
#bancos-body .seg { margin: 4px 12px 8px; }
