/* Neutral palette: white, greys, near-black, one muted slate accent.
   The only non-grey hue is the muted brick red reserved for "Pedido cancelado" / errors. */
:root {
  --bg: #f4f5f6;
  --surface: #ffffff;
  --ink: #1b1f23;
  --muted: #565f6b;
  --line: #d6dadf;
  --soft: #e8ebee;
  --accent: #3a4a5c;
  --accent-ink: #ffffff;
  --danger-bg: #fbeeee;
  --danger-line: #a33a3a;
  --danger-ink: #6e1f1f;
  --warn-bg: #eef0f2;
  --focus: #3a4a5c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131619;
    --surface: #1c2024;
    --ink: #e9ebed;
    --muted: #a3abb5;
    --line: #333a42;
    --soft: #2a3036;
    --accent: #a9bacb;
    --accent-ink: #12161a;
    --danger-bg: #3a2323;
    --danger-line: #b86a6a;
    --danger-ink: #f4d6d6;
    --warn-bg: #2a3036;
    --focus: #a9bacb;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.view { max-width: 640px; margin: 0 auto; min-height: 100vh; }
.view.has-cartbar { padding-bottom: 88px; }
.content { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* Header and tabs */
.app-header { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.app-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; min-height: 56px; }
.app-header h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); cursor: pointer; white-space: nowrap;
}
.link { color: var(--accent); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; }

/* Menu */
.category { scroll-margin-top: 120px; margin-bottom: 8px; }
.category-title { font-size: 13px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 8px 0 8px; }
.dishes { display: flex; flex-direction: column; gap: 12px; }
.dish { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.dish-photo { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--soft); display: block; }
.dish-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dish-name { font-size: 16px; font-weight: 600; }
.dish-desc { font-size: 14px; color: var(--muted); }
.dish-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.price { font-weight: 650; font-variant-numeric: tabular-nums; }
.dish-action { display: flex; align-items: center; gap: 8px; }
.dish.soldout { background: var(--soft); }
.dish.soldout .dish-name, .dish.soldout .price { color: var(--muted); }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.tag-off { background: var(--surface); border: 1px solid var(--line); color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--accent); padding: 0 8px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { background: var(--soft); color: var(--muted); border-color: var(--line); cursor: not-allowed; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.step-btn { width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; cursor: pointer; border-radius: 10px; }
.step-qty { min-width: 28px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }

.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.cartbar .btn { max-width: 608px; margin: 0 auto; }

/* Cart */
.cart-lines { display: flex; flex-direction: column; gap: 12px; }
.cart-line { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.cart-line.soldout { background: var(--soft); }
.cart-line-main { display: flex; flex-direction: column; gap: 2px; }
.cart-line-name { font-weight: 600; }
.cart-line-price { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-line-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.total-row { display: flex; justify-content: space-between; font-size: 18px; padding: 8px 0; border-top: 1px solid var(--line); }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend, .label { font-weight: 600; margin-bottom: 8px; padding: 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 8px; text-align: center; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.panel { display: flex; flex-direction: column; gap: 4px; }
.mesa-fixed { font-size: 22px; font-weight: 650; }
.choice-disabled span { background: var(--soft); color: var(--muted); border-style: dashed; font-weight: 500; }
.choice-disabled input { cursor: not-allowed; }
.choices + .hint { margin-top: 8px; }
.banner-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; max-width: 640px; margin: 0 auto; padding: 8px 8px 8px 16px; background: var(--soft); border-bottom: 2px solid var(--line); color: var(--ink); }
.banner-info > span { padding-top: 10px; }
.banner-close { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; }
.card-wait { padding: 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 18px; }
.steps.steps-5 { grid-template-columns: repeat(5, 1fr); }
.steps-5 .step { font-size: 11px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.input { width: 100%; min-height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.hint, .notice { color: var(--muted); font-size: 14px; }
.alert { padding: 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 15px; }
.alert-warn { background: var(--warn-bg); }
.alert-error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-ink); }

/* Order status */
.order-code { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.order-where { font-size: 22px; font-weight: 650; margin-top: -8px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; position: relative; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 13px; color: var(--muted); }
.step-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.step.done .step-dot { background: var(--muted); border-color: var(--muted); }
.step.current .step-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--soft); }
.step.current { color: var(--ink); font-weight: 650; }
.order-items { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.order-items li { display: flex; justify-content: space-between; gap: 12px; }
.order-item-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.banner-cancel { padding: 16px; border-radius: 12px; border: 2px solid var(--danger-line); background: var(--danger-bg); color: var(--danger-ink); }
.banner-cancel strong { display: block; font-size: 22px; margin-bottom: 4px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .tab { transition: background-color 0.12s, border-color 0.12s; }
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; }

.app-footer { padding: 8px 16px 96px; text-align: center; font-size: 14px; }
.privacy { max-width: 640px; margin: 0 auto; }
.privacy h1 { font-size: 22px; }
.privacy h2 { font-size: 17px; margin-top: 8px; }
.privacy p, .privacy ul { line-height: 1.5; }
.privacy ul { padding-left: 20px; list-style: disc; }
