:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --ink: #3b2f24;
  --muted: #6b5c4b;
  --green: #3f5d3a;
  --green-dark: #2e4729;
  --accent: #a8501f;
  --line: #e4d9c5;
  --radius: 14px;
  /* 字型用手機、電腦內建的（Android 內建就是 Noto Sans／Noto Serif CJK，iPhone 是蘋方），不另外下載：
     以前從 Google 下載 2MB 字型，網路慢時把網站程式擠到 27 秒後才到 */
  --serif: "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "Noto Sans CJK TC", "Source Han Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 18px; scroll-behavior: smooth; overflow-x: hidden; }   /* 左右滑換頁時內容被推出畫面，不要讓整頁變寬、手機跟著縮小晃動 */
body {
  overflow-x: clip;   /* 同上：手機（Chrome）只看 html 的 hidden 還是會變寬，clip 不影響頁首黏在上面 */
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.8;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.4; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-title { text-align: center; font-size: 1.6rem; letter-spacing: .15em; margin-bottom: 32px; }
.section-title::after {
  content: ""; display: block; width: 48px; height: 2px;
  background: var(--green); margin: 14px auto 0;
}
.center { text-align: center; }
.muted { color: var(--muted); }

/* 按鈕 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border: 2px solid var(--green); border-radius: 999px;
  background: var(--green); color: #fff;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn-outline { background: transparent; color: var(--green); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-line { background: #06c755; border-color: #06c755; }
.share-row { margin: 16px 0 0; }
.btn-share { min-width: 220px; }
@media (max-width: 760px) { .btn-share { width: 100%; } }
/* 手機點過後 hover 會黏住，按鈕看起來像不能按；只在有滑鼠的裝置套用 */
@media (hover: hover) {
  .btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
  .btn-outline:hover { background: var(--green); color: #fff; }
  .btn-line:hover { background: #05a647; border-color: #05a647; }
  .qty button:hover { background: var(--bg); }
}
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #d9a441; outline-offset: 2px;
}

/* 頁首 */
/* 頁首的字放大有上限（clamp）：內文照樣放大，頁首不會大到佔掉整個畫面 */
.draft-bar { background: #7a3e1a; color: #fff; text-align: center; font-size: clamp(13px, .85rem, 18px); padding: 4px 12px; }
.notice { background: var(--green); color: #fff; text-align: center; font-size: clamp(14px, .9rem, 20px); padding: 6px 12px; letter-spacing: .05em; }
.notice { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1.2em; }
.notice-draft { color: #f6dcb8; }   /* 試營運中：淡橘色，跟免運字樣分得出來 */   /* 放不下時整段換行，不會只掉一個字下去 */
/* 色帶上的電話：只有電腦版（頁首放不下電話按鈕）才出現；手機、平板頁首有電話按鈕 */
.notice-phone { display: none; color: #fff; text-underline-offset: 3px; white-space: nowrap; }
@media (min-width: 1101px) { .notice-phone { display: inline; } }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 8px 24px; min-height: 72px; flex-wrap: wrap; }   /* 字放很大時購物車換到下一行，不會被擠出畫面 */
.brand { display: flex; align-items: center; min-height: 44px; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: .1em; }
.brand svg { width: 34px; height: 34px; flex: none; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--green); color: var(--green); }
.cart-link {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
}
/* 頁首的電話按鈕（手機、平板才有；電腦版電話在頁尾） */
.call-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; white-space: nowrap; text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-weight: 500;
}
.call-link svg { width: 20px; height: 20px; flex: none; color: var(--green); }
@media (min-width: 1101px) { .call-link { display: none; } }
@media (max-width: 760px) { .call-link { margin-left: auto; font-size: clamp(15px, .95rem, 18px); } }
@media (max-width: 400px) {
  .call-link { width: 44px; padding: 0; justify-content: center; }
  .call-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .call-link svg { width: 22px; height: 22px; }
}
.cart-count {
  min-width: max(26px, 1.7em); height: max(26px, 1.7em); padding: 0 .4em; border-radius: 999px; line-height: 1;   /* 字放大時數字不會被切掉 */
  background: var(--accent); color: #fff; font-size: .8rem;
  display: inline-flex; align-items: center; justify-content: center;
}

/* 首頁主視覺 */
.hero { padding: 48px 0; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.4rem; letter-spacing: .12em; overflow-wrap: anywhere; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 26em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-art {
  aspect-ratio: 4 / 3; border-radius: 24px;
  background: linear-gradient(135deg, #d9c9a3, #a9b48a 55%, #6f8a5c);
  display: flex; align-items: flex-end; justify-content: flex-end; padding: 16px;
  color: rgba(255, 255, 255, .85); font-size: .85rem;
}

/* 三個承諾 */
.promises { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1000px) and (min-width: 761px) { .promises { grid-template-columns: repeat(2, 1fr); } }
/* 「蝦皮老店」那張整張可以點，跳到下面的好評區 */
a.promise-link { text-decoration: none; color: inherit; border-color: #f3b8a8; }
a.promise-link:hover { border-color: #ee4d2d; }
.promise-more { display: block; margin-top: 4px; color: #c53d1f; font-weight: 500; }
#reviews { scroll-margin-top: 90px; }
.promise { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.promise svg { width: 44px; height: 44px; margin: 0 auto 10px; display: block; }
.promise h3 { font-size: 1.15rem; margin-bottom: 4px; }
.promise p { margin: 0; color: var(--muted); font-size: .95rem; }

/* 分類方塊 */
.cat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-tile {
  display: block; text-decoration: none; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 12px;
}
.cat-tile:hover { border-color: var(--green); }
.cat-tile strong { display: block; font-family: var(--serif); font-size: 1.25rem; letter-spacing: .1em; }
.cat-tile span { color: var(--muted); font-size: .9rem; }

/* 商品卡 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-media { display: block; text-decoration: none; }
.card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 1.1rem; margin: 0; }
.card h3 a { text-decoration: none; display: inline-block; padding: 10px 0; margin: -10px 0; }
.card h3 a:hover { color: var(--green); }
.tags { color: var(--green); font-size: .82rem; margin: 0 0 4px; }
.spec { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { color: var(--accent); font-family: var(--serif); font-weight: 700; font-size: 1.25rem; }

/* 沒有照片時的色塊 */
.ph {
  aspect-ratio: 1 / 1; width: 100%;
  background: var(--ph, #c9b48f);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .28), rgba(0, 0, 0, .12));
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.ph-name { font-family: var(--serif); font-size: 1.5rem; letter-spacing: .15em; padding: 0 12px; text-align: center; }
.ph-note { font-size: .78rem; opacity: .9; }
/* 商品卡：統一直式 4:5 外框；照片整張顯示、不裁切（照片上有文字），空白處用底色補 */
.card-media img, .card-media .ph { aspect-ratio: 4 / 5; width: 100%; }
.card-media img { object-fit: contain; background: var(--surface); }
/* 商品頁：照片依原比例整張顯示 */
/* 商品頁：跟商品卡一樣先留好 4:5 的框，照片整張放進去（不裁切），載入後下面的字不會被推走 */
.product-media img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; background: var(--surface); }

/* 篩選 */
.filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 28px; }
.chip {
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; display: inline-flex; align-items: center;
}
.chip[aria-current="true"] { background: var(--green); border-color: var(--green); color: #fff; }

/* 商品頁 */
.crumbs { font-size: .9rem; color: var(--muted); padding: 20px 0 0; word-break: keep-all; overflow-wrap: anywhere; }
.prefill-note { background: #eef3e8; border-radius: 10px; padding: 8px 12px; margin: 0 0 14px; color: var(--green-dark); }
.crumbs a { text-decoration: none; display: inline-block; padding: 10px 0; }
.crumbs a:hover { text-decoration: underline; }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 24px 0 40px; }
.product-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); align-self: start; }
.product-media .ph-name { font-size: 2.2rem; }
.product h1 { font-size: 1.8rem; }
.product .price { font-size: clamp(24px, 1.8rem, 48px); display: block; margin: 8px 0 16px; }   /* 字放很大時價格不要寬過畫面 */
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.qty button { width: 48px; height: 48px; border: 0; background: none; font-size: clamp(20px, 1.4rem, 30px); cursor: pointer; color: var(--ink); border-radius: 999px; }
.qty output { min-width: 36px; text-align: center; font-weight: 500; }
.info { border-top: 1px solid var(--line); margin-top: 24px; }
.info dl { margin: 0; }
.info dt { font-family: var(--serif); font-weight: 700; padding-top: 16px; }
.info dd { margin: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--muted); }

/* 一般內容頁 */
.prose { max-width: 720px; margin: 0 auto; }
.prose h1 { font-size: 2rem; letter-spacing: .12em; text-align: center; margin-bottom: 32px; }
.prose h2 { font-size: 1.3rem; margin-top: 1.8em; padding-left: 12px; border-left: 4px solid var(--green); }
.prose li { margin-bottom: .4em; }
.sample { background: #fbf3dc; border: 1px dashed #d9a441; border-radius: 10px; padding: 12px 16px; font-size: .9rem; color: #6b4a12; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; counter-increment: step; }
.steps li::before {
  content: counter(step); display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff;
  font-family: var(--serif); font-weight: 700; margin-bottom: 10px;
}
.steps strong { display: block; font-family: var(--serif); font-size: 1.1rem; }
.steps span { color: var(--muted); font-size: .95rem; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 500; }
.faq details p { color: var(--muted); }

/* 首頁：蝦皮老客人怎麼說 */
.rv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 760px; margin: 0 auto 20px; }
.rv-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 6px; text-align: center; }
.rv-stat b { display: block; font-family: var(--serif); font-size: clamp(1.35rem, 6.5vw, 1.9rem); color: var(--accent); line-height: 1.2; white-space: nowrap; }
.rv-stat span { color: var(--muted); font-size: .95rem; }
.rv-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 960px; margin: 0 auto; }
.rv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0; }
.rv-stars { color: #e8a317; font-size: 1.15rem; letter-spacing: .1em; }
.rv p { font-size: 1.15rem; line-height: 1.7; margin: 6px 0 8px; }
.rv footer { color: var(--muted); font-size: .9rem; }
.rv-src { max-width: 760px; margin: 16px auto 0; color: var(--muted); font-size: .9rem; text-align: center; }
.rv-proof { max-width: 760px; margin: 8px auto 0; }
.rv-proof summary { cursor: pointer; text-align: center; color: var(--green); font-weight: 500; padding: 12px; min-height: 48px; }
.rv-proof img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
@media (max-width: 760px) { .rv-list { grid-template-columns: 1fr; } }

.story { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.story .wrap { max-width: 760px; text-align: center; }

/* 購物車 */
.cart-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; padding-bottom: 56px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h2 { font-size: 1.25rem; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item .ph, .cart-item img { border-radius: 10px; }
.cart-item .ph, .cart-item img { width: 72px; height: 72px; aspect-ratio: auto; }
.cart-item img { object-fit: contain; background: var(--surface); }
.cart-item .ph-name { font-size: .8rem; letter-spacing: 0; }
.cart-item .ph-note { display: none; }
.cart-item h3 { font-size: 1rem; margin: 0; font-family: var(--sans); font-weight: 500; }
.cart-item .line-total { font-weight: 500; text-align: right; }
.cart-item .controls { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-btn { border: 0; background: none; color: var(--muted); font: inherit; font-size: .9rem; text-decoration: underline; cursor: pointer; min-height: 44px; }
.cart-item > div { min-width: 0; }
.cart-item .muted, .cart-item .tier-hint { word-break: keep-all; overflow-wrap: anywhere; }
.line-notes { grid-column: 2 / -1; }
.line-notes > strong, .line-notes > span { display: block; }
.goto-submit { margin-top: 8px; }
.qty button:disabled { opacity: .35; cursor: default; }
a.link-btn { display: inline-flex; align-items: center; }   /* 連結做的 link-btn 也要 44px 高才好點 */

.remove-btn { min-height: 44px; padding: 0 18px; border: 1px solid #cdbfa6; border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: .95rem; cursor: pointer; white-space: nowrap; }
.totals { margin: 16px 0 0; }
.totals div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 4px 0; }
.totals dt { white-space: nowrap; }
.totals dd { white-space: nowrap; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 1.2rem; font-weight: 700; }
.totals .grand dd { color: var(--accent); }
.totals dd { margin: 0 0 0 auto; }   /* 金額靠右；換到下一行時也靠右 */
.hint { font-size: .95rem; color: var(--muted); margin: 6px 0 0; }
.map-btn { margin-top: 10px; }
.store-help { padding-left: 1.4em; line-height: 1.7; margin: 10px 0 0; }
.store-help li { margin-bottom: 2px; }
/* 用超商地圖選好的門市（購物車、改單） */
.cvs-store { margin: 8px 0 0; padding: 12px 14px; border: 2px solid var(--green); border-radius: 10px; background: var(--surface); line-height: 1.6; }
.cvs-brand { display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--green); color: #fff; font-size: .85em; }
@media (max-width: 760px) { .map-btn { width: 100%; } }

.field { margin-bottom: 18px; }
.field label, .field legend { display: block; font-weight: 500; margin-bottom: 6px; padding: 0; }
.field label + .hint { margin: 0 0 6px; }
.field-error { color: #b8381f; font-weight: 700; font-size: 1rem; margin: 6px 0 0; }
/* 手機打對 10 個數字時把號碼放大讓客人核對 */
.phone-check { font-size: 1rem; color: var(--green); margin: 6px 0 0; }
.phone-check:empty { display: none; }
.phone-check strong { display: inline-block; font-size: 1.35rem; letter-spacing: .06em; }
/* 前面加 form，才比下面的 .field input[type="tel"] 優先 */
form .field input[aria-invalid="true"], form .field textarea[aria-invalid="true"] { border: 2px solid #b8381f; background: #fff7f5; }
.field input[type="text"], .field input[type="tel"], .field textarea {
  width: 100%; min-height: 52px; padding: 10px 14px; font: inherit;
  border: 1px solid #cdbfa6; border-radius: 10px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; }
/* 寫成 .field .radio，才不會被上面 .field label 的 display:block 蓋掉（圓圈和文字會錯開） */
.radio, .check, .field .radio { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; cursor: pointer; font-weight: 400; }
.radio input, .check input { width: 28px; height: 28px; margin: 0; accent-color: var(--green); flex: none; }
.radio:has(input:checked) { border: 2px solid var(--green); background: #eef3e8; font-weight: 700; }
.radio-text { flex: 1; min-width: 0; line-height: 1.5; }
.radio-fee { display: block; color: var(--muted); font-size: .9rem; font-weight: 400; }
.check { border: 0; background: none; padding: 0; }
.req { color: var(--accent); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-sending { background: #eef3e8; border: 1px solid #b9c9a9; color: var(--green-dark); border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; font-size: 1.05rem; font-weight: 700; }
.form-error { background: #fbe9e4; border: 1px solid #e3a594; color: #8a2e17; border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; }
.load-error { background: #fbe9e4; color: #8a2e17; text-align: center; padding: 16px; margin: 0; }
.load-error p { margin: 0 0 10px; }
.load-error .btn { min-width: min(12em, 100%); }
.order-id { font-size: clamp(18px, 1.2rem, 28px); }
#order-sent h2 { overflow-wrap: anywhere; }
.seg { display: inline-block; }   /* 一段文字整段換行（例如「訂單送出了，」「謝謝你！」） */
.order-id strong { color: var(--accent); letter-spacing: .05em; display: inline-block; }   /* 編號整串一起換行；字非常大時才在「-」斷開 */
/* 電話：不要從中間斷行；上下加大，手指好點 */
a[href^="tel:"]:not(.btn):not(.call-link):not(.notice-phone) { white-space: nowrap; display: inline-block; padding: 10px 0; }
.call-btn { width: 100%; margin-top: 8px; flex-wrap: wrap; column-gap: .4em; text-align: center; padding: 6px 12px; border-radius: 24px; }
.nowrap { white-space: nowrap; }
.order-details { margin: 16px 0; }
.order-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 500; color: var(--green); }
.order-details summary::before { content: "▸"; margin-right: 8px; }
.order-details[open] summary::before { content: "▾"; }
.order-total { font-size: 1.15rem; margin: 4px 0; }
.order-total strong, .submit-total strong { color: var(--accent); font-size: 1.2em; }
.order-lines { margin: 0 0 12px; padding-left: 1.2em; }
.submit-total { font-size: 1.1rem; font-weight: 500; margin: 0 0 4px; }
.cart-item h3 a { text-decoration: none; display: inline-block; padding: 12px 0; margin: -12px 0; }
.guide-link, .hint a:not(.btn) { display: inline-block; padding: 12px 0; margin: -12px 0; }
.recent-order { max-width: 560px; margin: 0 auto 8px; text-align: left; }
.recent-order .btn { margin-top: 8px; }
.btn:disabled { opacity: .6; cursor: wait; }

/* 頁首、頁尾由 site.js 畫：還沒畫之前先佔好頁首的高度，畫上去時下面的內容不會被往下推 */
#site-header:empty { min-height: 7.95rem; background: linear-gradient(var(--green) 0 2.25rem, var(--surface) 2.25rem); border-bottom: 1px solid var(--line); }
@media (min-width: 1101px) { #site-header:empty { min-height: 6.35rem; } }
@media (max-width: 760px) { #site-header:empty { min-height: 7.75rem; } }

/* 從試算表讀資料時，先顯示「載入中」灰塊（body 加上 ready 前；ready 是 site.js 讀完資料才加）
   首頁、所有商品、認識油甘果：只在還沒有商品的格子裡放灰塊（用 ::before，格子本身不動，
   商品一放進去灰塊自己消失，Chrome 不會算成版面跳動）；大標題這些固定文字照常顯示。
   購物車、商品頁內容全靠資料：整塊先用灰塊。
   所有商品、購物車、商品頁的灰塊至少一個畫面高：頁尾一開始就在畫面外，內容出來時不會被推走 */
body:not(.ready) #grid:empty::before, body:not(.ready) #featured:empty::before, body:not(.ready) #yougan-grid:empty::before,
body:not(.ready)[data-page="cart"] main::before, body:not(.ready)[data-page="product"] main::before {
  content: "載入中，請稍候…"; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.2rem;
  height: 340px; grid-column: 1 / -1;
  background: repeating-linear-gradient(90deg, #ebe3d1 0, #ebe3d1 calc(25% - 15px), transparent calc(25% - 15px), transparent 25%);
  border-radius: var(--radius); animation: skeleton 1.4s ease-in-out infinite;
}
body:not(.ready) #grid:empty::before { height: calc(100vh - 120px); }
body:not(.ready) #filters:empty { min-height: 44px; }   /* 分類按鈕列先留高度 */
body:not(.ready) #site-footer { display: none; }   /* 頁尾等資料到了才出現：內容長短還不知道，先出現會被推來推去 */
body:not(.ready)[data-page="cart"] main > *, body:not(.ready)[data-page="product"] main > * { visibility: hidden; }
/* 商品頁：灰塊上面的空白放在 main 的內距（不用 margin：margin 會穿出 main，把整個 main 往下推，資料到時又縮回來） */
body:not(.ready)[data-page="product"] main { padding-top: 40px; }
body:not(.ready)[data-page="product"] main::before { width: calc(100% - 40px); max-width: 1080px; height: 100vh; margin: 0 auto; }
/* 購物車：內容雖然藏著但照樣佔位置，灰塊蓋在上面、不另外佔位置，資料到時頁尾才不會跑 */
body:not(.ready)[data-page="cart"] main { position: relative; }
body:not(.ready)[data-page="cart"] main::before { position: absolute; top: 40px; left: 20px; right: 20px; max-width: 1080px; margin: 0 auto; z-index: 1; }
@keyframes skeleton { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (max-width: 760px) {
  body:not(.ready) #grid:empty::before, body:not(.ready) #featured:empty::before, body:not(.ready) #yougan-grid:empty::before,
  body:not(.ready)[data-page="cart"] main::before, body:not(.ready)[data-page="product"] main::before {
    background: repeating-linear-gradient(90deg, #ebe3d1 0, #ebe3d1 calc(50% - 6px), transparent calc(50% - 6px), transparent 50%);
  }
}
/* 訂單送出中：購物車的數量、移除先變淡（按了會提示不能改） */
.is-sending .qty button, .is-sending .remove-btn { opacity: .45; }

.order-text { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-family: var(--sans); font-size: .95rem; line-height: 1.7; margin: 0 0 16px; }
.order-actions { display: grid; gap: 12px; }
.empty { text-align: center; padding: 72px 0; }

/* 頁尾 */
.site-footer { background: #3b2f24; color: #e9dfcc; margin-top: 40px; padding: 40px 0 28px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h3 { font-size: 1.05rem; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { text-decoration: none; }
.site-footer ul a, .copyright a { display: inline-block; padding: 10px 0; }
.site-footer li { line-height: 1.5; }
.site-footer a:hover { text-decoration: underline; }
.copyright { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 28px; padding-top: 16px; text-align: center; color: #b9ac96; font-size: .85rem; }

.toast {
  border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 10px 16px;
  background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 24px; font-size: 1.05rem; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.top { top: calc(16px + env(safe-area-inset-top)); bottom: auto !important; }   /* 不接手指：後面的按鈕照樣按得到 */
.toast .btn { pointer-events: auto; }
.toast .btn { min-height: 48px; background: #fff; color: var(--green-dark); border-color: #fff; font-weight: 700; }
/* 提示在懸浮購物車上面；商品頁底部購買列出現時再往上 */
.toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
.buy-bar-on .toast { bottom: calc(var(--bar-h, 76px) + 12px); }
/* 商品頁（手機）：捲到看不到購買按鈕時，底部固定一條 */
.buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(59, 47, 36, .1);
  transform: translateY(110%); transition: transform .2s;
}
.buy-bar.show { transform: none; }
.buy-bar { font-size: clamp(16px, 1rem, 22px); flex-wrap: wrap; row-gap: 8px; container-type: inline-size; }
.buy-bar-info { display: flex; flex-direction: column; min-width: 6em; flex: 1 1 0; line-height: 1.3; }   /* 至少留價格（NT$1,088）的寬度；排不下時「加入購物車」換到下一列 */
.buy-bar-name { font-size: .85em; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; overflow-wrap: anywhere; }
.buy-bar .price { font-size: 1.2em; white-space: nowrap; }
.buy-bar .btn { white-space: nowrap; padding: 0 16px; }
.toast { font-size: clamp(16px, 1.05rem, 22px); }
.buy-bar .btn { flex: 1; }
@container (max-width: 17em) {   /* 用 em：字放大時更早分兩列（一般字 360 寬的手機排成一列） */
  .buy-bar-info { flex: 1 0 100%; }
}
/* 懸浮購物車（右下角，每一頁都有，購物車頁除外） */
.float-cart {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 26;
  display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 16px;
  background: var(--accent); color: #fff; border-radius: 999px; text-decoration: none; font-weight: 700;   /* 跟綠色的按鈕不同色，疊在一起也分得出來 */
  box-shadow: 0 6px 18px rgba(59, 47, 36, .3);
  transition: bottom .2s, transform .12s, opacity .15s, visibility .15s;
}
/* 蓋到商品卡的按鈕時先讓開（site.js dodgeFloatCart）：看不到也按不到，按鈕捲開就回來 */
.float-cart-away .float-cart { opacity: 0; visibility: hidden; pointer-events: none; }   /* pointer-events 沒有淡出，馬上就按不到 */
.float-cart svg { width: 26px; height: 26px; flex: none; }
.float-cart { font-size: clamp(16px, 1rem, 22px); }   /* 字放很大時按鈕不要大到蓋住半個畫面 */
.float-cart .cart-count { background: #fff; color: var(--accent); font-weight: 700; }
.float-cart:active { transform: scale(.96); }
@media (max-width: 400px) {
  .float-cart { width: 60px; height: 60px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; }
  .float-cart > span:not(.cart-count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .float-cart svg { width: 28px; height: 28px; }
  .float-cart .cart-count { position: absolute; top: -8px; right: -8px; border: 2px solid var(--accent); font-size: clamp(12px, .8rem, 16px); min-width: 28px; height: 28px; }
}
.buy-bar-on .float-cart, .buy-row-low .float-cart { display: none; }   /* 購買列裡已經有小購物車；購買按鈕在畫面底部時不要蓋住它 */
.bar-cart {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff;
}
.bar-cart svg { width: 26px; height: 26px; }
.bar-cart .cart-count { position: absolute; top: -.45em; right: -.45em; min-width: 1.75em; height: 1.75em; font-size: .85em; font-weight: 700; background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 頁尾最後幾行不要被懸浮購物車（和購買列）蓋住 */
.site-footer { padding-bottom: 96px; }
.has-buy-bar .site-footer { padding-bottom: calc(var(--bar-h, 76px) + 24px); }

/* 手機 */
@media (max-width: 760px) {
  .section { padding: 20px 0; }
  /* 手機上標題上下的空白縮小、拿掉底下的綠色短線，商品早一點出現 */
  .section-title { font-size: 1.35rem; margin: 0 0 14px; }
  .section-title::after { display: none; }
  /* 手機上頁首只留一行選單：「油甘果」從首頁、商品分類都點得到，選單上拿掉 */
  .nav-yougan { display: none !important; }
  /* 購物須知在頁尾、購物車頁都有連結，手機選單上拿掉，剩下的排得下一行 */
  .nav-guide { display: none !important; }
  .notice { font-size: clamp(13px, .85rem, 17px); column-gap: .8em; letter-spacing: .02em; }   /* 三段排得下一行 */
  /* 選單平均排滿整行，每格一樣寬、字置中 */
  .nav { justify-content: stretch !important; }
  .nav::after { display: none; }
  .nav a { flex: 1 1 0; min-width: min-content; justify-content: center; font-size: clamp(15px, .95rem, 21px) !important; }   /* 寬度從 0 起平分，字長字短一樣寬；字放很大排不下時才撐開 */
  /* 「所有商品」頁：選單已標出在哪一頁，大標題只留給讀螢幕軟體 */
  body[data-page="products"] .section-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
  /* 分類按鈕排成一行；字放很大排不下時可以左右滑 */
  .filters { flex-wrap: nowrap; gap: 6px; justify-content: flex-start; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
  .filters > :first-child { margin-left: auto; }
  .filters > :last-child { margin-right: auto; }
  .chip { flex: 0 0 auto; padding: 0 12px; }
  .header-inner { flex-wrap: wrap; gap: 0 12px; padding-top: 10px; }
  .brand { font-size: clamp(16px, 1.1rem, 24px); letter-spacing: .02em; gap: 8px; }
  .brand svg { width: 30px; height: 30px; }
  .cart-link { margin-left: auto; padding: 0 12px; }
  .site-header { position: static; }   /* 字放大時固定的頁首會佔掉 1/4 畫面；改由右下角的懸浮購物車帶去購物車 */
  .site-header .cart-link { display: none; }   /* 右下角有懸浮購物車，頁首不用再放一個（省一整行） */
  .header-inner { min-height: 56px; }
  .brand { min-width: 0; }
  /* 一行排得下就平均分開；換行時最後一行靠左（::after 吃掉多的空間） */
  .nav { order: 3; width: 100%; margin: 0; gap: 0 8px; justify-content: space-between; flex-wrap: wrap; }
  .nav::after { content: ""; flex: 1 0 0; }
  .nav a { padding: 0 2px; font-size: clamp(15px, .95rem, 18px); min-height: 44px; display: inline-flex; align-items: center; }
  .hero { padding: 28px 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: clamp(26px, 1.8rem, 34px); letter-spacing: .06em; }
  .hero-art { display: none; }
  .promises, .steps { grid-template-columns: 1fr; gap: 12px; }
  .promise { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; align-items: center; text-align: left; padding: 14px 16px; }
  .promise svg { grid-row: 1 / 3; margin: 0; }
  .promise h3 { margin: 0; }
  .cat-tiles { grid-template-columns: repeat(auto-fill, minmax(6.5em, 1fr)); gap: 12px; }
  .cat-tile strong { word-break: keep-all; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(7em, 1fr)); gap: 12px; }
  .card-body { padding: 12px; }
  .card-foot .btn { width: 100%; }
  .product { grid-template-columns: minmax(0, 1fr); gap: 20px; }   /* 裡面再寬的東西都不會把欄撐出畫面 */
  .product h1 { font-size: 1.5rem; }
  .buy-row .btn { flex: 1 1 100%; }
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  /* 購物車：照片＋品名一行，小計和數量放下一行，字放大也不會擠成一兩個字一行 */
  .cart-item { grid-template-columns: 76px 1fr; align-items: start; gap: 10px 12px; }
  .cart-item .ph, .cart-item img { width: 76px; height: 76px; }
  .cart-item img { object-fit: cover; }
  .cart-item .line-total { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 1.1rem; }
  .cart-item .line-total::before { content: "小計"; font-weight: 400; color: var(--muted); }
  .cart-item .controls { grid-column: 1 / -1; flex-wrap: wrap; }
  .cart-item .line-notes { grid-column: 1 / -1; }
  .panel { padding: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* 多件優惠 */
.tier-note { margin: 8px 0 0; font-size: .95rem; font-weight: 500; color: var(--accent); }
.tier-box { background: #fbf3dc; border: 2px solid #d9a441; border-radius: var(--radius); padding: 14px 18px; margin: 0 0 20px; }
.tier-box h2 { font-size: 1.15rem; margin: 0 0 6px; }
.tier-box ul { list-style: none; margin: 0; padding: 0; }
.tier-box li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 4px 0; font-size: 1.05rem; }
.tier-box li span, .tier-box li strong { word-break: keep-all; }   /* 只在空格處換行：「每件 / NT$1,044」 */
.tier-box li strong { margin-left: auto; }
.tier-box li strong { color: var(--accent); }
.qty-total { font-size: 1.15rem; font-weight: 700; color: var(--accent); margin: 10px 0 0; min-height: 1.8em; }
.tier-hint { color: var(--accent); font-size: .9rem; }
.gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.gallery-thumb { width: 84px; height: 84px; padding: 0; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; overflow: hidden; }
.gallery-thumb:hover, .gallery-thumb:focus-visible { border-color: var(--green); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* 商品頁購買按鈕下面：運費、購物須知、電話，和一條小信任列（site.js buyInfo） */
.buy-info { margin: 4px 0 0; }
.buy-info .hint { margin: 0 0 8px; }
.trust-row { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.trust-row li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--green-dark); font-size: .9rem; line-height: 1.5; white-space: nowrap; }
.trust-row li::before { content: "✓"; font-weight: 700; color: var(--green); }
/* 查訂單頁：再買一次 */
.buy-again { margin-top: 16px; }
.buy-again .form-error { margin: 12px 0 0; }
.detail { margin-top: 28px; }
.detail h2 { font-size: 1.3rem; padding-left: 12px; border-left: 4px solid var(--green); }

/* 認識油甘果 */
.fact-list { list-style: none; margin: 0 0 1em; padding: 0; }
.fact-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; }
.fact-list strong { font-family: var(--serif); }
.yougan-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 20px 0; }
.yougan-photos img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }

/* ── 動畫：輕、短，並在「減少動態」時全部關掉 ── */
@view-transition { navigation: auto; }
#site-header { view-transition-name: site-header; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; animation-timing-function: ease; }
::view-transition-old(site-header) { animation: none; opacity: 0; }
::view-transition-new(site-header) { animation: none; }
/* 手機選單頁互相換頁（nav-dir.js 加 slide-next／slide-prev）：舊頁、新頁的內容一起往旁邊滑，頁首不動。
   左右滑時舊頁停在手指放開的位置，group 從那裡移回原位，加上下面的滑動，看起來就是從手指的位置接著滑 */
html:active-view-transition-type(slide-next, slide-prev) main { view-transition-name: page-main; }
html:active-view-transition-type(slide-next, slide-prev)::view-transition-old(root),
html:active-view-transition-type(slide-next, slide-prev)::view-transition-new(root) { animation: none; }
html:active-view-transition-type(slide-next, slide-prev)::view-transition-group(page-main) { animation-duration: .3s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
html:active-view-transition-type(slide-next)::view-transition-old(page-main) { animation: vt-to-left .3s cubic-bezier(.2, .7, .2, 1) both; }
html:active-view-transition-type(slide-next)::view-transition-new(page-main) { animation: vt-from-right .3s cubic-bezier(.2, .7, .2, 1) both; }
html:active-view-transition-type(slide-prev)::view-transition-old(page-main) { animation: vt-to-right .3s cubic-bezier(.2, .7, .2, 1) both; }
html:active-view-transition-type(slide-prev)::view-transition-new(page-main) { animation: vt-from-left .3s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vt-to-left { to { transform: translateX(-100%); } }
@keyframes vt-to-right { to { transform: translateX(100%); } }
@keyframes vt-from-right { from { transform: translateX(100%); } }
@keyframes vt-from-left { from { transform: translateX(-100%); } }

/* 照片載入後淡入（有 .js 才隱藏，JS 壞掉時照片照常顯示） */
.card-media, .product-media { background: #efe8d8; }
.js .card-media img, .js .product-media img { opacity: 0; transition: opacity .25s ease; }
.js .card-media img.is-loaded, .js .product-media img.is-loaded { opacity: 1; }

/* 按下與滑過的回饋 */
.btn { transition: background-color .15s, border-color .15s, color .15s, transform .12s; }
.cart-link, .cat-tile, .qty button { transition: transform .12s, border-color .15s, background-color .15s; }
.btn:active, .cart-link:active, .qty button:active, .cat-tile:active { transform: scale(.98); }
.card { transition: box-shadow .2s, transform .2s; }
.card:active { transform: scale(.99); }
@media (hover: hover) {
  .card:hover { box-shadow: 0 8px 20px rgba(59, 47, 36, .12); transform: translateY(-2px); }
}
.cart-count.pop { animation: pop .3s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.toast { transition: opacity .25s ease, transform .25s ease; }
.qty output { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .card-media img, .js .product-media img { opacity: 1; }
  @view-transition { navigation: none; }
}

/* 選單和店名不要斷成兩行；平板寬度把間距縮小 */
.brand, .nav a, .cart-link { white-space: nowrap; }
.card h3, .cart-item h3 { overflow-wrap: anywhere; }
.card h3, .product h1, .cart-item h3 { word-break: keep-all; overflow-wrap: anywhere; }   /* 沒有空格又太長的名字（油甘果甘草蜜餞）放不下時才從中間斷 */   /* 商品名在空格處換行：「100% / 油甘果茶包」，不要「100% 油 / 甘果茶包」 */
@media (max-height: 500px) {
  .site-header { position: static; }
  .buy-bar { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}
/* 很窄的手機（寬 380 以下）：店名小一點，購物車才排得進同一行 */
@media (max-width: 380px) { .brand { font-size: clamp(15px, 1rem, 22px); } .cart-link { padding: 0 10px; } }
@media (min-width: 761px) and (max-width: 1100px) {
  .header-inner { gap: 0 16px; flex-wrap: wrap; padding-top: 6px; }
  .brand { font-size: 1.15rem; letter-spacing: .04em; margin-right: auto; }
  .nav { gap: 24px; order: 3; width: 100%; margin-left: 0; }
}
@media (max-width: 760px) {
  .brand { white-space: normal; }   /* 字放大時店名可以換行，不要把頁面撐寬 */
  .nav-long { display: none; }   /* 選單上的「認識油甘果」手機上寫「油甘果」，少佔一行 */
}

/* 庫存顯示 */
.card-media { position: relative; }
.sold-badge { position: absolute; top: 12px; left: 12px; background: #8a2e17; color: #fff; font-weight: 700; font-size: 1.1rem; padding: 6px 16px; border-radius: 999px; }
.js .card.is-sold .card-media img.is-loaded, .card.is-sold .card-media .ph { opacity: .55; }
.stock-left { margin: 6px 0 0; font-size: 1rem; font-weight: 700; color: #b8381f; }
.product .stock-left { margin: -8px 0 12px; font-size: 1.1rem; }
.sold-hint { margin: 0 0 16px; font-size: 1.05rem; }
/* 售完商品的「到貨通知我」小表單（商品頁）：輸入框、按鈕高度跟結帳表單一樣；手機一欄，電腦兩個輸入框並排 */
.notify-box { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px; scroll-margin-top: 90px; }
.notify-box h2 { font-size: 1.15rem; margin: 0 0 6px; }
.notify-for { margin: 0 0 10px; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.notify-fields { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 10px 0 14px; }
.notify-field { display: block; font-weight: 500; }
.notify-field span { display: block; margin-bottom: 6px; }
.notify-field input {
  width: 100%; min-height: 52px; padding: 10px 14px; font: inherit;
  border: 1px solid #cdbfa6; border-radius: 10px; background: #fff; color: var(--ink);
}
.notify-error { background: #fbe9e4; border: 1px solid #e3a594; color: #b8381f; border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; font-weight: 700; font-size: 1.05rem; }
.notify-note { margin: 10px 0 0; font-size: .95rem; color: var(--muted); }
.notify-done { background: #eef3e8; border: 2px solid var(--green); color: var(--green-dark); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px; font-size: 1.15rem; font-weight: 700; scroll-margin-top: 90px; }
@media (min-width: 761px) { .notify-fields { grid-template-columns: 1fr 1fr; } }
.in-cart-note { margin: -8px 0 8px; color: var(--green-dark); font-weight: 500; }
.line-alert { color: #b8381f; }
.btn:disabled:not(#submit-order) { cursor: not-allowed; background: #8b8478; border-color: #8b8478; opacity: 1; }

/* 我的訂單（頁首）、查訂單頁 */
.orders-link[aria-current="page"] { border-color: var(--green); color: var(--green); }
.nav-orders { display: none; }
@media (max-width: 760px) {
  .orders-link { display: none; }
  .nav-orders { display: inline-flex; }
}
.order-page { max-width: 720px; padding-bottom: 56px; }
.order-page .panel { margin-bottom: 20px; }
.order-loading { text-align: center; padding: 72px 0; font-size: 1.1rem; color: var(--muted); }
.order-status { font-size: 1.6rem; font-weight: 700; color: var(--green); margin: 12px 0 8px; }
.order-status.is-cancelled { color: #b8381f; }
.order-now { font-size: 1.1rem; margin: 16px 0 0; }
.order-cancelled { background: #fbe9e4; border: 1px solid #e3a594; color: #8a2e17; border-radius: 10px; padding: 14px 16px; font-size: 1.1rem; }
.progress { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.progress li { position: relative; text-align: center; font-size: .95rem; color: var(--muted); padding-top: 52px; }
.progress .dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid #cdbfa6; color: var(--muted); font-weight: 700;
}
/* 兩個圓點之間的連接線 */
.progress li + li::before { content: ""; position: absolute; top: 19px; right: 50%; width: 100%; height: 3px; background: #ddd2bd; }
.progress li.done::before, .progress li.current::before { background: var(--green); }
.progress li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.progress li.current .dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 5px rgba(168, 80, 31, .18); }
.progress li.done, .progress li.current { color: var(--ink); }
.progress li.current { font-weight: 700; }
.tracking { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.tracking p { margin: 0 0 12px; font-size: 1.1rem; }
.tracking strong { letter-spacing: .05em; user-select: all; }
.tracking .hint { font-size: .88rem; margin-top: 10px; }
.order-items { margin: 0; padding-left: 1.2em; line-height: 1.8; }
.order-help { margin: 0 0 16px; }
.my-orders { list-style: none; margin: 0; padding: 0; }
.my-orders a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 56px;
}
.my-orders li:last-child a { border-bottom: 0; }
.my-orders span { color: var(--muted); font-size: .92rem; grid-column: 1; }
.my-orders .go { grid-column: 2; grid-row: 1 / 3; color: var(--green); font-weight: 500; }
.my-orders strong { white-space: nowrap; font-size: clamp(16px, 1rem, 30px); }
@media (max-width: 760px) {
  .my-orders a { grid-template-columns: 1fr; }
  .my-orders .go { grid-column: 1; grid-row: auto; justify-self: end; }
}
@media (max-width: 760px) {
  .progress li { font-size: clamp(13px, .82rem, 17px); padding-top: 46px; }
  .progress .dot { width: 34px; height: 34px; }
  .progress li + li::before { top: 16px; }
  .order-status { font-size: 1.4rem; }
}

/* 卡片：提示文字在規格下面，價格＋按鈕貼齊卡片底部；按鈕獨立一行，價格長短不會把版面擠歪 */
.card .tier-note, .card .stock-left { margin: 0 0 4px; font-size: .95rem; }
.card-foot .btn { white-space: nowrap; }
.card-foot { flex-direction: column; align-items: stretch; gap: 8px; }
.card-foot .btn { width: 100%; padding: 0 8px; }

/* 商品規格（像蝦皮的「1包／2包／1組」）：一列一個，整塊都可以按，選到的綠框 */
.opt-box { margin: 18px 0 8px; }
.opt-box h2 { font-size: 1.1rem; margin: 0 0 10px; }
.opt-list { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 12px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
}
.opt img { width: 52px; height: 52px; flex: none; object-fit: cover; border-radius: 8px; background: var(--line); }
.opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-name { font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.opt-price { color: var(--accent); font-weight: 700; }
.opt-left, .opt-sold { margin-left: 8px; font-size: .85rem; font-weight: 500; color: var(--muted); }
.opt[aria-checked="true"] { border-color: var(--green); background: #eef3e8; box-shadow: 0 0 0 2px #cfe0c4; }
.opt.is-sold { opacity: .6; }
.price-from { font-size: .8em; font-weight: 500; color: var(--muted); }
/* 購物車裡的規格名稱（例：1組：羽衣甘藍粉50g+油甘果粉50g）：自己一行，正常斷行 */
.cart-item .line-spec { display: block; color: var(--ink); font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }

/* 手機左右滑換頁（site.js 的 initSwipeNav、nav-dir.js）：往左滑，新頁內容從右邊進來；往右滑從左邊進來 */
@keyframes nav-in-right { from { transform: translateX(35%); opacity: 0; } }
@keyframes nav-in-left { from { transform: translateX(-35%); opacity: 0; } }
.swipe-in-next main { animation: nav-in-right .26s ease-out both; }
.swipe-in-prev main { animation: nav-in-left .26s ease-out both; }
/* 左右滑時從旁邊拉進來的隔壁頁預覽（site.js buildPeek）：固定在畫面上（不會把頁面撐寬），不能點 */
.peek { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; overflow: hidden; background: var(--bg); pointer-events: none; will-change: transform; }
.peek[hidden] { display: none; }
.peek .card-media img { opacity: 1; }   /* 預覽裡的照片不等淡入 */
.peek .card.is-sold .card-media img { opacity: .55; }
@media (max-width: 760px) {
  .peek[data-page="products"] .section-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
}

/* 查訂單頁：客人自己改單、取消 */
.edit-form, .cancel-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.edit-form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.edit-form legend { font-weight: 700; margin-bottom: 8px; }
.btn-danger { background: #a3301b; border-color: #a3301b; color: #fff; }
.order-asked { margin: 0; padding: 12px 14px; border-radius: 10px; background: #fdf1cf; color: #5c3b12; font-weight: 700; line-height: 1.6; }

/* 下單完成畫面「送出中」的樣子（site.js sendToSheet）：編號還沒拿到時灰字；回首頁、看完整內容先收起來，送到了再出現 */
#order-sent.is-pending #order-id { color: var(--muted); }
#order-sent.is-pending .order-sent-home, #order-sent.is-pending .order-details { display: none; }
