:root {
  --bg: #fff8ea;
  --surface: #ffffff;
  --ink: #33291a;
  --muted: #94825f;
  --line: #f0e4c8;
  --brand: #e2662c;        /* logo orange */
  --brand-2: #c8531d;
  --sun: #f6c445;          /* logo yellow */
  --sun-soft: #fdf1cf;
  --teal: #1f98a9;         /* logo teal   */
  --green: #7cb342;        /* logo green  */
  --ok: #3d9a4e;
  --warn: #d97706;
  --shadow: 0 1px 2px rgba(60,40,10,.05), 0 8px 24px rgba(60,40,10,.08);
  --disp: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --sans: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --hdr-h: 76px;
}
* { 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(--sun) 0%, #f2b432 100%); color: #4a2c08;
  padding: 0 22px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid var(--brand);
}
.brand-left { display: flex; align-items: center; gap: 12px; }
.hdr-logo { height: 56px; width: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 8px rgba(90,50,0,.3); }
.brand-name { font-family: var(--disp); font-size: 27px; font-weight: 700; letter-spacing: .01em; line-height: 1.05; color: #7a3c0d; }
.brand-tag { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-top: 2px; font-weight: 700; }
.hours-badge {
  background: rgba(255,255,255,.55); border: 1px solid rgba(122,60,13,.25); color: #7a3c0d;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.hours-badge.closed { background: #ffe3d6; border-color: var(--brand); color: var(--brand-2); }

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

/* ---------- Closed banner ---------- */
.closed-banner {
  background: #fff1e8; border: 1px solid #f3c6ab; color: #a04a17;
  border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; font-weight: 600; display: none;
}
.closed-banner.show { 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: 700;
  cursor: pointer; white-space: nowrap; border-radius: 999px; transition: all .15s;
}
.tab:hover { color: var(--ink); border-color: var(--sun); }
.tab.active { color: #fff; background: var(--brand); border-color: var(--brand); }

.section-title { font-family: var(--disp); font-weight: 700; font-size: 27px; margin: 6px 2px 16px; }
.section-title small { display: block; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 1px; 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: 18px;
  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(60,40,10,.05), 0 14px 30px rgba(60,40,10,.12); }
.card .imgwrap { position: relative; width: 100%; padding-top: 64%; overflow: hidden; background: var(--sun-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(--disp); font-size: 46px; font-weight: 700; color: var(--brand); background: var(--sun-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(--disp); font-weight: 700; 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(--disp); font-weight: 700; font-size: 17px; color: var(--brand-2); }

button.add {
  border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 12px;
  padding: 9px 18px; font-family: var(--sans); font-weight: 800; 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: 800; }

/* ---------- Order summary / checkout panel ---------- */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; 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(--disp); font-weight: 700; 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; }
.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: 700; 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: 800; font-size: 14px; }

/* Checkout form */
.ck { margin-top: 14px; }
.ck label { display: block; font-size: 12.5px; font-weight: 800; color: var(--muted); margin: 12px 2px 5px; letter-spacing: .03em; text-transform: uppercase; }
.ck input, .ck select, .ck textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px;
  font: inherit; font-size: 14px; background: #fffdf6; color: var(--ink);
}
.ck input:focus, .ck select:focus, .ck textarea:focus { outline: none; border-color: var(--sun); }
.ck textarea { resize: vertical; min-height: 56px; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; border: 1.5px solid var(--line); background: #fffdf6; color: var(--muted);
  border-radius: 12px; padding: 11px 8px; font: inherit; font-weight: 800; cursor: pointer; font-size: 14px;
}
.seg button.on.take { border-color: var(--brand); color: var(--brand-2); background: #fff1e8; }
.seg button.on.eat { border-color: var(--green); color: #4c7326; background: #f0f7e6; }

.sum-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; font-family: var(--disp); }
.sum-total span:first-child { font-size: 15px; color: var(--muted); }
.sum-total span:last-child { font-size: 25px; font-weight: 700; }
.place {
  width: 100%; border: none; background: var(--brand); color: #fff; padding: 15px; border-radius: 13px;
  font-family: var(--sans); font-size: 16px; font-weight: 800; margin-top: 12px; cursor: pointer; transition: background .15s;
}
.place:hover { background: var(--brand-2); }
.place.alt { background: var(--teal); }
.place.alt:hover { background: #177d8c; }
.place:disabled { opacity: .55; cursor: default; }
.pay-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 9px; }
.ck-err { color: #c0392b; font-size: 13px; font-weight: 700; margin-top: 10px; text-align: center; min-height: 17px; }

/* ---------- 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: 700; }
.cartbar button { border: none; background: var(--sun); color: #4a2c08; font-weight: 800; padding: 11px 20px; border-radius: 11px; font-family: var(--sans); cursor: pointer; }
.backdrop { position: fixed; inset: 0; background: rgba(40,25,5,.5); z-index: 48; display: none; }
.backdrop.show { display: block; }

/* ---------- Desktop: two columns ---------- */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; }
  .summary { position: sticky; top: calc(var(--hdr-h) + 22px); order: 0; max-height: calc(100vh - var(--hdr-h) - 44px); overflow: auto; }
  .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: 50%; right: 0; bottom: 0; z-index: 50; margin: 0;
    border-radius: 20px 20px 0 0; max-height: 86vh; overflow: auto; width: 100%; max-width: 620px;
    transform: translateY(120%); transition: transform .25s; translate: -50% 0;
  }
  .summary.show { transform: translateY(0); }
  .close-sheet { display: block; }
  .cartbar { display: flex; }
  .tabs { top: var(--hdr-h); }
  .brand-tag { display: none; }
}

/* ---------- Tracking page ---------- */
.track { max-width: 560px; margin: 0 auto; padding: 26px 18px 60px; }
.track .logo-lg { display: block; width: 92px; height: 92px; border-radius: 50%; margin: 8px auto 10px; box-shadow: 0 6px 20px rgba(90,50,0,.25); }
.track h1 { font-family: var(--disp); font-weight: 700; font-size: 26px; text-align: center; margin: 4px 0 2px; }
.track .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.badge-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.badge { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.badge.take { background: #fff1e8; color: var(--brand-2); border: 1px solid #f3c6ab; }
.badge.eat { background: #f0f7e6; color: #4c7326; border: 1px solid #cfe6ae; }
.badge.time { background: var(--sun-soft); color: #8a6410; border: 1px solid #f0dfa8; }
.badge.paid { background: #e7f5ea; color: var(--ok); border: 1px solid #bfe3c8; }
.badge.unpaid { background: #fdeeee; color: #c0392b; border: 1px solid #f2c9c9; }

.steps { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; }
.step { display: flex; gap: 14px; position: relative; padding-bottom: 26px; }
.step:last-child { padding-bottom: 0; }
.step .dot {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px; z-index: 1;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800;
  background: #f3ecd9; color: var(--muted); border: 2px solid var(--line);
}
.step .bar { position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child .bar { display: none; }
.step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.step.now .dot { background: var(--sun); border-color: #e2ae2a; color: #6b4c08; animation: pulse 1.6s infinite; }
.step.done .bar { background: var(--green); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(246,196,69,.5); } 50% { box-shadow: 0 0 0 9px rgba(246,196,69,0); } }
.step .tt { font-weight: 800; font-size: 15px; }
.step .td { color: var(--muted); font-size: 13px; margin-top: 2px; }

.bill { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 22px; margin-top: 16px; }
.bill .bl { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bill .bl .q { color: var(--brand); font-weight: 800; margin-right: 8px; }
.bill .grand { display: flex; justify-content: space-between; padding-top: 12px; font-family: var(--disp); font-weight: 700; font-size: 19px; }
.track .place { max-width: 420px; margin: 18px auto 0; display: block; }
.track .again { text-align: center; margin-top: 18px; }
.track .again a { color: var(--teal); font-weight: 800; text-decoration: none; }

/* ---------- Confirmation ---------- */
.confirm { text-align: center; padding: 72px 20px; max-width: 460px; margin: 0 auto; }
.confirm .tick {
  width: 76px; height: 76px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.confirm h2 { font-family: var(--disp); font-weight: 700; font-size: 28px; margin: 14px 0 8px; }
