:root {
  --bg: #fff8ef;
  --surface: #ffffff;
  --ink: #2b1a0e;
  --muted: #9a7a5a;
  --accent: #e2342a;
  --accent-2: #f6a821;
  --line: #f0e2cf;
  --shadow: 0 6px 20px rgba(120, 70, 30, .10);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Prompt', sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: calc(90px + var(--safe-b));
  line-height: 1.5;
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  background: linear-gradient(150deg, #d2232a 0%, #e2342a 45%, #f6a821 130%);
  color: #fff;
  padding: 38px 20px 84px;
  text-align: center;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(400px 160px at 85% 110%, rgba(255,255,255,.28), transparent 60%),
              radial-gradient(260px 140px at 10% 120%, rgba(255,255,255,.22), transparent 60%);
  pointer-events: none;
}
.hero .brand { font-family: 'Kanit', sans-serif; font-size: 32px; font-weight: 900; letter-spacing: 1px; position: relative; z-index: 1; }
.hero .brand small { display: block; font-family: 'Prompt', sans-serif; font-size: 13px; font-weight: 500; opacity: .9; letter-spacing: 5px; margin-top: 2px; }
.hero .tagline { position: relative; z-index: 1; margin-top: 10px; font-size: 14px; opacity: .95; }
.hero .hours { position: relative; z-index: 1; margin-top: 6px; font-size: 12.5px; opacity: .85; }
.hero .actions { position: relative; z-index: 1; display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Prompt', sans-serif; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform .1s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.96); }
.btn-white { background: #fff; color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.btn-ghost { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(4px); }
.btn-ghost svg { fill: #fff; }
.btn-ghost.filled { background: #fff; color: var(--accent); }
.btn-ghost.filled svg { fill: var(--accent); }

/* ===================== TOOLBAR ===================== */
.toolbar { position: sticky; top: 0; z-index: 40; background: var(--bg); padding: 12px 14px 10px; box-shadow: 0 4px 16px rgba(120,70,30,.08); }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 8px 4px 16px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-family: 'Prompt', sans-serif; font-size: 15px; color: var(--ink); padding: 8px 0; }
.search .clear { border: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; width: 34px; height: 34px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-family: 'Prompt', sans-serif; font-size: 13.5px; font-weight: 600;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 7px 15px; border-radius: 999px; cursor: pointer; transition: all .15s ease;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===================== MENU ===================== */
main { max-width: 760px; margin: 0 auto; padding: 6px 14px 24px; }
.section { margin-top: 18px; }
.section-head { display: flex; align-items: center; gap: 10px; font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 19px; padding-left: 4px; margin-bottom: 8px; }
.section-head .icon { width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 17px; background: var(--surface); box-shadow: var(--shadow); }
.section-head .count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 500; font-family: 'Prompt', sans-serif; }
.section-note { font-size: 12px; color: var(--muted); margin: 0 6px 10px; }

.prod { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.prod.unavailable { opacity: .5; }
.prod-icon { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: linear-gradient(145deg, #fff, #fdeedb); border: 1px solid var(--line); }
.prod-body { flex: 1; min-width: 0; }
.prod-name { font-weight: 700; font-size: 15.5px; line-height: 1.35; }
.prod-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.prod-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge-tag { background: #fff0d6; color: #b4660e; }
.badge-hot { background: #fce8e6; color: #b3261e; }
.badge-unit { background: #fdf0dd; color: #b4660e; }
.badge-soldout { background: #ece6df; color: #8a7a6a; }

.prod-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 10px; }
.price { font-family: 'Kanit', sans-serif; font-weight: 800; font-size: 19px; color: var(--accent); }
.price .unit { font-size: 12px; font-weight: 500; color: var(--muted); font-family: 'Prompt', sans-serif; }
.price .ask { font-size: 12px; color: var(--muted); font-weight: 600; }
.add-btn { border: 0; background: var(--accent); color: #fff; font-family: 'Prompt', sans-serif; font-weight: 600; font-size: 13px; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.add-btn:active { transform: scale(.95); }
.add-btn[disabled] { background: #ccc; cursor: not-allowed; }

.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

/* ===================== CART FAB ===================== */
.cart-fab {
  position: fixed; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%);
  z-index: 50; display: none; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; font-family: 'Kanit', sans-serif;
  font-weight: 700; font-size: 15px; padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35); cursor: pointer; border: 0;
  width: min(92vw, 480px); justify-content: space-between;
}
.cart-fab.show { display: flex; }
.cart-fab .left { display: flex; align-items: center; gap: 10px; }
.cart-fab .count { background: var(--accent); border-radius: 50%; min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; padding: 0 5px; }
.cart-fab svg { fill: #fff; }
.cart-fab .fab-total { color: var(--accent-2); font-size: 16px; }

/* ===================== SHEETS (drawer / modal) ===================== */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.overlay.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 105%);
  width: min(560px, 100vw); max-height: 88vh; background: var(--bg);
  border-radius: 24px 24px 0 0; z-index: 70; padding: 14px 16px calc(18px + var(--safe-b));
  display: flex; flex-direction: column; transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet .handle { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex: 0 0 auto; }
.sheet-head h3 { font-family: 'Kanit', sans-serif; font-size: 19px; font-weight: 700; }
.sheet-head .x { border: 0; background: var(--surface); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--muted); box-shadow: var(--shadow); }
.sheet-body { overflow-y: auto; flex: 1; }

/* cart items */
.cart-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.cart-item .name { flex: 1; font-weight: 600; font-size: 14px; line-height: 1.3; }
.cart-item .name small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.cart-item .line-total { font-family: 'Kanit', sans-serif; font-weight: 700; color: var(--accent); min-width: 74px; text-align: right; font-size: 15px; }
.qty-ctl { display: inline-flex; align-items: center; gap: 2px; background: #ffe9db; border-radius: 999px; padding: 2px; }
.qty-ctl button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--accent); font-size: 18px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-ctl button:active { background: rgba(226,52,42,.15); }
.qty-ctl .qty { min-width: 26px; text-align: center; font-weight: 700; font-size: 14px; }
.cart-item .rm { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; padding: 6px; }

.sheet-foot { margin-top: 10px; padding-top: 10px; border-top: 1.5px dashed var(--line); flex: 0 0 auto; }
.total-row { display: flex; justify-content: space-between; font-family: 'Kanit', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.total-row b { color: var(--accent); font-size: 22px; }
.order-actions { display: flex; gap: 8px; }
.order-actions .btn { flex: 1; justify-content: center; }
.btn-line { background: #06c755; color: #fff; }
.btn-copy { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.note { font-size: 11.5px; color: var(--muted); margin-top: 8px; text-align: center; }

/* ===================== CHECKOUT FORM ===================== */
.form { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #5b4632; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font-family: 'Prompt', sans-serif; font-size: 14.5px;
  background: var(--surface); color: var(--ink); outline: 0;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 74px; }
.req { color: var(--accent); }
.radio-row { display: flex; gap: 10px; }
.radio-row label {
  flex: 1; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px; text-align: center; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
.radio-row input { display: none; }
.radio-row input:checked + span { color: var(--accent); }
.radio-row label:has(input:checked) { border-color: var(--accent); background: #fff3ec; }
.summary-box { background: var(--surface); border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: #5b4632; line-height: 1.7; }
.submit-btn { border: 0; background: #06c755; color: #fff; font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 16px; padding: 13px; border-radius: 999px; cursor: pointer; }
.submit-btn:active { transform: scale(.98); }
.input-err { border-color: #d33 !important; background: #fff5f4 !important; }

.toast {
  position: fixed; top: 16px; left: 50%; transform: translate(-50%, -80px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; z-index: 90; transition: transform .25s ease; box-shadow: var(--shadow);
  max-width: 88vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

.footer { max-width: 760px; margin: 30px auto 0; padding: 20px 14px 10px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.footer .shopname { font-family: 'Kanit', sans-serif; font-size: 16px; font-weight: 700; color: var(--ink); }
.footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer .contacts { display: flex; gap: 10px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.footer .contacts a {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 12.5px;
}