/* Menú público — paleta y tipografía de la marca */
:root {
  --carbon: #242021;     /* fondo */
  --pizarra: #3E4449;    /* superficies y líneas */
  --pizarra-2: #2E2A2B;  /* superficie elevada */
  --arroz: #F3F1EE;      /* texto principal */
  --humo: #A9A3A1;       /* texto secundario */
  --gari: #F2A7A0;       /* acento: precios y estado activo */
  --radius: 14px;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --text: "Mulish", system-ui, sans-serif;
  --pad: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--carbon); color: var(--arroz);
  font: 400 16px/1.5 var(--text); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gari); outline-offset: 3px; border-radius: 6px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--arroz); color: var(--carbon); padding: 8px 12px; border-radius: 8px; }

/* ---------- Encabezado ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px var(--pad) 14px; max-width: 1240px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.brand-name {
  margin: 0; font: 900 clamp(34px, 7vw, 56px)/.9 var(--display); letter-spacing: .01em;
}
.brand-tag { margin: 4px 0 0; color: var(--humo); font-size: 14px; }
.brand-logo { margin: 0; line-height: 0; }
.brand-logo img {
  display: block; width: auto; height: clamp(60px, 9vw, 88px); max-width: min(78vw, 460px);
  object-fit: contain; object-position: left center;
}
.has-logo .brand-tag { margin-top: 8px; }

.search {
  position: relative; flex: 1 1 260px; max-width: 380px; display: block;
}
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--humo); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; height: 46px; padding: 0 16px 0 42px; border-radius: 999px;
  border: 1px solid var(--pizarra); background: var(--pizarra-2); color: var(--arroz);
  font: 500 15px var(--text);
}
.search input::placeholder { color: var(--humo); }
.search input:focus { outline: none; border-color: var(--gari); }

/* ---------- Navegación de categorías ---------- */
.cats {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--carbon) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pizarra);
}
.cats-track {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 10px var(--pad); max-width: 1240px; margin: 0 auto;
}
.cats-track::-webkit-scrollbar { display: none; }
.cats a {
  flex: none; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 14px; color: var(--humo); white-space: nowrap;
  transition: background .2s, color .2s;
}
.cats a:hover { color: var(--arroz); }
.cats a.on { background: var(--gari); color: var(--on-gari, var(--carbon)); }
.cats a.hide { display: none; }

/* ---------- Categorías ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 8px var(--pad) 40px; }
.cat { padding-top: 28px; }
.cat[hidden] { display: none; }
.cat-head { position: relative; margin: 0 0 6px; }
.cat-head.has-img { margin-bottom: 12px; }
.cat-img {
  width: 100%; height: clamp(150px, 26vw, 260px); object-fit: cover; border-radius: var(--radius);
  filter: saturate(1.05);
}
.cat-head.has-img::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(180deg, transparent 35%, rgba(36, 32, 33, .92));
}
.cat-head h2 {
  margin: 0; font: 900 clamp(44px, 9vw, 92px)/.86 var(--display); letter-spacing: .005em;
}
.cat-head.has-img h2 {
  position: absolute; left: clamp(14px, 2.5vw, 28px); bottom: clamp(10px, 2vw, 22px); z-index: 1;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.cat-desc { margin: 0 0 14px; color: var(--humo); max-width: 62ch; }

/* Durante una búsqueda: sin portada ni descripción, solo el nombre de la categoría */
.searching .cat { padding-top: 18px; }
.searching .cat-img, .searching .cat-desc, .searching .cat-head.has-img::after { display: none; }
.searching .cat-head, .searching .cat-head.has-img { margin: 0 0 4px; }
.searching .cat-head h2, .searching .cat-head.has-img h2 {
  position: static; text-shadow: none; font-size: clamp(22px, 3.4vw, 30px); line-height: 1; color: var(--humo);
}

/* ---------- Lista de platillos ---------- */
.dishes {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; column-gap: 40px;
}
@media (min-width: 900px) { .dishes { grid-template-columns: 1fr 1fr; } }
.dish { border-bottom: 1px solid var(--pizarra); }
.dish[hidden] { display: none; }
.dish > button {
  width: 100%; display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: start;
  padding: 14px 0; background: none; border: 0; text-align: left; cursor: pointer;
}
.dish.no-img > button { grid-template-columns: 1fr auto; padding: 12px 0; }
.dish img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: var(--pizarra); }
.d-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.d-name { font-weight: 800; font-size: 17px; line-height: 1.25; }
.d-desc {
  color: var(--humo); font-size: 14px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.d-price { font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.d-price small { display: block; font-weight: 500; font-size: 12px; color: var(--humo); }
.d-tag { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--humo); color: var(--humo); }
.dish.off .d-name, .dish.off img { opacity: .5; }
.dish.off .d-price { color: var(--humo); }
.dish > button:hover .d-name { color: var(--gari); }

.empty { text-align: center; color: var(--humo); padding: 60px 0; }

/* ---------- Pie ---------- */
.foot { border-top: 1px solid var(--pizarra); padding: 32px var(--pad) 48px; text-align: center; color: var(--humo); font-size: 14px; }
.foot-name { font: 900 34px/1 var(--display); color: var(--arroz); margin: 0 0 12px; }
.foot-info { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.foot-links { display: flex; justify-content: center; gap: 18px; margin: 0 0 12px; }
.foot-links a { color: var(--arroz); font-weight: 700; text-underline-offset: 4px; }
.foot-note { margin: 0; font-size: 13px; }

/* ---------- Pop-up del platillo ---------- */
dialog {
  border: 0; padding: 0; background: transparent; color: var(--arroz);
  max-width: none; max-height: none; width: 100%; height: 100%; margin: 0;
}
dialog::backdrop { background: rgba(10, 8, 9, .72); backdrop-filter: blur(4px); }
.dlg {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--pizarra-2); border-radius: 22px 22px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}
dialog[open] .dlg { animation: up .32s cubic-bezier(.2, .8, .2, 1); }
dialog.closing .dlg { animation: down .2s ease-in forwards; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes down { to { transform: translateY(40px); opacity: 0; } }

.dlg-close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(36, 32, 33, .78); display: grid; place-items: center; cursor: pointer;
}
.dlg-close svg { width: 20px; height: 20px; stroke: var(--arroz); stroke-width: 2.2; stroke-linecap: round; fill: none; }

.gallery { position: relative; background: var(--carbon); }
.gallery.empty-g { display: none; }
.g-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; }
.g-track::-webkit-scrollbar { display: none; }
.g-track img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.g-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(36, 32, 33, .7); display: none; place-items: center; cursor: pointer;
}
.g-nav svg { width: 20px; height: 20px; fill: none; stroke: var(--arroz); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.g-nav.prev { left: 12px; } .g-nav.next { right: 12px; }
.g-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; }
.g-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(243, 241, 238, .45); transition: background .2s, width .2s; }
.g-dots span.on { background: var(--arroz); width: 18px; border-radius: 4px; }

.info { padding: 22px clamp(20px, 4vw, 36px) 28px; }
.i-cat { margin: 0 0 6px; color: var(--humo); font-size: 14px; font-weight: 700; }
.i-name { margin: 0; font: 900 clamp(40px, 8vw, 60px)/.9 var(--display); padding-right: 36px; }
.i-price { margin: 10px 0 0; font-size: 22px; font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.i-price small { font-size: 14px; font-weight: 500; color: var(--humo); }
.i-off { display: inline-block; margin: 10px 0 0; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--humo); color: var(--humo); }
.i-intro { margin: 16px 0 0; line-height: 1.55; }
.i-intro:empty { display: none; }
.i-sections { margin: 18px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; }
.i-sections:empty { display: none; }
.i-sections dt { font-weight: 800; color: var(--humo); font-size: 14px; padding-top: 1px; }
.i-sections dd { margin: 0; line-height: 1.5; }
.i-variants { margin-top: 22px; }
.i-variants[hidden] { display: none; }
.i-variants h3 { margin: 0 0 6px; font-size: 14px; color: var(--humo); }
.i-variants ul { list-style: none; margin: 0; padding: 0; }
.i-variants li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--pizarra); }
.i-variants li b { color: #FFFFFF; font-variant-numeric: tabular-nums; }
.i-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.btn-wa {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px;
  font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer;
}
.btn-wa { background: var(--gari); color: var(--on-gari, var(--carbon)); border: 0; }
.btn-wa svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

@media (min-width: 860px) {
  .dlg {
    left: 50%; top: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%);
    width: min(980px, 92vw); max-height: 88vh; border-radius: 22px;
    display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden;
  }
  dialog[open] .dlg { animation: pop .28s cubic-bezier(.2, .8, .2, 1); }
  dialog.closing .dlg { animation: unpop .18s ease-in forwards; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
  @keyframes unpop { to { opacity: 0; transform: translate(-50%, -46%); } }
  .dlg.no-gallery { grid-template-columns: 1fr; width: min(620px, 92vw); }
  .gallery, .g-track { height: 100%; }
  .g-track { aspect-ratio: auto; min-height: 520px; }
  .g-nav { display: grid; }
  .gallery.single .g-nav, .gallery.single .g-dots { display: none; }
  .info { overflow-y: auto; max-height: 88vh; padding: 40px 36px 32px; }
}

/* ---------- Recomendados ---------- */
.recs .cat-head h2 { font-size: clamp(40px, 7vw, 64px); }
.rec-track {
  list-style: none; margin: 10px calc(var(--pad) * -1) 0; padding: 0 var(--pad) 6px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); scrollbar-width: none;
}
.rec-track::-webkit-scrollbar { display: none; }
.rec { scroll-snap-align: start; }
.rec > button {
  width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none;
  text-align: left; cursor: pointer;
}
.rec img, .rec-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--pizarra); margin-bottom: 6px; }
.rec-name { font-weight: 800; font-size: 16px; line-height: 1.25; }
.rec-price { font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.rec-price small { font-weight: 600; font-size: 12px; color: var(--humo); }
.rec > button:hover .rec-name { color: var(--gari); }
.rec.off img { opacity: .5; }

/* ---------- Etiquetas ---------- */
.d-tags, .i-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.d-tags { margin-top: 4px; }
.d-tags .d-tag { margin-top: 0; }
.i-tags { margin: 12px 0 0; }
.i-tags:empty { display: none; }
.chip {
  font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; line-height: 1.5;
  background: var(--pizarra); color: var(--arroz);
}
.chip.t-recomendado { background: var(--gari); color: var(--on-gari, var(--carbon)); }
.chip.t-picante { background: #5A2A26; color: #FFB4A8; }
.chip.t-vegetariano { background: #2D3D2A; color: #B9DDA9; }
.d-price .from { display: block; font-weight: 600; font-size: 11px; color: var(--humo); }

/* ---------- Página no encontrada ---------- */
.nf { max-width: 640px; margin: 0 auto; padding: 16vh var(--pad) 40px; }
.nf .brand-name { font-size: clamp(48px, 10vw, 84px); margin: 6px 0 14px; }
.nf .btn-wa { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  dialog[open] .dlg, dialog.closing .dlg { animation: none !important; }
}
