/* Estilos compartidos del menú y el pedido Pai-Wok. Look oscuro fijo, igual al menú impreso. */
:root {
  --bg: #0b0908;
  --surface: #17120f;
  --raised: #221a14;
  --line: #3a2f27;
  --fg: #f4ece0;
  --muted: #b9ab98;
  --accent: #f5c518;
  --accent-ink: #0b0908;
  --red: #d7262b;
  --wa: #25d366;
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --body: "Helvetica Neue", Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-behavior: smooth; overflow-anchor: none; }
body { overflow-anchor: none; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Barra superior */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; gap: 8px; padding: 8px 16px; background: var(--bg); border-bottom: 2px solid var(--red);
}
.bar a {
  flex: 1; text-align: center; font-family: var(--display); font-weight: 500; font-size: .95rem; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none; padding: 10px 12px; border-radius: 4px;
  background: var(--accent); color: var(--accent-ink);
}
.bar a.alt { background: var(--surface); color: var(--fg); }

main { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 16px 16px 120px; }
button { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }

/* Bloque de pedido */
.order { width: 100%; max-width: 760px; background: var(--surface); border-radius: 10px; overflow: hidden; overflow: clip; scroll-margin-top: 70px; }
.order-head { display: flex; flex-direction: column; gap: 10px; padding: 20px 16px; border-top: 4px solid var(--red); }
.eyebrow { font-family: var(--display); font-weight: 500; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.order-head h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.75rem; line-height: 1.1; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); text-wrap: balance; }
.order-head p { margin: 0; line-height: 1.5; color: var(--fg); max-width: 60ch; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 8px; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: .05em; text-transform: uppercase;
  padding: 14px 18px; text-decoration: none; background: var(--accent); color: var(--accent-ink);
}
.btn.ghost { background: transparent; color: var(--fg); border: 2px solid var(--line); }
.btn.wa { background: var(--wa); color: #06210f; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Progreso */
.steps { display: flex; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps button {
  flex: 1 0 auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px 4px;
  font-family: var(--display); font-weight: 500; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 3px solid var(--line); white-space: nowrap;
}
.steps button[aria-current="step"] { color: var(--accent); border-color: var(--accent); }
.steps button.done { color: var(--fg); border-color: #6b5a2a; }
.steps button:disabled { cursor: default; }

.stage { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px 20px; }
.stage h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.4rem; letter-spacing: .03em; text-transform: uppercase; text-wrap: balance; }
.explain { background: var(--bg); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.explain p { margin: 0; line-height: 1.5; font-size: .97rem; max-width: 62ch; }
.explain b { color: var(--accent); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags i { font-style: normal; font-size: .82rem; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--surface); }
.label { font-family: var(--display); font-weight: 500; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opts.one { grid-template-columns: 1fr; }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 440px) { .opts { grid-template-columns: 1fr; } .opts.three { grid-template-columns: 1fr; } }
.opt {
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer; min-width: 0;
  background: var(--bg); color: var(--fg); border: 2px solid var(--line); border-radius: 8px; padding: 12px 14px;
}
.opt b { font-family: var(--display); font-weight: 600; font-size: 1.1rem; letter-spacing: .04em; text-transform: uppercase; }
.opt span { font-size: .85rem; color: var(--muted); line-height: 1.35; }
.opt em { font-style: normal; font-size: .85rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--raised); }
.opt[aria-pressed="true"] span { color: var(--fg); }
.seg { display: flex; gap: 8px; }
.seg .opt { flex: 1; align-items: center; text-align: center; }

.plate { background: var(--bg); border: 2px solid var(--accent); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.plate .what { line-height: 1.45; }
.plate .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.price { font-family: var(--display); font-weight: 600; font-size: 1.9rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 999px; padding: 3px; }
.qty button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--raised); color: var(--fg); font-size: 1.2rem; cursor: pointer; }
.qty output { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

.nav { display: flex; gap: 8px; }
.nav .btn { flex: 1; }

/* Atajos e inicio */
.start-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 440px) { .start-row { grid-template-columns: 1fr; } }
.shortcut { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; cursor: pointer; text-align: left;
  background: transparent; color: var(--fg); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.shortcut b { color: var(--accent); font-family: var(--display); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; font-size: .85rem; flex: none; }
.cat { background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }
.cat-title { padding: 12px 14px 4px; font-family: var(--display); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.cat-note { padding: 0 0 8px; }
.kinds .opt { padding: 14px; }
.cat .items { display: flex; flex-direction: column; padding: 0 14px 10px; }
.item .qty { justify-self: start; }

/* Carrito */
.cart { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.line .t { line-height: 1.35; font-size: .95rem; }
.line .p { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.line .qty { grid-column: 1 / -1; justify-self: start; }
.empty { color: var(--muted); font-size: .95rem; background: var(--bg); border-radius: 8px; padding: 14px; text-align: center; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.total-row span { font-family: var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

details.cat { background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }
details.cat summary { cursor: pointer; padding: 12px 14px; font-family: var(--display); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 8px; list-style: none; }
details.cat summary::-webkit-details-marker { display: none; }
details.cat summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; line-height: 1; }
details.cat[open] summary::after { content: "–"; }
details.cat .items { display: flex; flex-direction: column; padding: 0 14px 10px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.item .n { font-size: .95rem; line-height: 1.3; }
.item .n small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.item .pr { color: var(--accent); font-variant-numeric: tabular-nums; font-size: .9rem; }

/* Formulario */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .9rem; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--fg); background: var(--bg); border: 2px solid var(--line); border-radius: 8px; padding: 12px; width: 100%; box-sizing: border-box;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.err { color: #ff8a80; font-size: .88rem; }
.small { font-size: .85rem; color: var(--muted); line-height: 1.45; margin: 0; }
.msg { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 12px; font-size: .88rem; line-height: 1.45; color: var(--muted); max-height: 220px; overflow: auto; }

/* Carta en imagen */
.sheet { width: 100%; max-width: 760px; display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.sheet img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--surface); }
.sheet:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
.hint { margin: 0; color: var(--muted); font-size: .85rem; text-align: center; }
.section-title { width: 100%; max-width: 760px; margin: 8px 0 -8px; font-family: var(--display); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; font-size: .85rem; color: var(--muted); }

/* Barra fija de pedido */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--raised); border-top: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cartbar .info { line-height: 1.25; min-width: 0; }
.cartbar .info b { display: block; font-family: var(--display); font-size: 1.25rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.cartbar .info span { font-size: .82rem; color: var(--muted); }
.cartbar .btn { padding: 11px 16px; font-size: .95rem; flex: none; }

/* Visor ampliado */
.viewer { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.94); overflow: auto; -webkit-overflow-scrolling: touch; }
.viewer img { display: block; width: 100%; max-width: none; cursor: zoom-in; margin: 0 auto; }
.viewer.zoom img { width: 230%; cursor: zoom-out; margin: 0; }
.close {
  position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 11;
  font-family: var(--display); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px; padding: 9px 16px; cursor: pointer;
}
@media (min-width: 900px) { .viewer.zoom img { width: 160%; } .viewer:not(.zoom) img { width: min(100%, 900px); } }

/* Pedido unificado */
.cats-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.cats-pick .opt { align-items: center; text-align: center; padding: 12px 10px; }
.cats-pick .opt b { font-size: .98rem; }
.people .opt { align-items: center; text-align: center; padding: 16px 10px; }
.people .opt b { font-size: 1.25rem; }
.ctx { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.ctx b { color: var(--fg); }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px 0; font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.flash { background: #12301d; border: 1px solid #2f7a4a; color: #c9f2d6; border-radius: 8px; padding: 10px 12px; font-size: .92rem; line-height: 1.4; }
.badge { display: inline-block; font-family: var(--display); font-weight: 500; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; }
.sub-step { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.sheet.wide { max-width: 480px; }
.item.big .n b { font-family: var(--display); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 1.02rem; }

/* Confirmación al agregar */
.done-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; background: #12301d; border: 1px solid #2f7a4a; border-radius: 10px; padding: 22px 16px; }
.done-check { width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #06210f; font-size: 2rem; font-weight: 700; display: grid; place-items: center; }
.done-box h2 { color: #c9f2d6; }
.done-item { margin: 0; line-height: 1.45; }
.done-sum { margin: 0; color: var(--muted); }
.done-sum b { color: var(--accent); }
.done-q { margin: 4px 0 0; text-align: center; font-family: var(--display); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; font-size: 1.05rem; }
.done-actions { display: flex; flex-direction: column; gap: 10px; }

/* Fases del arroz */
.phase { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.phase.open { border: 2px solid var(--accent); }
.phase.future { opacity: .45; }
.phase-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
.phase-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; font-size: .95rem; min-width: 0; }
.phase-title b { color: var(--accent); font-weight: 600; }
.phase-n { font-style: normal; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; background: var(--raised); color: var(--fg); }
.phase.open .phase-n { background: var(--accent); color: var(--accent-ink); }
.phase.done .phase-n { background: var(--wa); color: #06210f; }
.phase-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
/* Desplegables de extras */
.fold-header { font-family: var(--display); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-top: 4px; }
details.fold summary { align-items: center; }
details.fold summary span:first-child { flex: 1; }
details.fold summary .badge { margin-left: 0; }
.cat-compact { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.order-head .where { color: var(--muted); font-size: .9rem; }
.tagline { margin: 0 0 6px; font-style: italic; color: var(--accent); font-size: .95rem; }

/* Animaciones entre fases */
.phase { transition: border-color .35s ease, opacity .3s ease; }
.masking { overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); }
.phase-body.leaving { opacity: 0; filter: blur(8px); transform: translateY(-6px); padding-bottom: 0; transition: opacity .34s ease, filter .34s ease, transform .46s ease, padding .46s ease; }
.reveal { display: flex; flex-direction: column; gap: 10px; }
.opt.ghost { border-color: transparent !important; background: transparent !important; box-shadow: none; transform-origin: 0 0; will-change: transform, filter, opacity; }
.phase.open.closing { border-color: var(--line); }
.phase.just-done .phase-n { animation: toCheck .5s cubic-bezier(.2,.9,.3,1.3) both; }
.phase.just-done .phase-title b { animation: doneIn .45s ease .3s both; }
.phase.just-done .phase-title { animation: doneIn .35s ease .1s both; }
@keyframes doneIn { from { opacity: 0; filter: blur(5px); } to { opacity: 1; filter: blur(0); } }
@keyframes toCheck { 0% { transform: rotate(-180deg) scale(.3); background: var(--accent); color: var(--accent-ink); } 60% { background: var(--wa); } 100% { transform: rotate(0) scale(1); background: var(--wa); } }
.opt { transition: border-color .15s ease, background-color .15s ease, transform .12s ease; }
.opt:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .phase, .opt, .phase-body.leaving { transition: none; } .phase.just-done .phase-title, .phase.just-done .phase-title b, .phase.just-done .phase-n { animation: none; } }
button, .opt, a { -webkit-tap-highlight-color: transparent; }
.more-box { display: flex; flex-direction: column; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 6px; }
.more-box .done-sum { margin: 0; text-align: center; color: var(--muted); }
.opt em .combo { font-style: normal; color: var(--fg); }
.opt em .pp { font-style: normal; white-space: nowrap; }
.yield { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; display: grid; gap: 4px; font-size: .9rem; }
.yield-t { color: var(--muted); margin-bottom: 2px; }
.yield-r { display: grid; grid-template-columns: 5.5em 1.4em 1fr; align-items: baseline; }
.yield-r span { color: var(--fg); }
.yield-r i { font-style: normal; color: var(--muted); }
.yield-r b { color: var(--accent); font-weight: 600; }
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; width: 100%; max-width: 760px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); text-align: center; }
.legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
