/* ══════════════════════════════════════════════════════════════
   CLUB VICIO — carta pública
   Se abre sin cuenta, desde el QR de la mesa. Tiene que cargar
   rápido con datos móviles y leerse a un brazo de distancia.
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg:        #FAF9F5;
  --surface:   #FFFFFF;
  --surface-2: #F1EFE8;
  --line:      #E3DFD5;
  --line-2:    #C9C3B5;
  --ink:       #131209;
  --ink-2:     #55524A;
  --ink-3:     #8B867A;
  --oro:       #8A6A18;
  --oro-suave: #F7F0DA;
  --sombra:    0 1px 2px rgba(19,18,9,.06), 0 12px 32px -20px rgba(19,18,9,.35);

  --f-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --f-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0B0B0A;
    --surface:   #171614;
    --surface-2: #201E1A;
    --line:      #2E2A24;
    --line-2:    #433D33;
    --ink:       #F6F3EC;
    --ink-2:     #ACA69A;
    --ink-3:     #777166;
    --oro:       #E3C05C;
    --oro-suave: #29220F;
    --sombra:    0 1px 2px rgba(0,0,0,.6), 0 12px 32px -20px rgba(0,0,0,.9);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

img { display: block; max-width: 100%; height: auto; }

/* ── Cabecera ── */
.cabecera {
  text-align: center;
  padding: max(28px, env(safe-area-inset-top)) 20px 18px;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.sello { width: 72px; height: 72px; object-fit: contain; }

.cabecera h1 {
  font-family: var(--f-display);
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1;
}

.lema { font-size: 13.5px; color: var(--ink-3); }

/* ── Índice de categorías, pegajoso ── */
.indice {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.indice::-webkit-scrollbar { display: none; }
.indice:empty { display: none; }

.indice a {
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
}
.indice a:hover, .indice a:focus-visible { color: var(--ink); border-color: var(--line-2); }

/* ── Contenido ── */
.contenido { max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; }

.categoria { padding-top: 26px; scroll-margin-top: 66px; }

.categoria h2 {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--ink);
}

.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
}

/* ── Ficha de producto ── */
.plato {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sombra);
}

.plato-foto {
  /* height:auto es imprescindible: sin él, los atributos width/height de la
     etiqueta mandan y la foto se estira a 900 px de alto. */
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface-2);
}

/* Sin foto, la ficha no se ve rota: se ve como una ficha de texto */
.plato-sinfoto {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: var(--oro-suave);
}
.plato-sinfoto img { width: 40%; opacity: .35; }

.plato-cuerpo {
  padding: 11px 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.plato-nombre {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.plato-desc {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
}

.plato-pie {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.plato-precio {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 15px;
}

.plato-puntos {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--oro);
  background: var(--oro-suave);
  border-radius: 5px;
  padding: 3px 7px;
  white-space: nowrap;
}

/* ── Esqueleto mientras carga ── */
.cargando-carta { display: grid; gap: 14px; padding-top: 26px; }
.hueso {
  height: 108px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 400% 100%;
  animation: latir 1.4s ease-in-out infinite;
}
@keyframes latir { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
  .hueso { animation: none; }
  html { scroll-behavior: auto; }
}

/* ── Avisos ── */
.aviso-carta {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface-2);
  border-left: 3px solid var(--line-2);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  font-size: 14.5px;
  color: var(--ink-2);
}

/* ── Pie con el enganche al Club ── */
.pie-carta {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px calc(36px + env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
}

.promo-club {
  background: var(--oro-suave);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 18px;
  display: grid;
  gap: 7px;
  text-align: center;
}

.promo-titulo {
  font-family: var(--f-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.promo-texto { font-size: 14px; line-height: 1.5; color: var(--ink-2); }

.boton-carta {
  display: block;
  margin-top: 6px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-radius: 12px;
  padding: 14px 18px;
}
.boton-carta:active { transform: scale(.985); }

.pie-nota { font-size: 12.5px; color: var(--ink-2); text-align: center; line-height: 1.5; }
.pie-nota.tenue { color: var(--ink-3); font-size: 11.5px; }
