/* Layout: red pizzeria-sign header band, sticky category strip, menu list + sticky order column (stacks on phones with a bottom order bar). */
:root {
  --bg: #f3f1ee; --surface: #ffffff; --ink: #231c18; --muted: #6e625a; --line: #e4ddd6;
  --red: #b3231a; --red-ink: #ffffff; --red-soft: #fbe9e6; --green: #2e6a3d; --green-soft: #e3f0e5;
  --band: #a81f17; --band-ink: #fff7f2; --paper: #fffef9;
  --f-display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --f-body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #161210; --surface: #211b18; --ink: #f2ebe6; --muted: #b3a69d; --line: #3a312c;
  --red: #e1503f; --red-ink: #1b0d0a; --red-soft: #3a1c17; --green: #7cc28c; --green-soft: #1d3022;
  --band: #5e1510; --band-ink: #fff1ea; --paper: #f7f3e8; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #161210; --surface: #211b18; --ink: #f2ebe6; --muted: #b3a69d; --line: #3a312c;
  --red: #e1503f; --red-ink: #1b0d0a; --red-soft: #3a1c17; --green: #7cc28c; --green-soft: #1d3022;
  --band: #5e1510; --band-ink: #fff1ea; --paper: #f7f3e8; color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, label.choice:focus-within { outline: 3px solid var(--green); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sel { user-select: all; }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Header band */
.hdr { background: var(--band); color: var(--band-ink); }
.hdr-in { max-width: 1180px; margin: 0 auto; padding-block: 22px 20px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { min-width: 0; }
.brand h1 { font: 400 clamp(32px, 6vw, 46px)/1 var(--f-display); margin: 0; letter-spacing: .01em; text-wrap: balance; }
.brand .sub { margin: 6px 0 0; font-weight: 600; opacity: .92; }
.brand .meta { margin: 2px 0 0; font-size: 14px; opacity: .85; }
.hdr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.pill { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.16); }
.pill.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #7fe08f; margin-right: 6px; vertical-align: 1px; }
.hdr .seg { background: rgba(0,0,0,.22); }
.hdr .seg button { color: var(--band-ink); }
.hdr .seg button[aria-pressed="true"] { background: var(--band-ink); color: var(--band); }
.demo { background: var(--green-soft); color: var(--green); font-size: 14px; font-weight: 700; text-align: center; padding-block: 7px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Segmented control */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--bg); }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 99px; font-weight: 700; font-size: 15px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }

/* Category strip */
.cats { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.cats-in { max-width: 1180px; margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.cats-in::-webkit-scrollbar { display: none; }
.cats a { flex: none; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 99px; }
.cats a:hover { background: var(--red-soft); color: var(--red); }

/* Main layout */
.layout { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; padding-block: 8px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
html { scroll-padding-top: calc(60px + env(safe-area-inset-top, 0px)); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.cat { padding-top: 28px; }
.cat h2 { font: 400 28px/1.1 var(--f-display); color: var(--red); margin: 0; letter-spacing: .01em; }
.cat-note { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 14px; }
.item { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 52px 14px 16px; min-height: 92px; transition: border-color .15s; }
.item:hover:not(:disabled) { border-color: var(--red); }
.item:disabled { opacity: .55; cursor: not-allowed; }
.item-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-name { font-weight: 800; font-size: 16px; }
.item-desc { color: var(--muted); font-size: 14px; line-height: 1.4; }
.item-price { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.add { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 20px; line-height: 1; }

/* Order column */
.cart { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; max-height: calc(100vh - 88px); overflow-y: auto; }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.cart h2 { font: 400 24px/1 var(--f-display); margin: 0; }
.cart h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 8px; }
.empty { color: var(--muted); margin: 10px 0 0; }
.lines { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.line { padding: 10px 0; border-bottom: 1px solid var(--line); }
.l-main { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.l-main small { color: var(--muted); font-weight: 600; }
.l-p { font-variant-numeric: tabular-nums; }
.l-det { margin: 2px 0 0; padding-left: 16px; color: var(--muted); font-size: 14px; }
.l-note { margin: 2px 0 0; font-size: 14px; color: var(--muted); font-style: italic; }
.l-act { display: flex; gap: 14px; margin-top: 4px; }
.link { border: 0; background: none; padding: 2px 0; color: var(--red); font-weight: 700; font-size: 14px; }
.only-m { display: none; }

.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fld span { font-size: 14px; font-weight: 700; }
.fld small { color: var(--muted); font-weight: 600; }
.fld input, .fld select, textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.fld-zip input { max-width: 140px; }
.tip { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 14px; font-weight: 700; }
.tip .seg { display: flex; } .tip .seg button { flex: 1; padding-inline: 6px; }
.totals { margin: 16px 0 0; display: flex; flex-direction: column; gap: 4px; }
.totals div { display: flex; justify-content: space-between; }
.totals dt { color: var(--muted); } .totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font-weight: 800; font-size: 18px; }
.totals .grand dt { color: var(--ink); }
.err { color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 700; margin: 12px 0 0; }
.fine { color: var(--muted); font-size: 13px; text-align: center; margin: 8px 0 0; }
.primary { border: 0; background: var(--red); color: var(--red-ink); font-weight: 800; padding: 12px 18px; border-radius: 10px; font-size: 16px; }
.primary:disabled { opacity: .5; cursor: default; }
.primary.big { width: 100%; padding: 14px; margin-top: 14px; font-size: 17px; }

/* Bottom order bar (phones) */
.cartbar { display: none; }

/* Item builder sheet */
#sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; }
#sheet-bg { position: absolute; inset: 0; border: 0; background: rgba(20, 12, 8, .55); cursor: default; }
.sheet { position: relative; width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; overflow: hidden; }
#sheet-close { position: absolute; right: 12px; top: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); font-size: 20px; }
.sheet-body { overflow-y: auto; padding: 22px 20px 8px; }
.sheet-foot { border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); }
.foot-row { display: flex; gap: 12px; align-items: center; }
.foot-row .primary { flex: 1; }
.b-top h3 { font: 400 28px/1.1 var(--f-display); margin: 0 44px 4px 0; text-wrap: balance; }
.b-top p { color: var(--muted); margin: 0; }
.grp { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.g-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.g-head h4 { margin: 0; font-size: 17px; }
.req { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--red); }
.opt { font-size: 13px; color: var(--muted); font-weight: 700; }
.g-note { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin-top: 10px; }
.size { border: 2px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.size span { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.size[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); }
.size[aria-pressed="true"] span { color: var(--ink); }
.choices { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.choice { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.choice.on { border-color: var(--red); background: var(--red-soft); }
.choice input { accent-color: var(--red); width: 18px; height: 18px; margin: 0; flex: none; }
.c-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.c-txt small { color: var(--muted); font-size: 13px; }
.c-p { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; font-weight: 700; }

/* Toppings: left half / whole / right half */
.pie { position: sticky; top: -22px; z-index: 1; display: flex; gap: 14px; align-items: center; margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.pie-art { width: 64px; height: 64px; flex: none; }
.pie-off { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.pie-on { fill: var(--red-soft); stroke: var(--red); stroke-width: 2; }
.pie-cut { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.pie-halves { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-width: 0; font-size: 14px; }
.pie-halves div { display: flex; flex-direction: column; min-width: 0; }
.pie-halves b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tops { display: flex; flex-direction: column; margin-top: 8px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.top.picked .top-name { font-weight: 800; }
.top-name { font-size: 15px; min-width: 0; }
.place { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.place button { border: 0; background: var(--surface); padding: 7px 10px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 62px; }
.place button + button { border-left: 1px solid var(--line); }
.place button[aria-pressed="true"] { background: var(--red); color: var(--red-ink); }
.qty { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; }
.qty button { width: 38px; height: 42px; border: 0; background: none; font-size: 20px; font-weight: 700; }
.qty span { min-width: 22px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Done */
.done-in { max-width: 640px; margin: 0 auto; padding-block: 40px 60px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--green); margin: 0; }
.done-in h2 { font: 400 clamp(28px, 5vw, 40px)/1.1 var(--f-display); margin: 6px 0 12px; text-wrap: balance; }
.lede { font-size: 17px; margin: 0 0 8px; }
.ticket-wrap { margin: 28px 0; }
.ticket-cap { font-weight: 700; color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.ticket { background: var(--paper); color: #1d1a17; font: 12px/1.45 var(--f-mono); padding: 18px 14px; margin: 0; border-radius: 4px; box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.12); overflow-x: auto; width: fit-content; max-width: 100%; white-space: pre; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 99px; font-weight: 700; z-index: 60; font-size: 15px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 96px; }
  .cart { display: none; }
  body.cart-open .cart { display: block; position: fixed; inset: 0; z-index: 30; margin: 0; border: 0; border-radius: 0; max-height: none;
    padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .only-m { display: inline; }
  .cartbar:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .cartbar .primary.big { margin: 0; }
  #sheet { place-items: end center; }
  .sheet { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .hdr-side { align-items: flex-start; width: 100%; flex-direction: row; justify-content: space-between; flex-wrap: wrap; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) { .items { grid-template-columns: minmax(0, 1fr); } .place button { min-width: 0; padding: 7px 8px; } }
.top-name small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; line-height: 1.35; }
