/* ===== Antojo Peñasco ===== */
:root {
  --bg: #0D0B0A;
  --card: #171210;
  --card2: #221B17;
  --line: #3A2E27;
  --text: #F8F1E8;
  --muted: #B0A398;
  --yellow: #F59E0B;
  --orange: #E63946;
  --red: #DC2626;
  --green: #10B981;
  --wa: #059669;
  --gold-grad: linear-gradient(135deg, #FCD34D 0%, #F59E0B 50%, #EA580C 100%);
  --chile-glow: 0 0 0 1px rgba(230, 57, 70, .25), 0 10px 30px rgba(230, 57, 70, .18);
  --radius: 16px;
  --top: 60px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.amarillo { color: var(--yellow); }
.centro { text-align: center; }

/* Iconos */
.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 1px solid transparent; border-radius: 12px; padding: .6em 1em;
  font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, filter .15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: .45em .8em; font-size: 12px; }
.btn-lg { padding: .9em 1.2em; font-size: 15px; border-radius: 14px; }
.btn-full { width: 100%; }
.btn-gold { background: var(--gold-grad); color: #1a1100; box-shadow: 0 4px 18px rgba(245, 158, 11, .25); }
.btn-gold:hover { filter: brightness(1.07); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--card2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: #4a3c33; background: #2a211c; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.show-sm { display: none; }

/* ===== Barra superior ===== */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: rgba(13, 11, 10, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 21px;
  background: var(--gold-grad); box-shadow: 0 4px 16px rgba(255, 122, 26, .35); flex: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .02em; line-height: 1.05; }
.brand-text em { font-style: normal; color: var(--yellow); }
.brand-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; }

.aviso-demo {
  position: fixed; top: var(--top); left: 0; right: 0; z-index: 999; text-align: center;
  background: #3b1d0a; color: #FDE68A; font-size: 12px; padding: 6px 12px; border-bottom: 1px solid #7c2d12;
}
.aviso-demo a { color: #fff; font-weight: 700; }

/* ===== Layout ===== */
.layout { position: fixed; inset: var(--top) 0 0 0; display: grid; grid-template-columns: 420px 1fr; }
body.demo .layout { top: calc(var(--top) + 29px); }
.mapa-wrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #0a0807; }

.panel {
  position: relative; display: flex; flex-direction: column; min-height: 0;
  background: var(--card); border-right: 1px solid var(--line); z-index: 500;
}
.sheet-handle { display: none; }
.panel-tools { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--yellow); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font-size: 14px; }
.search input::placeholder { color: #6b7280; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card2);
  font-size: 12.5px; font-weight: 600; color: #cfd3da; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.chip:hover { color: #fff; border-color: #4a3c33; }
.chip.on { background: var(--yellow); border-color: var(--yellow); color: #1a1100; }
.chip.on-green { background: rgba(230, 57, 70, .18); border-color: var(--orange); color: #fecaca; box-shadow: 0 0 0 3px rgba(230, 57, 70, .15); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(16, 185, 129, .7); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

.panel-scroll { flex: 1; overflow-y: auto; padding: 14px; overscroll-behavior: contain; }
.panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #3f332c; border-radius: 9px; }

.titulo-seccion { font-family: var(--display); font-size: 15px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 6px; }
.titulo-seccion .ico { color: var(--yellow); }

/* Destacados */
.destacados { margin-bottom: 14px; }
.destacados .titulo-seccion { margin-bottom: 10px; }
.carrusel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 4px; }
.carrusel::-webkit-scrollbar { display: none; }
.carrusel { perspective: 900px; }
.dest-card {
  position: relative; flex: none; width: 250px; height: 160px; padding: 0; border: 0; background: none;
  scroll-snap-align: start; cursor: pointer; perspective: 700px; transform-style: preserve-3d; color: inherit;
}
.carrusel .dest-card:only-child { width: 100%; }
.dest-3d {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; background: #222; text-align: left;
  border: 1px solid rgba(245, 158, 11, .55); box-shadow: 0 0 0 1px rgba(245, 158, 11, .15), 0 10px 26px rgba(234, 88, 12, .16);
  transform-style: preserve-3d; will-change: transform;
}
.dest-3d .foto { position: absolute; inset: 0; transform: scale(1.06); }
.dest-3d::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .88) 10%, rgba(0, 0, 0, .1) 60%, rgba(0, 0, 0, .25)); }
.dest-3d .info { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2; transform: translateZ(30px); }
.dest-3d h3 { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 800; line-height: 1.15; }
.dest-3d p { margin: 2px 0 0; font-size: 12px; color: var(--yellow); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dest-3d .corona { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--gold-grad); color: #1a1100; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; display: flex; gap: 4px; align-items: center; transform: translateZ(40px); }
.dest-3d .estado { position: absolute; top: 10px; right: 10px; z-index: 2; transform: translateZ(40px); }
.dest-3d .brillo { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, .28), transparent 55%); mix-blend-mode: overlay; }
.dest-card:hover .brillo { opacity: 1; }

/* Fotos con respaldo */
.foto { background-size: cover; background-position: center; }
.foto-vacia { display: grid; place-items: center; font-size: 44px; background: radial-gradient(circle at 30% 25%, #3b2a12, #1c1512 70%); }
.foto-vacia.cat-ramen { background: radial-gradient(circle at 30% 25%, #5a2311, #1b1414 70%); }
.foto-vacia.cat-elotes { background: radial-gradient(circle at 30% 25%, #5a4a0c, #18170f 70%); }
.foto-vacia.cat-postres { background: radial-gradient(circle at 30% 25%, #5a1730, #1b1218 70%); }
.foto-vacia.cat-dogos { background: radial-gradient(circle at 30% 25%, #5a2a0c, #1a140f 70%); }
.foto-vacia.cat-raspados { background: radial-gradient(circle at 30% 25%, #0c3f5a, #0f161b 70%); }
.foto-vacia.cat-mariscos { background: radial-gradient(circle at 30% 25%, #0c4f4a, #0f1a19 70%); }

/* Banner */
.banner {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 16px; border-radius: 14px;
  background: linear-gradient(110deg, rgba(120, 80, 0, .35), rgba(60, 40, 0, .2)); border: 1px dashed rgba(245, 158, 11, .45);
}
.banner.patrocinado { border-style: solid; }
.banner .emoji { font-size: 26px; flex: none; }
.banner .txt { flex: 1; min-width: 0; }
.banner strong { display: block; font-size: 12.5px; color: #FCD34D; text-transform: uppercase; letter-spacing: .03em; }
.banner small { display: block; font-size: 12px; color: #c9cdd5; line-height: 1.3; }
.banner .tag { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Lista */
.lista-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.lista-orden { color: var(--muted); font-size: 11.5px; }
.lista { display: grid; gap: 10px; }
/* Tarjetas: la comida es lo primero que se ve */
.card {
  display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: var(--radius); cursor: pointer; text-align: left; width: 100%;
  background: var(--card2); border: 1px solid var(--line); transition: border-color .15s, background .15s, box-shadow .2s; isolation: isolate;
}
.card:hover { border-color: #56463c; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.card.es-dest { border-color: rgba(245, 158, 11, .7); box-shadow: 0 0 0 1px rgba(245, 158, 11, .25), 0 12px 32px rgba(234, 88, 12, .22); }
.card.activo { border-color: var(--yellow); }
.card-foto { position: relative; width: 100%; height: 142px; flex: none; overflow: hidden; font-size: 54px; }
.card-foto > .foto, .card-foto > .foto-vacia { position: absolute; inset: 0; transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .3s; }
.card:hover .card-foto > .foto, .card:hover .card-foto > .foto-vacia { transform: scale(1.07); }
.card-foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(13, 11, 10, .75), transparent 45%); pointer-events: none; }
.card.cerrado .card-foto > .foto { filter: grayscale(.45) brightness(.78); }
.card-foto .pill-estado { position: absolute; left: 10px; bottom: 10px; z-index: 2; }
.card-foto .dist-pill { position: absolute; right: 10px; bottom: 10px; z-index: 2; font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: rgba(13, 11, 10, .72); color: #fff; backdrop-filter: blur(6px); }
.corona-card { position: absolute; left: 10px; top: 10px; z-index: 2; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: var(--gold-grad); color: #1a0d00; box-shadow: 0 4px 16px rgba(245, 158, 11, .55); letter-spacing: .01em; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card h3 { margin: 0; font-family: var(--display); font-size: 16px; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .desde { flex: none; font-size: 11.5px; color: var(--muted); }
.card .desde b { color: #fff; font-size: 14px; }
.card .esp { color: var(--yellow); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .lugar { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Fotos de comida con más vida */
.foto { filter: saturate(1.18) contrast(1.06); }
.dist { color: var(--muted); font-weight: 600; }

.estado-txt { font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.estado-txt::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.estado-txt.abierto { color: #34d399; }
.estado-txt.pronto { color: #fbbf24; }
.estado-txt.cerrado { color: #8b919d; }
.pill-estado { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; backdrop-filter: blur(6px); }
.pill-estado.abierto { background: rgba(5, 150, 105, .92); color: #fff; }
.pill-estado.pronto { background: rgba(217, 119, 6, .92); color: #fff; }
.pill-estado.cerrado { background: rgba(20, 22, 28, .85); color: #c6cad2; border: 1px solid #45372f; }
.pill-estado.abierto::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: ping-w 1.6s infinite; }
@keyframes ping-w { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .8); } 70%, 100% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); } }

/* Estado vacío */
.vacio { text-align: center; padding: 26px 16px; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .015); }
.vacio .grande { font-size: 44px; line-height: 1; }
.vacio h3 { font-family: var(--display); font-size: 18px; margin: 10px 0 6px; }
.vacio p { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.vacio .btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.panel-foot { margin-top: 18px; padding: 14px 4px 6px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 12.5px; }
.panel-foot p { margin: 0 0 8px; }
.panel-foot-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.legal { font-size: 10.5px; color: #6b7280; }
.legal a { color: #8b919d; }

/* ===== Mapa (MapLibre) ===== */
.maplibregl-map { font: inherit; }
.maplibregl-ctrl-group { background: var(--card) !important; border: 1px solid var(--line); box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 38px !important; height: 38px !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }
.tema-claro .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }
.maplibregl-ctrl-attrib { background: rgba(13, 11, 10, .72) !important; color: #9aa1ae !important; font-size: 10.5px; }
.maplibregl-ctrl-attrib a { color: #c9cdd5 !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.mini-mapa .maplibregl-ctrl-group { background: #fff !important; }
.mini-mapa .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: none; }

/* Cargando / error del mapa (que siempre se sepa qué está pasando) */
.mapa-cargando { position: absolute; inset: 0; z-index: 550; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center;
  background: radial-gradient(circle at 50% 45%, #1e1714, var(--bg) 70%); color: var(--muted); font-weight: 600; transition: opacity .4s; }
.mapa-cargando p { margin: 0; }
.mapa-cargando .txt-error { display: none; color: #fca5a5; line-height: 1.8; }
.mapa-cargando.con-error .txt-error { display: block; }
.mapa-cargando.con-error .txt-cargando, .mapa-cargando.con-error .radar { display: none; }
.radar { position: relative; width: 90px; height: 90px; display: grid; place-items: center; font-size: 30px; }
.radar span:not(:last-child) { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(245, 158, 11, .6); animation: radar 1.8s ease-out infinite; }
.radar span:nth-child(2) { animation-delay: .9s; }
@keyframes radar { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }

/* Pines (MapLibre los mueve con transform: no tocar transform ni position de .pin) */
.pin { width: 38px; height: 46px; cursor: pointer; }
.pin-in { position: absolute; inset: 0; transform-origin: 50% 100%; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.pin:hover .pin-in, .pin.activo .pin-in, .pin:focus-visible .pin-in { transform: scale(1.18) translateY(-3px); }
.pin:hover, .pin.activo, .pin:focus-visible { z-index: 10 !important; }
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin-forma { outline: 3px solid #60a5fa; outline-offset: 2px; }
.pin-forma {
  position: absolute; left: 3px; top: 0; width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #231c18; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}
.pin-emoji { position: absolute; left: 0; top: 3px; width: 38px; text-align: center; font-size: 16px; line-height: 26px; }
.pin.abierto .pin-forma { background: #064e3b; border-color: #34d399; }
.pin.cerrado .pin-in { opacity: .75; }
.pin.cerrado .pin-forma { background: #2b2420; border-color: #8b919d; }
.pin.dorado { width: 48px; height: 58px; }
.pin.dorado .pin-forma { width: 42px; height: 42px; background: var(--gold-grad); border: 3px solid #fff; animation: pulso 2s infinite; }
.pin.dorado .pin-emoji { width: 48px; font-size: 21px; line-height: 36px; top: 3px; }
.pin.dorado .corona-pin { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 15px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(255, 184, 0, .75); } 70% { box-shadow: 0 0 0 16px rgba(255, 184, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 184, 0, 0); } }
/* Nombre del puesto al pasar el mouse (o al seleccionarlo) */
.pin-nombre { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%) translateY(4px); opacity: 0; pointer-events: none;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 4px 9px; font-size: 12px; font-weight: 700;
  white-space: nowrap; box-shadow: var(--shadow); transition: opacity .15s, transform .15s; }
.pin:hover .pin-nombre, .pin.activo .pin-nombre, .pin:focus-visible .pin-nombre { opacity: 1; transform: translateX(-50%) translateY(0); }
.yo { width: 18px; height: 18px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59, 130, 246, .3); }
.yo::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #3b82f6; animation: radar 2s ease-out infinite; }

/* Usabilidad: conteos, limpiar filtros, atajo, esqueletos, errores */
.chip .cuenta { font-weight: 800; font-size: 11px; opacity: .7; }
.chip .cuenta:empty { display: none; }
.chip-limpiar { background: transparent; border-style: dashed; color: #fca5a5; }
.atajo { font: 700 11px/1 system-ui, sans-serif; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; }
.search:focus-within .atajo { display: none; }
@media (hover: none) { .atajo { display: none; } }
.card.esqueleto { pointer-events: none; }
.card.esqueleto .card-foto, .card.esqueleto i { background: linear-gradient(90deg, #1e1814 25%, #2c231e 50%, #1e1814 75%); background-size: 200% 100%; animation: brillo-carga 1.2s linear infinite; }
.card.esqueleto i { display: block; height: 11px; border-radius: 6px; margin: 4px 0; }
.card.esqueleto i:nth-child(1) { width: 70%; height: 14px; } .card.esqueleto i:nth-child(2) { width: 45%; } .card.esqueleto i:nth-child(3) { width: 85%; }
@keyframes brillo-carga { to { background-position: -200% 0; } }
.campo.invalido input, .campo.invalido .mini-mapa, .campo.invalido .chips { border-color: #f87171 !important; box-shadow: 0 0 0 3px rgba(248, 113, 113, .15); border-radius: 11px; }
.campo.invalido .chips { border: 1px solid; padding: 6px; }
.error-campo { color: #fca5a5; font-size: 12px; font-weight: 600; }
.error-campo::before { content: "⚠ "; }
:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }

.map-fabs { position: absolute; right: 14px; top: 14px; z-index: 600; display: grid; gap: 8px; }
.fab {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); transition: background .15s;
}
.fab:hover { background: var(--card2); }
.fab.on { color: #60a5fa; border-color: #3b82f6; }
.fab .ico { width: 19px; height: 19px; }
.fab-lista { display: none; }

/* ===== Modales ===== */
.modal {
  border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0;
  border-radius: 22px; width: min(520px, calc(100vw - 32px)); max-height: min(88dvh, 860px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; }
html:not(.con-motion) .modal[open] { animation: entra .22s ease; }
.modal::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
@keyframes entra { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-chico { width: min(460px, calc(100vw - 32px)); }
.modal-body { padding: 20px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.modal h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.15; }
.modal p { margin: 0; }
.cerrar {
  position: absolute; top: 12px; right: 12px; z-index: 5; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 16px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cerrar:hover { background: rgba(0, 0, 0, .85); }
.modal-icono { width: 54px; height: 54px; border-radius: 16px; margin: 4px auto 0; display: grid; place-items: center; font-size: 28px; background: var(--card2); border: 1px solid var(--line); }
.modal-icono .ico { width: 26px; height: 26px; }
.modal-icono.gold { background: var(--gold-grad); color: #1a1100; border: 0; }
.modal-icono.verde { background: rgba(16, 185, 129, .15); color: #34d399; border-color: rgba(16, 185, 129, .4); }

.detalle-estado { position: absolute; left: 16px; bottom: 14px; z-index: 2; }
.detalle-titulo { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.badge-gold { flex: none; display: inline-flex; gap: 4px; align-items: center; font-size: 11px; font-weight: 800; background: var(--gold-grad); color: #1a1100; padding: 3px 9px; border-radius: 999px; }
.detalle-lugar { color: var(--muted); font-size: 13px; }
.detalle-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: #cfd3da; }
.tag.verde { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .4); color: #6ee7b7; }
.detalle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dato { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; min-width: 0; }
.dato small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.dato strong { display: block; font-size: 13px; }
.subtitulo { margin: 6px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #cfd3da; display: flex; justify-content: space-between; align-items: baseline; }
.subtitulo small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.menu { display: grid; gap: 6px; }
.menu-item {
  display: flex; justify-content: space-between; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s;
}
.menu-item:hover { border-color: var(--wa); }
.menu-item b { color: var(--yellow); flex: none; }
.modal-acciones { padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--bg); display: grid; gap: 8px; flex: none; }
.acciones-sec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acciones-sec .btn { padding: .6em .4em; font-size: 12px; }

/* Formularios */
.campo { display: grid; gap: 5px; }
.campo > span { font-size: 12px; font-weight: 700; color: #cfd3da; }
.campo > span small { font-weight: 500; color: var(--muted); }
.campo input, .campo select, .campo textarea, .fila-ubic select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; outline: 0; font-size: 14px;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--yellow); }
.campo textarea { resize: vertical; }
.fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fila-ubic { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.chips-form { flex-wrap: wrap; }
.dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.dias button { padding: 8px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); font-weight: 700; font-size: 12px; cursor: pointer; }
.dias button.on { background: var(--yellow); border-color: var(--yellow); color: #1a1100; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.mini-mapa { height: 200px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.mini-mapa-info { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.nota { font-size: 11.5px; color: var(--muted); text-align: center; }
.precio { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(245, 158, 11, .08); border: 1px solid rgba(245, 158, 11, .35); }
.precio strong { display: block; color: #FCD34D; font-size: 13px; }
.precio small { color: var(--muted); font-size: 11.5px; }
.precio > span { color: var(--muted); font-size: 12px; }
.precio b { font-family: var(--display); font-size: 24px; color: #fff; }
.precio.verde { background: rgba(16, 185, 129, .08); border-color: rgba(16, 185, 129, .35); }
.precio.verde strong { color: #6ee7b7; }
.beneficios { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 7px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; }
.beneficios li { display: flex; gap: 8px; align-items: flex-start; }
.beneficios .ico { color: #34d399; margin-top: 2px; }
.cupo { display: flex; justify-content: center; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; color: #FCD34D; }
.cupo .slot { width: 22px; height: 8px; border-radius: 9px; background: #45372f; }
.cupo .slot.lleno { background: var(--gold-grad); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 3000; pointer-events: none;
  background: #2c231e; color: #fff; border: 1px solid #45372f; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13px;
  box-shadow: var(--shadow); transition: all .25s ease; max-width: calc(100vw - 32px); text-align: center;
}
.toast.ver { opacity: 1; transform: translate(-50%, 0); }

/* ===== Celular: mapa completo + hoja inferior ===== */
@media (max-width: 820px) {
  :root { --top: 56px; }
  .topbar { padding: 0 12px; }
  .brand-text strong { font-size: 16px; }
  .brand-logo { width: 34px; height: 34px; font-size: 19px; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .top-actions .btn { padding: .55em .75em; font-size: 12px; }

  .layout { display: block; }
  .mapa-wrap { position: absolute; inset: 0; }
  .map-fabs { top: 12px; right: 12px; }
  .maplibregl-ctrl-bottom-left { display: none; }

  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; height: 88%; z-index: 700;
    border-right: 0; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
    transform: translateY(calc(100% - var(--peek, 330px))); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  }
  .panel.abierto { transform: translateY(0); }
  .panel.oculto { transform: translateY(calc(100% - 64px)); }
  .sheet-handle { display: grid; place-items: center; height: 22px; border: 0; background: none; cursor: pointer; flex: none; padding-top: 6px; }
  .grip { width: 44px; height: 5px; border-radius: 9px; background: #5a4a40; }
  .panel-tools { padding: 4px 12px 10px; }
  .panel-scroll { padding: 12px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .carrusel { margin: 0 -12px; padding: 0 12px 4px; }
  .dest-card { width: 78%; height: 150px; }

  .fab-lista {
    display: none; position: absolute; left: 50%; transform: translateX(-50%); bottom: 82px; z-index: 600;
    align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--card); color: var(--text); font-weight: 700; box-shadow: var(--shadow); cursor: pointer;
  }
  body.lista-oculta .fab-lista { display: inline-flex; }

  .modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  html:not(.con-motion) .modal[open] { animation: sube .25s cubic-bezier(.2, .8, .2, 1); }
  @keyframes sube { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
  .modal-acciones { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .brand-text small { display: none; }
  .top-actions .btn .ico { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== Persuasión (con datos reales) ===== */
.cupo-top { margin-left: 2px; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: #7f1d1d; color: #fff; animation: latido 1.6s ease-in-out infinite; }
.cupo-top:empty { display: none; }
.cupo-top.lleno { background: #3f332c; animation: none; }
@keyframes latido { 50% { transform: scale(1.12); } }
.titulo-seccion .patro { font-family: system-ui, sans-serif; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-left: 4px; }
.estado-corona { font-size: 13px; line-height: 1.45; padding: 11px 13px; border-radius: 14px; text-align: center; }
.estado-corona.libre { background: rgba(16, 185, 129, .1); border: 1px solid rgba(16, 185, 129, .4); color: #d1fae5; }
.estado-corona.ocupada { background: rgba(230, 57, 70, .12); border: 1px solid rgba(230, 57, 70, .45); color: #fecaca; }
.estado-corona.tuya { background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .45); color: #fde68a; }
#relojPenasco.vivo-txt { color: #fca5a5; font-weight: 700; }
/* Pin dorado con destello */
.pin.dorado .pin-forma { animation: pulso 2s infinite, destello 1.6s ease-in-out infinite alternate; }
@keyframes destello { from { filter: drop-shadow(0 0 3px rgba(245, 158, 11, .6)); } to { filter: drop-shadow(0 0 14px rgba(245, 158, 11, 1)) brightness(1.15); } }
.pin.abierto .pin-forma { box-shadow: 0 0 0 3px rgba(16, 185, 129, .25), 0 4px 10px rgba(0, 0, 0, .5); }

/* ===== Ficha del puesto: pantalla completa ===== */
.ficha {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: var(--bg); color: var(--text); overflow: hidden;
}
.ficha[open] { display: flex; flex-direction: column; }
.ficha::backdrop { background: rgba(0, 0, 0, .6); }
.ficha-barra {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px; pointer-events: none; transition: background .25s, box-shadow .25s;
}
.ficha-barra > * { pointer-events: auto; }
.ficha-barra.solida { background: rgba(13, 11, 10, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.ficha-barra-titulo { flex: 1; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.ficha-barra.solida .ficha-barra-titulo { opacity: 1; transform: none; }
.ficha-btn {
  width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); cursor: pointer;
  background: rgba(13, 11, 10, .55); color: #fff; display: grid; place-items: center; font-size: 18px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.ficha-btn:hover { background: rgba(13, 11, 10, .8); }
.ficha-btn .ico { width: 20px; height: 20px; }
.ficha-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* Galería */
.galeria { position: relative; height: 58dvh; min-height: 300px; background: #0a0807; overflow: hidden; }
.galeria-pista { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.galeria-pista::-webkit-scrollbar { display: none; }
.gal-slide { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; position: relative; cursor: zoom-in; }
.gal-slide img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.18) contrast(1.06); user-select: none; }
.gal-slide.vacia { cursor: default; font-size: 90px; }
.gal-slide.vacia .foto-vacia { position: absolute; inset: 0; }
.gal-slide.vacia figcaption { position: absolute; left: 0; right: 0; bottom: 64px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.galeria::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to top, var(--bg), transparent); pointer-events: none; }
.galeria::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 110px; background: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent); pointer-events: none; z-index: 1; }
.galeria .detalle-estado { position: absolute; left: 18px; bottom: 18px; z-index: 3; }
.gal-contador { position: absolute; right: 16px; bottom: 18px; z-index: 3; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(13, 11, 10, .7); color: #fff; backdrop-filter: blur(6px); }
.gal-puntos { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3; display: flex; gap: 6px; }
.gal-puntos span { width: 7px; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .45); transition: width .25s, background .25s; }
.gal-puntos span.on { width: 20px; background: #fff; }
.gal-flecha {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(13, 11, 10, .55); color: #fff; font-size: 30px; line-height: 1;
  display: grid; place-items: center; padding-bottom: 4px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.gal-flecha:hover { background: rgba(13, 11, 10, .85); }
.gal-flecha.izq { left: 14px; } .gal-flecha.der { right: 14px; }
@media (hover: none) { .galeria .gal-flecha { display: none; } }
.gal-minis { display: none; }

/* Información */
.ficha-col { position: relative; }
.ficha-info { padding: 6px 18px 20px; display: grid; gap: 12px; max-width: 680px; margin: 0 auto; }
.ficha-info h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 6vw, 34px); line-height: 1.05; }
.detalle-esp-grande { margin: 0; font-size: 16px; font-weight: 700; color: var(--yellow); }
.detalle-esp-grande:empty { display: none; }
.link-fb { color: #93c5fd; font-weight: 700; font-size: 13.5px; text-decoration: none; }
.link-fb:hover { text-decoration: underline; }
.ficha .modal-acciones {
  position: sticky; bottom: 0; z-index: 5; border-top: 1px solid var(--line);
  background: rgba(13, 11, 10, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
}
.ficha .modal-acciones > * { max-width: 680px; width: 100%; margin: 0 auto; }
.ficha .acciones-sec { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

/* Escritorio: galería a la izquierda, información a la derecha */
@media (min-width: 900px) {
  .ficha-scroll { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr); overflow: hidden; }
  .galeria { height: 100%; min-height: 0; }
  .galeria::after { height: 30%; background: linear-gradient(to top, rgba(0, 0, 0, .65), transparent); }
  .gal-puntos { display: none; }
  .gal-minis { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 3; display: flex; justify-content: center; gap: 8px; padding: 0 70px; }
  .gal-minis[hidden] { display: none; }
  .gal-minis button { width: 64px; height: 64px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; opacity: .6; cursor: pointer; background: #222; transition: opacity .2s, border-color .2s, transform .2s; }
  .gal-minis button.on { opacity: 1; border-color: var(--yellow); transform: translateY(-3px); }
  .gal-minis button:hover { opacity: 1; }
  .gal-minis img { width: 100%; height: 100%; object-fit: cover; }
  .galeria .detalle-estado { top: 76px; bottom: auto; left: 20px; }
  .gal-contador { top: 80px; bottom: auto; right: 20px; }
  .ficha-col { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--card); }
  .ficha-info { flex: 1; overflow-y: auto; padding: 80px 30px 24px; max-width: none; margin: 0; align-content: start; }
  .ficha .modal-acciones { position: static; padding: 14px 30px 18px; }
  .ficha .modal-acciones > * { max-width: none; }
  .ficha-barra { right: auto; width: 100%; }
}

/* Visor a pantalla completa */
.visor { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; overflow: hidden; }
.visor::backdrop { background: #000; }
.visor[open] { display: block; }
.visor-pista { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.visor-pista::-webkit-scrollbar { display: none; }
.visor-slide { flex: 0 0 100%; height: 100%; margin: 0; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.visor-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.visor-cerrar { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 5; }
.visor-contador { top: max(22px, calc(env(safe-area-inset-top) + 8px)); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
.visor .gal-flecha { z-index: 5; }
@media (hover: none) { .visor .gal-flecha { display: none; } }

/* ===== Registro rápido ===== */
.reg-progreso { height: 6px; border-radius: 99px; background: var(--card2); overflow: hidden; margin: -2px 0 4px; }
.reg-progreso span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--orange), var(--yellow)); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.reg-progreso[data-listos="3"] span { background: var(--green); }
.campo.paso > span { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.campo.paso .num { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--orange); color: #fff; }
.campo.paso input { font-size: 16px; padding: 12px 14px; }
.reg-mapa { height: 230px; position: relative; }
.reg-mapa-ayuda { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 3; pointer-events: none; white-space: nowrap;
  background: rgba(13, 11, 10, .85); color: #fff; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow); }
.reg-ubic { font-size: 12.5px; }
/* Registro listo */
.listo-paso { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(16, 185, 129, .08); border: 1px solid rgba(16, 185, 129, .35); }
.listo-paso strong { font-size: 15px; }
.listo-paso p { font-size: 13.5px; color: #d6cfc7; line-height: 1.45; }
.ejemplo-wrap { display: grid; gap: 8px; padding: 10px; border-radius: 18px; border: 1px dashed var(--line); background: rgba(255, 255, 255, .02); }
.card.ejemplo { pointer-events: none; }
.card.ejemplo .card-foto { height: 120px; }
.ejemplo-menu .menu-item { cursor: default; padding: 8px 12px; font-size: 13px; }
.link-ejemplo { text-align: center; color: var(--yellow); font-weight: 700; font-size: 13.5px; text-decoration: none; }
.link-ejemplo:hover { text-decoration: underline; }
#listoReenviar { justify-self: center; background: none; border: 0; color: var(--muted); text-decoration: underline; }

/* Botón Satélite / Calles */
.ctrl-vista button { border: 0; border-radius: 10px; padding: 7px 11px; font: 800 12px/1 system-ui, sans-serif; cursor: pointer;
  background: rgba(13, 11, 10, .85); color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); backdrop-filter: blur(6px); }
.ctrl-vista button:hover { background: rgba(13, 11, 10, .98); }
.modo-dueno { margin: 8px 0 0; font-size: 11px; color: #fcd34d; font-weight: 700; }
