: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;
}

/* ===================== TOP NAV ===================== */
.topnav {
  position: sticky; top: 0; z-index: 45;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 248, 239, .92); backdrop-filter: blur(8px);
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.topnav .nav-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topnav .nav-brand .logo { font-size: 24px; }
.topnav .nav-brand b { font-family: 'Kanit', sans-serif; font-size: 16px; display: block; line-height: 1.1; }
.topnav .nav-brand small { display: block; font-size: 10.5px; color: var(--muted); }
.topnav .nav-links { flex: 1; display: flex; gap: 6px; justify-content: flex-end; overflow-x: auto; scrollbar-width: none; }
.topnav .nav-links::-webkit-scrollbar { display: none; }
.topnav .nav-links a { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.topnav .nav-links a:hover, .topnav .nav-links a.active { background: var(--accent); color: #fff; }
.nav-cart {
  border: 0; background: var(--ink); color: #fff; font-family: 'Prompt', sans-serif;
  font-size: 13px; font-weight: 600; padding: 8px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.nav-cart span { background: var(--accent); border-radius: 50%; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; margin-left: 4px; }

/* ===================== HERO ===================== */
.hero {
  position: relative;
  background: linear-gradient(150deg, #d2232a 0%, #e2342a 45%, #f6a821 130%);
  color: #fff;
  padding: 46px 20px 74px;
  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-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.hero-icon { font-size: 46px; margin-bottom: 6px; }
.hero .brand { font-family: 'Kanit', sans-serif; font-size: 36px; font-weight: 900; letter-spacing: 1px; }
.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 { margin-top: 10px; font-size: 14.5px; opacity: .95; }
.hero .hours { margin-top: 6px; font-size: 12.5px; opacity: .85; }
.hero-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.hero-wave { position: absolute; bottom: -1px; left: 0; right: 0; height: 34px; background: var(--bg); border-radius: 40px 40px 0 0; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Prompt', sans-serif; font-weight: 600; font-size: 14px;
  padding: 11px 18px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform .1s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.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-line { background: #06c755; color: #fff; }

/* ===================== SECTION ===================== */
.sec-title { font-family: 'Kanit', sans-serif; font-size: 26px; font-weight: 700; text-align: center; }
.sec-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ===================== ABOUT ===================== */
.about, .menu, .contact { max-width: 820px; margin: 0 auto; padding: 34px 16px 6px; }
.about-cards {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px;
}
@media (min-width: 640px) { .about-cards { grid-template-columns: repeat(4, 1fr); } }
.hl-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px; text-align: center; box-shadow: var(--shadow);
}
.hl-card .hl-icon { font-size: 34px; }
.hl-card .hl-title { font-weight: 700; font-size: 14px; margin-top: 6px; }
.hl-card .hl-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.about-story { margin-top: 16px; background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.about-story p { font-size: 13.5px; color: #5b4632; line-height: 1.8; margin-bottom: 8px; }
.about-story p:last-child { margin-bottom: 0; }
.about-story p::before { content: '▸ '; color: var(--accent); }

/* ===================== TOOLBAR ===================== */
.toolbar { position: sticky; top: 56px; z-index: 30; background: var(--bg); padding: 12px 0 8px; }
.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 { padding: 6px 0 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; }
.ws {
  display: inline-flex; align-items: center; gap: 4px;
  background: #e8f3ff; color: #0b5cad; border: 1px solid #cfe4fa;
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; margin-top: 7px;
}
.prod-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.prod-detail-btn { border: 0; background: transparent; color: var(--accent); font-family: 'Prompt', sans-serif; font-weight: 600; font-size: 11.5px; cursor: pointer; padding: 0; margin-top: 2px; text-decoration: underline; }
.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; }

.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; }

/* ===================== CONTACT ===================== */
.contact-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
@media (min-width: 640px) { .contact-cards { grid-template-columns: repeat(4, 1fr); } }
.contact-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px; text-align: center; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
}
.contact-card .cc-icon { font-size: 30px; }
.contact-card .cc-title { font-weight: 700; font-size: 13.5px; margin-top: 6px; }
.contact-card .cc-val { font-size: 12px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.map { margin-top: 14px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.map iframe { display: block; width: 100%; height: 240px; border: 0; }

/* ===================== 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 ===================== */
.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; }
.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; }

/* ===================== DETAIL SHEET ===================== */
.detail-hero { text-align: center; padding: 6px 0 10px; }
.detail-hero .d-icon { font-size: 52px; }
.detail-hero .d-name { font-family: 'Kanit', sans-serif; font-size: 21px; font-weight: 700; margin-top: 4px; }
.detail-hero .d-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.detail-hero .d-price { font-family: 'Kanit', sans-serif; font-size: 24px; font-weight: 800; color: var(--accent); margin-top: 6px; }
.detail-hero .d-price .ask { font-size: 13px; color: var(--muted); }
.detail-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.detail-row { background: var(--surface); border-radius: 12px; padding: 10px 12px; border: 1px solid var(--line); }
.detail-row .dr-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.detail-row .dr-val { font-size: 13.5px; margin-top: 2px; }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; }
.detail-actions .btn { flex: 1; justify-content: center; }

.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: 820px; margin: 30px auto 0; padding: 20px 16px 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;
}