:root {
  --red: #E63D2E;
  --red-dark: #c42f22;
  --brown: #6B2E28;
  --ink: #3a2320;
  --muted: #8a716c;
  --bg: #faf5ee;
  --bg-alt: #f3ebe0;
  --card: #fffdf9;
  --line: #e6d9cb;
  --green: #06c755;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(107, 46, 40, .10);
  --serif: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); color: var(--brown); margin: 0; line-height: 1.25; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(250, 245, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brown); font-family: var(--serif); font-weight: 900; font-size: 1.25rem; white-space: nowrap; }
.brand img { border-radius: 50%; background: #fff; }
.brand small { font-size: .7rem; font-weight: 600; margin-left: 6px; padding: 2px 6px; background: var(--brown); color: #fff; border-radius: 4px; vertical-align: middle; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--red); }
.cart-btn { border: 0; background: var(--brown); color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.cart-btn:hover { background: var(--ink); }
.cart-count { background: var(--red); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; font-size: .8rem; display: inline-grid; place-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 2px solid transparent; border-radius: 999px; padding: 11px 22px; font-weight: 700; text-decoration: none; transition: background .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { background: #d8c9bd; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--brown); color: var(--brown); }
.btn-ghost:hover { background: rgba(107, 46, 40, .07); }
.btn-line { background: var(--green); color: #fff; }
.btn-line:hover { background: #05a847; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-row .btn { flex: 1; padding-inline: 12px; }
.btn-row .btn[hidden] { display: none; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; margin: 12px auto 0; display: block; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1fr 1.15fr; gap: 44px; align-items: center; }
.eyebrow { letter-spacing: .3em; font-size: .8rem; color: var(--red); font-weight: 700; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); font-weight: 900; }
.lead { margin: 20px 0 28px; font-size: 1.05rem; color: var(--ink); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-img { border-radius: 20px; box-shadow: var(--shadow); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- Sections ---------- */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 26px; }
.section-head h2 { font-size: 2rem; font-weight: 900; display: inline-block; padding-bottom: 6px; border-bottom: 4px solid var(--red); }
.section-head p { margin-top: 12px; color: var(--muted); }
.cat-title { font-size: 1.15rem; margin: 30px 0 14px; padding-left: 12px; border-left: 4px solid var(--brown); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 18px; font-weight: 500; white-space: nowrap; }
.chip[aria-selected="true"] { background: var(--brown); border-color: var(--brown); color: #fff; }

/* ---------- 門市線上點餐 ---------- */
.order-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.order-card h3 { font-size: 1.25rem; }
.order-card p { font-size: .88rem; }
.order-card .btn { white-space: nowrap; }
.menu-title { font-size: 1.4rem; margin: 40px 0 14px; }
.menu-note { margin-top: 22px; }

/* ---------- Product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.grid.gift { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--bg-alt); }
.card-ph { aspect-ratio: 4 / 3; display: grid; place-items: center; background: repeating-linear-gradient(135deg, #f3e6d8 0 14px, #efe0d0 14px 28px); font-family: var(--serif); font-weight: 900; font-size: 1.6rem; color: rgba(107, 46, 40, .45); letter-spacing: .15em; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 1.15rem; }
.card-desc { color: var(--muted); font-size: .9rem; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.price { font-weight: 700; color: var(--red); font-size: 1.1rem; }
.price small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.add { border: 0; background: var(--red); color: #fff; border-radius: 999px; padding: 7px 16px; font-weight: 700; white-space: nowrap; }
.add:hover { background: var(--red-dark); }
.tag { align-self: flex-start; font-size: .72rem; background: #fde7e3; color: var(--red-dark); padding: 2px 8px; border-radius: 4px; font-weight: 700; }

/* ---------- Stores ---------- */
.stores { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.store { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.store h3 { font-size: 1.3rem; margin-bottom: 10px; }
.store dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.store dt { color: var(--muted); }
.store dd { margin: 0; }
.store a { color: var(--red-dark); font-weight: 700; text-decoration: none; }
.delivery-note { margin-top: 20px; padding: 14px 18px; background: var(--bg-alt); border-radius: var(--radius); font-size: .95rem; }
.delivery-note strong { color: var(--brown); margin-right: 10px; }

.site-footer { background: var(--brown); color: #f5e6de; padding: 28px 0; text-align: center; font-size: .9rem; }
.site-footer .muted { color: #cfb0a8; margin-top: 4px; }

/* ---------- Option modal ---------- */
.modal { border: 0; border-radius: 18px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal::backdrop { background: rgba(58, 35, 32, .55); }
.modal-body { padding: 24px; position: relative; }
.modal-body h3 { font-size: 1.4rem; margin-bottom: 16px; padding-right: 30px; }
.close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.close:hover { background: var(--bg-alt); }
.opt-group { margin-bottom: 16px; }
.opt-group h4 { margin: 0 0 8px; font-size: .9rem; color: var(--muted); font-weight: 500; }
.opt-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-choices label { cursor: pointer; }
.opt-choices input { position: absolute; opacity: 0; }
.opt-choices span { display: block; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: .95rem; }
.opt-choices input:checked + span { background: var(--brown); border-color: var(--brown); color: #fff; }
.opt-choices input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.opt-foot { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.opt-foot .btn { flex: 1; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; font-size: 1.1rem; color: var(--brown); }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; }

/* ---------- Cart drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(58, 35, 32, .5); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); background: var(--bg); z-index: 40; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; box-shadow: -10px 0 40px rgba(0, 0, 0, .18); visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.drawer-head { position: relative; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 1.3rem; }
.drawer-step { flex: 1; display: flex; flex-direction: column; min-height: 0; margin: 0; }
.drawer-step[hidden] { display: none; }
.drawer-scroll { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.fee-row { display: flex; justify-content: space-between; font-size: .92rem; color: var(--muted); margin-bottom: 4px; }
.fee-row[hidden] { display: none; }
.total-row strong { font-size: 1.4rem; color: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.line-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.line-item .li-name { font-weight: 700; }
.line-item .li-opt { color: var(--muted); font-size: .85rem; }
.line-item .li-price { font-weight: 700; text-align: right; }
.line-item .li-ctrl { display: flex; align-items: center; gap: 12px; }
.li-remove { border: 0; background: none; color: var(--muted); font-size: .85rem; text-decoration: underline; padding: 0; }

/* ---------- Form ---------- */
.field { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; padding: 0; color: var(--brown); }
.field input[type=text], .field input[type=tel], .field input[type=date], .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: transparent; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row[hidden], .field[hidden] { display: none; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 9px 4px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-weight: 500; color: var(--ink); }
.seg input:checked + span { background: var(--brown); border-color: var(--brown); color: #fff; }
.seg input:disabled + span { opacity: .4; cursor: not-allowed; }
.seg input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.error { color: var(--red-dark); background: #fde7e3; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }

.done-lead { font-weight: 500; margin-bottom: 14px; }
.order-text { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; white-space: pre-wrap; word-break: break-word; font-family: var(--sans); font-size: .9rem; margin: 0; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; white-space: nowrap; font-size: .95rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .nav { display: none; }
  .cart-btn { margin-left: auto; }
  .hero { padding: 28px 0 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .hero-img { order: -1; }
  .section { padding: 44px 0; }
  .grid, .grid.gift { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .order-bar { grid-template-columns: 1fr; }
  .order-card .btn { width: 100%; }
  .card-body { padding: 10px 12px 12px; }
  .card-body h3 { font-size: 1rem; }
  .card-desc { display: none; }
  .grid.gift .card-desc { display: block; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .add { padding: 8px; }
}
@media (max-width: 420px) {
  .grid.gift { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
