@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('assets/fonts/public-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('assets/fonts/public-sans-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('assets/fonts/public-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --carbon: #17140F;
  --carbon-2: #211D17;
  --carbon-3: #2B261E;
  --cream: #F5EFE4;
  --cream-dim: #DCD4C3;
  --amber: #C97D3C;
  --amber-light: #E3A468;
  --taupe: #8A8072;
  --sage: #6B8F71;
  --line: rgba(245, 239, 228, 0.12);
  --line-strong: rgba(245, 239, 228, 0.22);
  --shadow: 0 18px 40px rgba(0,0,0,0.35);
  --serif: 'Fraunces', 'Iowan Old Style', serif;
  --sans: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--carbon);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: var(--sans); }
::selection { background: var(--amber); color: var(--carbon); }

.screen {
  display: none;
  min-height: 100vh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  animation: fade-in .38s ease both;
}
.screen.active { display: flex; flex-direction: column; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

/* ---------- Bienvenida ---------- */
#screen-welcome {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px 28px;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(201,125,60,0.16), transparent 60%),
    var(--carbon);
}
.welcome-mark {
  width: 64px; height: 64px;
  border: 1px solid var(--amber);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}
.welcome-mark svg { width: 26px; height: 26px; }
.welcome-eyebrow {
  font-size: 13px; color: var(--taupe); letter-spacing: 0.02em;
  margin-bottom: 10px;
}
#screen-welcome h1 { font-size: 42px; line-height: 1.05; margin-bottom: 14px; }
#screen-welcome .sub { color: var(--cream-dim); font-size: 16px; line-height: 1.6; max-width: 340px; margin-bottom: 40px; }
.table-chip {
  font-size: 13px; color: var(--amber-light);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 34px;
  letter-spacing: 0.01em;
}
.btn-primary {
  appearance: none; border: none; cursor: pointer;
  background: var(--amber); color: var(--carbon);
  font-size: 16px; font-weight: 600;
  padding: 16px 30px;
  border-radius: 999px;
  width: 100%; max-width: 320px;
  transition: transform .15s ease, background .15s ease;
}
.btn-primary:active { transform: scale(0.97); background: var(--amber-light); }
.btn-ghost {
  appearance: none; cursor: pointer;
  background: transparent; color: var(--cream-dim);
  border: 1px solid var(--line-strong);
  font-size: 15px; font-weight: 500;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform .15s ease, border-color .15s ease;
}
.btn-ghost:active { transform: scale(0.97); border-color: var(--amber); }

/* ---------- Header comun ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 10px;
}
.brand-mark {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 18px; color: var(--cream);
  user-select: none;
}
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--amber);
  flex: none;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--carbon-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--cream); position: relative;
}
.icon-btn svg { width: 18px; height: 18px; }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--amber); color: var(--carbon);
  font-size: 11px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.cart-count.show { display: flex; }

/* ---------- Menu ---------- */
#screen-menu { padding-bottom: 100px; }
.menu-head { padding: 6px 20px 18px; }
.menu-head h1 { font-size: 30px; }
.menu-head .sub { color: var(--taupe); font-size: 14px; margin-top: 6px; }
.menu-list { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }

.dish-card {
  background: var(--carbon-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex; gap: 14px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.dish-card:active { transform: scale(0.985); border-color: var(--line-strong); }
.dish-illustration {
  width: 92px; height: 92px; flex: none;
  border-radius: var(--radius-md);
  background: var(--carbon-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--amber-light);
}
.dish-illustration svg { width: 58px; height: 58px; }
.dish-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-info h3 { font-size: 17px; line-height: 1.25; }
.dish-info .desc {
  color: var(--taupe); font-size: 13px; line-height: 1.5; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dish-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.dish-price { font-family: var(--serif); font-size: 16px; color: var(--cream); }
.ar-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--amber-light);
  border: 1px solid rgba(201,125,60,0.4);
  border-radius: 999px; padding: 6px 11px;
}
.ar-pill svg { width: 13px; height: 13px; }

/* ---------- Sheet (detalle) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(10,9,6,0.6);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  z-index: 40;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: 560px;
  max-height: 92vh;
  background: var(--carbon);
  border-radius: 26px 26px 0 0;
  border-top: 1px solid var(--line-strong);
  z-index: 41;
  transition: transform .32s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sheet.show { transform: translate(-50%, 0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 12px auto 4px; flex: none; }
.sheet-scroll { overflow-y: auto; padding-bottom: 110px; }

.sheet-hero {
  height: 220px; margin: 10px 20px 0;
  background: var(--carbon-2);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--amber-light);
}
.sheet-hero svg { width: 130px; height: 130px; }
.sheet-body { padding: 18px 22px 0; }
.sheet-body h2 { font-size: 24px; line-height: 1.2; }
.sheet-price { font-family: var(--serif); color: var(--amber-light); font-size: 18px; margin-top: 6px; }
.sheet-desc { color: var(--cream-dim); font-size: 14.5px; line-height: 1.65; margin-top: 12px; }

.ar-launch {
  margin-top: 16px;
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; color: var(--amber-light);
  border: 1px solid rgba(201,125,60,0.45);
  border-radius: 14px; padding: 14px; font-size: 14.5px; font-weight: 600;
  cursor: pointer;
}
.ar-launch svg { width: 17px; height: 17px; }

.section-label { font-size: 12.5px; color: var(--taupe); margin: 22px 0 10px; letter-spacing: 0.01em; }
.modifiers { display: flex; flex-direction: column; gap: 2px; }
.modifier-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; cursor: pointer; border-bottom: 1px solid var(--line);
}
.modifier-row:last-child { border-bottom: none; }
.checkbox {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1px solid var(--line-strong);
  flex: none;
  display: flex; align-items: center; justify-content: center;
}
.checkbox svg { width: 12px; height: 12px; opacity: 0; transition: opacity .1s ease; }
.modifier-row.checked .checkbox { background: var(--amber); border-color: var(--amber); }
.modifier-row.checked .checkbox svg { opacity: 1; }
.modifier-row span { font-size: 14.5px; color: var(--cream); }

.notes-field {
  width: 100%; resize: none; min-height: 64px;
  background: var(--carbon-2); border: 1px solid var(--line);
  border-radius: 14px; color: var(--cream); font-family: var(--sans);
  font-size: 14px; padding: 12px 14px; margin-top: 2px;
}
.notes-field::placeholder { color: var(--taupe); }
.notes-field:focus { outline: none; border-color: var(--line-strong); }

.sheet-footer {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 22px calc(18px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--carbon) 30%);
  display: flex; align-items: center; gap: 14px;
}
.stepper {
  display: flex; align-items: center; gap: 4px;
  background: var(--carbon-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px;
}
.stepper button {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: transparent; color: var(--cream); font-size: 18px; cursor: pointer;
}
.stepper span { width: 22px; text-align: center; font-size: 15px; font-weight: 600; }
.add-btn {
  flex: 1; border: none; cursor: pointer;
  background: var(--amber); color: var(--carbon);
  font-size: 15px; font-weight: 600; border-radius: 999px;
  padding: 15px 18px;
}

/* ---------- AR overlay ---------- */
.ar-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: var(--carbon);
  display: none; flex-direction: column;
}
.ar-overlay.show { display: flex; }
.ar-overlay-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(16px + var(--safe-top)) 18px 12px;
}
.ar-overlay-top h3 { color: var(--cream); font-size: 15px; font-weight: 500; }
model-viewer { flex: 1; width: 100%; --poster-color: transparent; background: var(--carbon); }
.ar-hint {
  text-align: center; color: var(--taupe); font-size: 12.5px;
  padding: 10px 24px calc(20px + var(--safe-bottom));
}

/* ---------- Carrito ---------- */
#screen-cart { padding-bottom: 110px; }
.cart-items { padding: 4px 16px; display: flex; flex-direction: column; gap: 10px; }
.cart-empty { padding: 60px 30px; text-align: center; color: var(--taupe); font-size: 14.5px; }
.cart-row {
  background: var(--carbon-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.cart-row .qty-badge {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--carbon-3); color: var(--amber-light);
  font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.cart-row .info { flex: 1; min-width: 0; }
.cart-row h4 { font-size: 15px; font-weight: 600; color: var(--cream); }
.cart-row .mods { font-size: 12.5px; color: var(--taupe); margin-top: 3px; line-height: 1.5; }
.cart-row .price { font-family: var(--serif); font-size: 14.5px; color: var(--cream); flex: none; }
.cart-row .remove { background: none; border: none; color: var(--taupe); font-size: 12px; cursor: pointer; margin-top: 6px; padding: 0; }

.cart-summary {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  padding: 16px 20px calc(18px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--carbon) 22%);
}
.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 12px; }
.cart-total-row .label { color: var(--taupe); font-size: 13.5px; }
.cart-total-row .amount { font-family: var(--serif); font-size: 21px; color: var(--cream); }

/* ---------- Confirmacion ---------- */
#screen-confirm { justify-content: center; align-items: center; text-align: center; padding: 32px; }
.confirm-check {
  width: 84px; height: 84px; border-radius: 50%;
  border: 1.5px solid var(--sage);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 26px;
}
.confirm-check svg { width: 34px; height: 34px; }
.confirm-check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .15s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
#screen-confirm h1 { font-size: 27px; margin-bottom: 10px; }
#screen-confirm .sub { color: var(--cream-dim); font-size: 15px; line-height: 1.6; max-width: 320px; margin-bottom: 8px; }
.confirm-meta { color: var(--taupe); font-size: 13px; margin-bottom: 36px; }

/* ---------- Toggle oculto ---------- */
.hidden-toggle {
  position: fixed; right: 14px; bottom: calc(14px + var(--safe-bottom));
  width: 30px; height: 30px; border-radius: 50%;
  background: transparent; border: none;
  opacity: 0.35; z-index: 30;
}
.hidden-toggle svg { width: 30px; height: 30px; }

/* ---------- Cocina ---------- */
#screen-kitchen { background: var(--carbon); }
.kitchen-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + var(--safe-top)) 20px 4px;
}
.kitchen-top h1 { font-size: 22px; }
.kitchen-top .exit { font-size: 13px; color: var(--taupe); background: none; border: none; cursor: pointer; }
.kitchen-sub { padding: 0 20px 16px; color: var(--taupe); font-size: 13px; }
.kitchen-cols { display: flex; gap: 12px; padding: 0 12px 24px; overflow-x: auto; flex: 1; }
.kitchen-col { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 10px; }
.kitchen-col-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--cream);
  padding: 6px 4px 2px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.nuevo { background: var(--taupe); }
.status-dot.preparando { background: var(--amber); }
.status-dot.listo { background: var(--sage); }
.kitchen-count { color: var(--taupe); font-weight: 400; }

.order-card {
  background: var(--carbon-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.order-card:active { transform: scale(0.98); }
.order-card.preparando { border-color: rgba(201,125,60,0.4); }
.order-card.listo { border-color: rgba(107,143,113,0.45); }
.order-card .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-card .table { font-family: var(--serif); font-size: 15px; color: var(--cream); }
.order-card .time { font-size: 11.5px; color: var(--taupe); }
.order-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.order-card li { font-size: 13px; color: var(--cream-dim); }
.order-card li .n { color: var(--amber-light); font-weight: 600; margin-right: 5px; }
.order-card .mod-note { font-size: 11.5px; color: var(--taupe); margin-left: 18px; }
.order-card .advance { margin-top: 10px; font-size: 12px; color: var(--taupe); text-align: right; }
.kitchen-empty { color: var(--taupe); font-size: 13px; padding: 30px 10px; text-align: center; }

@media (min-width: 720px) {
  .kitchen-cols { padding: 0 24px 24px; }
}
