:root {
  --bg: #faf6f2; --surface: #fff; --text: #2b1d16; --muted: #7a6659; --accent: #b4532a; --on-accent: #fff; --soft: #f6e8de; --line: #eee2d8;
  --font-head: 'Fraunces', Georgia, serif; --font-body: 'Inter', system-ui, sans-serif;
  --r: 16px; --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-padding-top: 120px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
#app { max-width: 720px; margin: 0 auto; min-height: 100dvh; background: var(--bg); }

/* ---------- hero ---------- */
.hero { position: relative; height: clamp(170px, 42vw, 260px); overflow: hidden; background: var(--soft); }
.hero.plain { height: 96px; }
.hero .cover { width: 100%; height: 100%; object-fit: cover; display: block; animation: zoom 1.2s var(--ease) both; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgb(0 0 0 / .18), transparent 40%, transparent 60%, rgb(0 0 0 / .12)); }
.langs { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 2; display: flex; padding: 3px; border-radius: 99px; background: rgb(255 255 255 / .85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgb(0 0 0 / .1); }
.langs button { height: 28px; min-width: 36px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #555; }
.langs button.on { background: #1d1d1d; color: #fff; }

.intro { position: relative; padding: 0 18px 6px; text-align: center; animation: rise .5s var(--ease) both; }
.logo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; margin: -40px auto 8px; display: block; border: 4px solid var(--bg); background: var(--surface); box-shadow: 0 6px 18px rgb(0 0 0 / .12); position: relative; z-index: 1; }
.logo.mono { display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-family: var(--font-head); font-size: 34px; font-weight: 700; }
.intro h1 { font-family: var(--font-head); font-size: clamp(28px, 7.5vw, 38px); line-height: 1.08; margin: 4px 0 4px; letter-spacing: -.01em; }
.tagline { margin: 0; color: var(--muted); font-size: 15px; }
.chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 14px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--text); max-width: 100%; transition: border-color .2s, transform .2s; }
.chip:active { transform: scale(.97); }
.chip svg { width: 14px; height: 14px; color: var(--accent); }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

/* ---------- sticky tools ---------- */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 10px 0 6px; border-bottom: 1px solid var(--line); }
.tools { display: flex; gap: 8px; padding: 0 16px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: var(--text); font-size: 15px; }
.filter { position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.filter.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.filter b { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--text); color: var(--bg); font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 2px; scrollbar-width: none; scroll-behavior: smooth; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background .25s, color .25s; }
.cats button.on { background: var(--text); color: var(--bg); }

.avoid-note { margin: 12px 16px 0; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 13px; color: var(--text); }
.avoid-note button { color: var(--accent); font-weight: 700; margin-inline-start: 4px; text-decoration: underline; }

/* ---------- featured ---------- */
.featured { padding: 18px 0 0; }
.featured h2, .sec h2 { font-family: var(--font-head); font-size: 22px; margin: 0 16px 10px; letter-spacing: -.005em; }
.f-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.f-row::-webkit-scrollbar { display: none; }
.f-card { flex: none; width: 62%; max-width: 250px; scroll-snap-align: start; text-align: start; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .2s; }
.f-card:active { transform: scale(.98); }
.f-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--soft); }
.f-card span { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px 12px; }
.f-card b { font-size: 14.5px; line-height: 1.25; }
.f-card i { font-style: normal; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ---------- list ---------- */
.sec { padding-top: 22px; scroll-margin-top: 110px; }
.dish { position: relative; display: flex; gap: 14px; margin: 0 16px 10px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, opacity .45s var(--ease); }
.dish:active { transform: scale(.985); }
.dish:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.d-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish h3 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.25; }
.dish p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d-meta { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; }
.price { color: var(--accent); font-weight: 700; font-size: 15.5px; white-space: nowrap; }
.alg { display: flex; gap: 2px; font-size: 13px; filter: saturate(.85); }
.alg i { font-style: normal; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--soft); color: var(--text); }
.tag.t-recomendado { background: var(--accent); color: var(--on-accent); }
.d-img { position: relative; width: 112px; height: 112px; flex: none; }
.d-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; background: var(--soft); }
.add { position: absolute; right: -6px; bottom: -6px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent); box-shadow: 0 4px 14px rgb(0 0 0 / .15); font-weight: 800; transition: transform .2s var(--ease), background .2s; }
.add:active { transform: scale(.9); }
.add.has { background: var(--accent); color: var(--on-accent); }
.add.solo { position: static; align-self: center; border: 1px solid var(--line); box-shadow: none; }
.dish.off { opacity: .55; }
.dish.off .price { color: var(--muted); }
.nothing { text-align: center; color: var(--muted); padding: 40px 16px; }

/* reveal on scroll */
.dish, .sec h2 { opacity: 0; transform: translateY(10px); }
.dish.in, .sec h2.in { opacity: 1; transform: none; transition: opacity .45s var(--ease), transform .45s var(--ease); }
.dish.off.in { opacity: .55; }

.foot { padding: 30px 20px calc(110px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 12.5px; }
.foot p { margin: 0 0 12px; }
.foot a b { color: var(--text); }

/* ---------- order bar ---------- */
.order-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); animation: up .35s var(--ease) both; }
.order-bar button { width: min(692px, 100%); margin: 0 auto; height: 54px; border-radius: 16px; background: var(--text); color: var(--bg); display: flex; align-items: center; gap: 10px; padding: 0 18px; box-shadow: 0 12px 30px rgb(0 0 0 / .25); font-weight: 600; }
.order-bar span { flex: 1; text-align: start; }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgb(15 10 8 / .45); animation: fade .25s both; }
.sheet { position: relative; width: min(600px, 100%); max-height: 90dvh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; animation: up .32s var(--ease) both; padding-bottom: env(safe-area-inset-bottom); }
.sheet-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .92); color: #222; box-shadow: 0 2px 10px rgb(0 0 0 / .12); }
.s-img { width: 100%; aspect-ratio: 4 / 3; max-height: 46dvh; object-fit: cover; display: block; background: var(--soft); }
.s-body { padding: 20px 20px 24px; }
.s-body h2 { font-family: var(--font-head); font-size: 24px; margin: 0 40px 6px 0; line-height: 1.15; }
.s-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.s-head h2 { margin-right: 0; }
.dish-sheet .s-head .price { font-size: 19px; padding-top: 4px; }
.s-desc { color: var(--muted); margin: 6px 0 0; }
.s-body h4 { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.alg-list { display: flex; flex-wrap: wrap; gap: 6px; }
.alg-list span { padding: 6px 10px; border-radius: 99px; background: var(--soft); font-size: 13px; }
.muted { color: var(--muted); }
.s-order { display: flex; gap: 10px; margin-top: 20px; }
.stepper { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 14px; background: var(--soft); }
.stepper button { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); }
.stepper b { min-width: 24px; text-align: center; }
.stepper.sm button { width: 30px; height: 30px; }
.btn-main { flex: 1; height: 48px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 700; transition: transform .15s; }
.btn-main:active, .btn-wa:active { transform: scale(.98); }
.btn-ghost { height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); font-weight: 600; }
.btn-wa { width: 100%; height: 52px; margin-top: 16px; border-radius: 14px; background: #25d366; color: #063d1d; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.avoid-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.avoid-grid button { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); text-align: start; font-size: 14px; transition: background .2s, border-color .2s; }
.avoid-grid button.on { background: var(--soft); border-color: var(--accent); font-weight: 700; }
.s-actions { display: flex; gap: 10px; margin-top: 18px; }
.o-lines { margin-top: 12px; }
.o-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.o-line > span { flex: 1; min-width: 0; }
.o-total { display: flex; justify-content: space-between; padding: 14px 0 6px; font-size: 17px; }
.fld { display: grid; gap: 6px; margin-top: 12px; }
.fld span { font-size: 13px; color: var(--muted); }
.fld input { height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; font: inherit; color: var(--text); outline: none; }
.fld input:focus { border-color: var(--accent); }
.info { display: grid; gap: 6px; margin-top: 12px; }
.info > * { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--soft); }
.info svg { color: var(--accent); }
.info small { display: block; color: var(--muted); font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: 0 10px 26px rgb(0 0 0 / .2); animation: pop .25s var(--ease) both; max-width: 90vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.missing { min-height: 100dvh; display: grid; place-content: center; text-align: center; gap: 10px; padding: 24px; color: var(--muted); }
.missing a { color: var(--accent); font-weight: 700; }

.no-photos .featured { display: none; }

/* ---------- menu structures (body.lay-*) ---------- */
/* tarjetas: large photo above each dish */
.lay-tarjetas .dish:not(.nophoto) { flex-direction: column; gap: 0; padding: 0; overflow: hidden; margin-bottom: 16px; }
.lay-tarjetas .dish:not(.nophoto) .d-img { order: -1; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.lay-tarjetas .d-img img { border-radius: 0; }
.lay-tarjetas .dish:not(.nophoto) .d-txt { padding: 14px 16px 16px; }
.lay-tarjetas .dish h3 { font-family: var(--font-head); font-size: 19px; }
.lay-tarjetas .dish p { -webkit-line-clamp: 3; }
.lay-tarjetas .d-img .add { right: 12px; bottom: 12px; width: 42px; height: 42px; }

/* cuadricula: two dishes per row */
.lay-cuadricula .sec { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-inline: 16px; }
.lay-cuadricula .sec h2 { grid-column: 1 / -1; margin: 0 0 2px; }
.lay-cuadricula .dish { margin: 0; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.lay-cuadricula .d-img { order: -1; width: 100%; height: auto; aspect-ratio: 1; }
.lay-cuadricula .d-img img { border-radius: 0; }
.lay-cuadricula .d-txt { flex: 1; padding: 10px 12px 12px; }
.lay-cuadricula .dish h3 { font-size: 14.5px; }
.lay-cuadricula .dish p, .lay-cuadricula .tags { display: none; }
.lay-cuadricula .dish.nophoto p { display: -webkit-box; }
.lay-cuadricula .d-meta { padding-top: 6px; }
.lay-cuadricula .alg { font-size: 11px; }
.lay-cuadricula .d-img .add { right: 8px; bottom: 8px; }
.lay-cuadricula .add.solo { margin: 0 12px 12px; align-self: flex-start; }
@media (min-width: 600px) { .lay-cuadricula .sec { grid-template-columns: repeat(3, 1fr); } }

/* revista: full-width photos with the text on top */
.lay-revista .dish:not(.nophoto) { padding: 0; overflow: hidden; min-height: 220px; border: 0; align-items: flex-end; color: #fff; margin-bottom: 12px; }
.lay-revista .dish:not(.nophoto) .d-img { position: absolute; inset: 0; width: auto; height: auto; }
.lay-revista .dish:not(.nophoto) .d-img img { border-radius: 0; }
.lay-revista .dish:not(.nophoto) .d-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .86), rgb(0 0 0 / .35) 55%, rgb(0 0 0 / .05)); pointer-events: none; }
.lay-revista .dish:not(.nophoto) .d-txt { position: relative; z-index: 1; padding: 18px 64px 16px 16px; pointer-events: none; }
.lay-revista .dish:not(.nophoto) h3 { font-family: var(--font-head); font-size: 22px; }
.lay-revista .dish:not(.nophoto) p { color: rgb(255 255 255 / .85); }
.lay-revista .dish:not(.nophoto) .price { color: #fff; font-size: 17px; }
.lay-revista .dish:not(.nophoto) .tag { background: rgb(255 255 255 / .2); color: #fff; }
.lay-revista .d-img .add { z-index: 2; right: 14px; bottom: 14px; width: 42px; height: 42px; }

/* clasica: printed-menu style, no photos in the list */
.lay-clasica .featured { display: none; }
.lay-clasica .sec h2 { text-align: center; font-size: 25px; margin: 10px 16px 12px; }
.lay-clasica .sec h2::after { content: ''; display: block; width: 36px; height: 2px; margin: 10px auto 0; background: var(--accent); }
.lay-clasica .dish { display: block; margin: 0 22px; padding: 11px 2px; background: none; border: 0; border-radius: 0; }
.d-line { display: flex; align-items: baseline; gap: 8px; }
.d-line h3 { font-family: var(--font-head); font-size: 17px; }
.dots { flex: 1; min-width: 16px; border-bottom: 1.5px dotted color-mix(in srgb, var(--muted) 55%, transparent); transform: translateY(-4px); }
.lay-clasica .dish p { -webkit-line-clamp: 3; font-size: 13.5px; }
.lay-clasica .alg { margin-top: 4px; }
.lay-clasica .add.solo { width: 28px; height: 28px; align-self: center; }
.lay-clasica .add.solo svg { width: 14px; height: 14px; }

/* compacta: dense rows for long menus */
.lay-compacta .featured { display: none; }
.lay-compacta .sec { padding-top: 18px; }
.lay-compacta .sec h2 { font-size: 19px; margin-bottom: 2px; }
.lay-compacta .dish { margin: 0 16px; padding: 10px 0; gap: 12px; align-items: center; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.lay-compacta .d-img { order: -1; width: 54px; height: 54px; }
.lay-compacta .d-img img { border-radius: 12px; }
.lay-compacta .dish h3 { font-size: 15px; }
.lay-compacta .dish p { -webkit-line-clamp: 1; font-size: 12.5px; margin-top: 2px; }
.lay-compacta .d-meta { padding-top: 4px; }
.lay-compacta .tags { display: none; }
.lay-compacta .d-img .add { right: -5px; bottom: -5px; width: 26px; height: 26px; }
.lay-compacta .add svg { width: 14px; height: 14px; }

/* pestanas: one category at a time */
.lay-pestanas .bar { padding-bottom: 0; }
.lay-pestanas .cats { gap: 2px; padding: 8px 10px 0; }
.lay-pestanas .cats button { height: 42px; border-radius: 0; background: none !important; color: var(--muted); border-bottom: 2.5px solid transparent; }
.lay-pestanas .cats button.on { color: var(--text); border-bottom-color: var(--accent); }
.lay-pestanas #list { min-height: 70dvh; }
.sec.solo h2 { display: none; }
.sec.solo { padding-top: 14px; animation: rise .35s var(--ease) both; }

/* acordeon: collapsible categories */
.lay-acordeon .cats { display: none; }
.lay-acordeon .bar { padding-bottom: 10px; }
.acc { margin: 10px 16px 0; padding-top: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.acc-h { width: 100%; display: flex; align-items: center; gap: 10px; padding: 17px 16px; text-align: start; }
.acc-h span { flex: 1; font-family: var(--font-head); font-size: 19px; font-weight: 700; }
.acc-h small { color: var(--muted); font-size: 12.5px; }
.acc-h svg { color: var(--muted); transition: transform .3s var(--ease); }
.acc.open .acc-h svg { transform: rotate(180deg); }
.acc-b { padding: 0 0 4px; animation: rise .3s var(--ease) both; }
.acc .dish { margin: 0 10px 10px; background: var(--bg); }

@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes zoom { from { transform: scale(1.06); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (min-width: 720px) {
  #app { box-shadow: 0 0 0 1px var(--line); }
  .hero { height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .dish, .sec h2 { opacity: 1; transform: none; }
}
