/* v2: app-style layout. Slim top bar with the logo, a welcome card, menu as
   tiles, section chips, bottom tabs. Gilley's colours from the logo. */
:root {
  --bg: #f6f5f2; --card: #ffffff; --ink: #1b1d1f; --muted: #5f646b; --line: #e3e1dc;
  --red: #c8423b; --green: #2f7a3f; --yellow: #f6c432; --yellow-ink: #1b1d1f;
  --picked: #fdeceb; --warn: #8a6100; --warn-bg: #fff4d6;
  --tab-h: 64px;
  --top-h: 99px;   /* logo bar: 84px logo + padding + border */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131416; --card: #1d1f22; --ink: #eceef0; --muted: #a3a9b0; --line: #34383d;
          --red: #ef6b62; --green: #5fbf7a; --yellow: #f6c432; --picked: #3b2220; --warn: #e0b341; --warn-bg: #3a3118; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 12px); }
body.has-pay { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 80px); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
main { max-width: 680px; margin: 0 auto; padding: 0 16px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; padding: 6px 0;
       padding-top: calc(6px + env(safe-area-inset-top, 0px)); background: var(--card); border-bottom: 1px solid var(--line); }
.top img { height: 84px; width: auto; }
.top { position: sticky; }
/* Language picker: names in their own language, top right of the logo bar */
.lang { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); margin: 0; }
.lang select { appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235f646b' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--ink); font: 600 15px/1 inherit; font-family: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabs button span:not(.badge) { text-align: center; line-height: 1.1; }
.tile { overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { .top img { background: #fff; border-radius: 10px; padding: 3px; } }

/* Welcome card */
.hero { margin: 16px 0 8px; }
.hello { margin: 0; font-weight: 700; font-size: 20px; }
.hero h1 { margin: 2px 0 6px; font-size: 36px; line-height: 1.08; letter-spacing: -.01em; text-wrap: balance; }
.sub { margin: 0 0 16px; color: var(--muted); }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { min-height: 54px; border-radius: 10px; border: 0; font-size: 18px; font-weight: 650; padding: 0 16px; cursor: pointer; }
.btn-main { background: var(--yellow); color: var(--yellow-ink); }
.btn-quiet { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.btn:disabled { opacity: .5; }
.btn:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

h2.section { font-size: 26px; margin: 28px 0 12px; }
.page-title { font-size: 28px; margin: 18px 0 12px; }

/* Menu tiles on Home */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; min-height: 124px; border-radius: 12px; border: 0; padding: 14px; text-align: left; color: #fff;
        display: flex; flex-direction: column; justify-content: center; align-items: flex-start; font-size: 24px; line-height: 1.15; font-weight: 750; cursor: pointer; overflow: hidden; }
.tile small { font-weight: 500; opacity: .9; font-size: 16px; margin-top: 4px; }
.tile:nth-child(3n+1) { background: var(--red); }
.tile:nth-child(3n+2) { background: var(--green); }
.tile:nth-child(3n) { background: #3d3f43; }
.tile::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.12); }

/* Section chips on Menu */
.chips { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 4; display: flex; gap: 8px; overflow-x: auto;
         padding: 10px 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px; background: var(--bg); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
                color: var(--ink); font-size: 17px; font-weight: 650; white-space: nowrap; }
.chips button[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#menu h2 { font-size: 22px; letter-spacing: 0; color: var(--ink); margin: 22px 0 10px; scroll-margin-top: calc(var(--top-h) + 66px); }

/* Item cards (same behaviour as the first version) */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stack { display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.item .desc { grid-column: 1; color: var(--muted); font-size: 14px; }
.item .price { font-variant-numeric: tabular-nums; }
.item.off { opacity: .55; cursor: default; }
.item.picked { border-color: var(--red); background: var(--picked); }
.item.picked .qty span { font-weight: 800; color: var(--red); }
.choices-hint { font-size: 13px; }
.qty { display: flex; align-items: center; gap: 6px; }
.item .qty { grid-column: 2; grid-row: 1 / span 2; }
.qty button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 20px; }
.qty span { min-width: 1.5em; text-align: center; font-variant-numeric: tabular-nums; }

/* My order */
#lines { display: grid; gap: 10px; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.line + .line { border-top: 1px solid var(--line); padding-top: 10px; }
.line .qty span { min-width: 4.5em; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=tel], input[type=email] { width: 100%; min-height: 46px; padding: 8px 10px; font-size: 17px;
       border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.choice { display: flex; gap: 8px; }
.choice label { flex: 1; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.btn-pay { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 10px); z-index: 6;
           max-width: 648px; margin: 0 auto; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.empty { text-align: center; padding: 30px 0; color: var(--muted); }
.error { margin: 10px 16px; background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; }
.big-number { font-size: 72px; font-weight: 800; line-height: 1; }
.status { font-size: 22px; font-weight: 700; margin-top: 6px; }
.status.ready { color: var(--green); }

/* Bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: grid; grid-template-columns: repeat(4, 1fr);
        height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--card); border-top: 1px solid var(--line); }
.tabs button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
               border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.tabs svg { width: 26px; height: 26px; fill: currentColor; }
.tabs button[aria-current="page"] { color: var(--ink); }
.tabs button[aria-current="page"] svg { color: var(--yellow); filter: drop-shadow(0 0 .5px var(--ink)); }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
         background: var(--red); color: #fff; font-size: 12px; line-height: 20px; }

/* Choices sheet */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel { background: var(--bg); width: 100%; max-width: 680px; max-height: 88vh; overflow-y: auto; border-radius: 16px 16px 0 0;
               padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; font-size: 19px; }
.sheet-head button { width: 44px; height: 44px; border: 0; background: none; font-size: 28px; color: var(--ink); }
.group { border: 0; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.group legend { font-weight: 700; margin-bottom: 6px; }
.group legend .need { color: var(--red); font-weight: 600; font-size: 14px; }
.group legend .muted { font-weight: 500; font-size: 14px; }
.opt { display: flex; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 12px; border-radius: 10px;
       border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 16px; text-align: left; }
.opt.on { border-color: var(--red); background: var(--picked); font-weight: 650; }
.opt:disabled { opacity: .5; }
.sheet-foot { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; padding-top: 12px; background: var(--bg); }
.sheet-foot .btn { flex: 1; }
body.sheet-open { overflow: hidden; }

.test-banner, .closed-banner { margin: 0; padding: 8px 16px; text-align: center; font-weight: 800; }
.test-banner { background: #ffd400; color: #1b1d1f; }
.closed-banner { background: var(--ink); color: var(--bg); }
@media (prefers-reduced-motion: no-preference) { .item:active, .tile:active { transform: scale(.985); } }
