:root {
  --bg: #fff6ec;
  --surface: #ffffff;
  --ink: #23180f;
  --muted: #8a7561;
  --line: #efe2d2;
  --brand: #e8562a;
  --brand-2: #cf4318;
  --gold: #ffb703;
  --gold-soft: #fff0cc;
  --ok: #17944a;
  --warn: #ea8c00;
  --shadow: 0 1px 2px rgba(35,24,15,.04), 0 8px 24px rgba(35,24,15,.07);
  --serif: 'Fredoka', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --hdr-h: 74px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.45; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Header ---------- */
header.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--hdr-h);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); color: #fff;
  padding: 0 22px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.brand-name { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: .01em; line-height: 1.05; }
.brand-tag { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .9; margin-top: 2px; }
.table-badge {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap;
}

/* ---------- Layout ---------- */
.shell { max-width: 1200px; margin: 0 auto; padding: 22px; display: block; }

/* ---------- Category tabs ---------- */
.tabs {
  position: sticky; top: var(--hdr-h); z-index: 15; background: var(--bg);
  display: flex; gap: 6px; overflow-x: auto; padding: 12px 2px; margin-bottom: 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 9px 18px; font-family: var(--sans); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; border-radius: 999px; transition: all .15s;
}
.tab:hover { color: var(--ink); border-color: var(--gold); }
.tab.active { color: #fff; background: var(--brand); border-color: var(--brand); }

.section-title { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 6px 2px 16px; }
.section-title small { display: block; font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }

/* ---------- Item cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(35,24,15,.05), 0 14px 30px rgba(35,24,15,.12); }
.card .imgwrap { position: relative; width: 100%; padding-top: 64%; overflow: hidden; background: var(--gold-soft); }
.card .imgwrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card .imgwrap .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 44px; font-weight: 600; color: var(--brand); background: var(--gold-soft);
}
.card .imgwrap.noimg img { display: none; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card .name { font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.2; }
.card .desc { color: var(--muted); font-size: 13px; margin-top: 5px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.card .price { font-family: var(--serif); font-weight: 600; font-size: 17px; }

button.add {
  border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 10px;
  padding: 9px 18px; font-family: var(--sans); font-weight: 700; cursor: pointer; font-size: 14px; transition: background .15s;
}
button.add:hover { background: var(--brand-2); }
.qty { display: flex; align-items: center; gap: 10px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 18px; line-height: 1; cursor: pointer; color: var(--brand); }
.qty button:hover { border-color: var(--brand); }
.qty .n { min-width: 14px; text-align: center; font-weight: 700; }

/* ---------- Order summary panel ---------- */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.close-sheet { display: none; position: absolute; top: 12px; right: 14px; border: none; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; }
.panel-title { font-family: var(--serif); font-weight: 600; font-size: 21px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.empty-cart { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 14px; }
.empty-cart span { color: var(--muted); opacity: .8; }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .cl-info { flex: 1; min-width: 0; }
.cart-line .cl-name { font-weight: 600; font-size: 15px; }
.cart-line .cl-price { color: var(--muted); font-size: 13px; margin-top: 2px; }
.cart-line .cl-qty { display: flex; align-items: center; gap: 8px; }
.cart-line .cl-qty button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 16px; cursor: pointer; color: var(--brand); }
.cart-line .cl-qty .n { min-width: 14px; text-align: center; font-weight: 700; font-size: 14px; }
.name-field { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit; font-size: 15px; margin-top: 14px; }
.name-field:focus { outline: none; border-color: var(--gold); }
.note { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px; font: inherit; font-size: 14px; margin-top: 10px; resize: vertical; }
.note:focus { outline: none; border-color: var(--gold); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; font-family: var(--serif); }
.sum-total span:first-child { font-size: 15px; color: var(--muted); }
.sum-total span:last-child { font-size: 24px; font-weight: 600; }
.pay-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; text-align: center; }
.place { width: 100%; border: none; background: var(--brand); color: #fff; padding: 15px; border-radius: 12px; font-family: var(--sans); font-size: 16px; font-weight: 700; margin-top: 12px; cursor: pointer; transition: background .15s; }
.place:hover { background: var(--brand-2); }

/* ---------- Mobile cart bar ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--brand); color: #fff; padding: 14px 18px;
  display: none; align-items: center; justify-content: space-between;
  box-shadow: 0 -6px 24px rgba(0,0,0,.18); transform: translateY(120%); transition: transform .2s;
}
.cartbar.show { transform: translateY(0); }
.cartbar .lbl { font-weight: 600; }
.cartbar button { border: none; background: var(--gold); color: #3a2a06; font-weight: 800; padding: 11px 20px; border-radius: 10px; font-family: var(--sans); }
.backdrop { position: fixed; inset: 0; background: rgba(20,14,12,.5); z-index: 48; display: none; }
.backdrop.show { display: block; }

/* ---------- Desktop: two columns ---------- */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
  .summary { position: sticky; top: calc(var(--hdr-h) + 22px); order: 0; }
  .menu { order: 1; min-width: 0; }
  .cartbar { display: none !important; }
  .backdrop { display: none !important; }
}

/* ---------- Mobile: summary becomes a bottom sheet ---------- */
@media (max-width: 899px) {
  .shell { padding: 12px 12px 90px; }
  .summary {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0;
    border-radius: 18px 18px 0 0; max-height: 82vh; overflow: auto;
    transform: translateY(120%); transition: transform .25s; max-width: 620px; left: 50%; translate: -50% 0;
  }
  .summary.show { transform: translateY(0); }
  .close-sheet { display: block; }
  .cartbar { display: flex; }
  .tabs { top: var(--hdr-h); }
}

/* ---------- Confirmation (big order number) ---------- */
.confirm { text-align: center; padding: 54px 20px; max-width: 480px; margin: 0 auto; }
.confirm .tick {
  width: 72px; height: 72px; margin: 0 auto 6px; border-radius: 50%;
  background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 38px;
}
.confirm h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 12px 0 4px; }
.confirm .ordernum {
  margin: 22px auto; background: #fff; border: 3px solid var(--gold); border-radius: 22px;
  padding: 22px 16px; max-width: 320px; box-shadow: var(--shadow);
}
.confirm .ordernum .lbl { font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.confirm .ordernum .num { font-family: var(--serif); font-weight: 600; font-size: 88px; line-height: 1; color: var(--brand); margin-top: 6px; }
.confirm .steps { text-align: left; background: var(--gold-soft); border-radius: 14px; padding: 16px 18px; margin: 20px auto 0; max-width: 380px; }
.confirm .steps li { margin: 6px 0; font-size: 14px; }
