/* 層次：商品列表(0) < 頂部列(10) < 底部訂購單列(20) < 背景遮罩(30) < 訂購單(40) < 提示(50) */
:root {
  --bg: #FFFBF3;
  --card: #FFFFFF;
  --text: #1C1C1C;
  --muted: #4A4A4A;
  --brand: #7A3E00;
  --brand-soft: #FFF0C2;
  --line: #047A35;      /* 比 LINE 綠深一點，白字才看得清楚 */
  --line-dark: #035C28;
  --border: #6B6B6B;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 21px;
  line-height: 1.55;
}
body.has-cart main { padding-bottom: 120px; }
body.sheet-open { overflow: hidden; }
[hidden] { display: none !important; }

.preview-banner {
  background: #B00020; color: #fff; text-align: center; padding: 10px; font-size: 19px;
}
.preview-banner a { color: #fff; font-weight: bold; }

/* 頂部列 */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--brand); color: #fff;
  padding: 10px 14px 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
}
.top h1 { margin: 0 0 8px; font-size: 26px; text-align: center; }
.cat-tabs { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }

main { max-width: 640px; margin: 0 auto; padding: 12px 14px 40px; }
.how {
  background: #fff; border: 2px solid var(--brand); border-radius: var(--radius);
  padding: 12px 14px; margin: 6px 0 14px; font-size: 21px; font-weight: bold;
}
.cat-title {
  font-size: 26px; margin: 26px 0 12px; padding-left: 12px; border-left: 8px solid var(--brand);
}
.foot-note { color: var(--muted); text-align: center; margin-top: 24px; }

/* 商品卡 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  margin-bottom: 22px; overflow: hidden;
}
.card-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eee; }
.card-body { padding: 14px 16px 18px; }
.card-name { font-size: 28px; margin: 0 0 4px; }
.card-desc { margin: 4px 0 8px; color: var(--muted); }
.demo-tag {
  display: inline-block; margin: 2px 0 6px; padding: 2px 10px;
  background: #FFE08A; color: #5A3B00; border-radius: 8px; font-size: 18px; font-weight: bold;
}
.label { margin: 14px 0 6px; font-weight: bold; font-size: 20px; }

/* 按鈕共用：整顆都可以按 */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 60px; padding: 10px 16px;
  font: inherit; font-weight: bold; font-size: 22px;
  border-radius: 12px; border: 3px solid transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:focus-visible { outline: 4px solid #1E5BFF; outline-offset: 3px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-tab { background: #fff; color: var(--brand); min-height: 56px; font-size: 21px; }

.opts { display: grid; gap: 10px; }
.btn-opt {
  justify-content: flex-start; background: #fff; color: var(--text);
  border-color: var(--border); min-height: 64px; text-align: left;
}
.btn-opt .opt-mark {
  flex: 0 0 34px; height: 34px; border: 3px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.btn-opt .opt-label { flex: 1; }
.btn-opt .opt-price { font-size: 22px; }
.btn-opt.on { background: var(--brand-soft); border-color: var(--brand); border-width: 4px; }
.btn-opt.on .opt-mark { background: var(--brand); border-color: var(--brand); }

.qty-row { display: flex; align-items: center; gap: 12px; }
.btn-qty {
  width: 72px; flex: 0 0 72px; min-height: 64px; font-size: 32px;
  background: #fff; color: var(--text); border-color: var(--border);
}
.qty-num { min-width: 64px; text-align: center; font-size: 32px; font-weight: bold; }

.card-price {
  margin: 16px 0 12px; padding: 10px 12px; background: #FFF6E0; border-radius: 10px;
  font-size: 21px;
}
.card-price .price-num { font-size: 34px; color: #B3261E; }

.btn-line { background: var(--line); color: #fff; margin-bottom: 10px; min-height: 66px; font-size: 24px; }
.btn-line:hover { background: var(--line-dark); }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }

/* 底部訂購單列 */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,251,243,.97); box-shadow: 0 -3px 10px rgba(0,0,0,.2);
}
.btn-cart {
  max-width: 640px; margin: 0 auto; justify-content: space-between;
  background: var(--brand); color: #fff; min-height: 68px; font-size: 21px;
}
.cart-go { white-space: nowrap; background: #fff; color: var(--brand); border-radius: 8px; padding: 4px 10px; }

/* 訂購單 */
.backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); }
.sheet {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  max-width: 640px; margin: 0 auto; max-height: 92vh;
  background: var(--bg); border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -6px 20px rgba(0,0,0,.35);
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 2px solid #E3D6BF;
}
.sheet-head h2 { margin: 0; font-size: 26px; }
.btn-close { width: auto; background: #fff; color: var(--text); border-color: var(--border); min-height: 56px; }
.cart-list { overflow-y: auto; padding: 8px 16px; flex: 1; }
.cart-item { background: #fff; border-radius: 12px; padding: 12px 14px; margin: 10px 0; box-shadow: 0 1px 5px rgba(0,0,0,.12); }
.ci-name { margin: 0; font-size: 24px; font-weight: bold; }
.ci-opt { margin: 2px 0 8px; color: var(--muted); }
.ci-sub { margin: 8px 0; font-size: 22px; font-weight: bold; }
.btn-del { background: #fff; color: #9B1C1C; border-color: #9B1C1C; min-height: 54px; font-size: 20px; }
.empty { text-align: center; color: var(--muted); padding: 20px; }
.sheet-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 2px solid #E3D6BF; }
.cart-total { margin: 0; font-size: 24px; text-align: right; }
.cart-total strong { font-size: 34px; color: #B3261E; }
.small { margin: 2px 0 10px; font-size: 18px; color: var(--muted); }

/* 提示 */
.toast {
  position: fixed; z-index: 50; left: 50%; top: 30%; transform: translateX(-50%);
  width: min(90vw, 520px); background: #1C1C1C; color: #fff; text-align: center;
  padding: 16px 18px; border-radius: 14px; font-size: 22px; font-weight: bold;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
