/* 團購賣場 前台：數值照樂賣賣場實測（qa/lemai/styles.txt），圖示用 Font Awesome 6 */
:root {
  --coral: #FF5D5D;            /* 主題色（後台可改，載入時由 data.js 覆寫整組） */
  --coral-text: #D9363B;       /* 白底上的主題色字（自動調到看得清楚） */
  --on-coral: #FFFFFF;         /* 主題色色塊上的字 */
  --coral-soft: #FFEFEF;
  --coral-line: #FFCECE;
  --coral-light: #FF9E9E;
  --coral-deep: #AE4645;
  --bg: #FFF7F0;
  --text: #2C2C2C;
  --text-2: #6B6B6B;
  --text-3: #999999;
  --muted: #67635E;
  --line: #E8E8E8;
  --line-2: #EAE8E5;
  --green: #2E7D32;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --soft-shadow: 0 2px 12px rgba(139, 119, 101, .08);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", sans-serif; padding-bottom: calc(56px + var(--safe-b)); }
body.locked { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus, var(--coral)); outline-offset: 2px; }
main:focus { outline: none; }
.center { text-align: center; }

/* ---------- 跑馬燈公告、店名列 ---------- */
.announce { background: var(--coral); color: var(--on-coral); padding: 10px 16px; font-size: 13px; font-weight: 500; line-height: 1.6; letter-spacing: .52px; text-align: center; }
.shophead { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 65px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line-2); }
.sh-back { display: grid; place-items: center; width: 40px; height: 44px; margin: 0 -10px 0 -12px; font-size: 17px; color: var(--text); }
.sh-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sh-brand img { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.sh-brand span { display: grid; min-width: 0; }
.sh-brand b { font-size: 17px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-brand small { font-size: 12px; line-height: 1.6; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 底部分頁 ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(56px + var(--safe-b)); padding-bottom: var(--safe-b); background: #fff; border-top: 1px solid var(--line-2); box-shadow: 0 -2px 10px rgba(0, 0, 0, .05); }
.tabbar > a, .tabbar > button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #9C978F; font-size: 10.5px; line-height: 1.2; }
.tabbar i:not(.badge) { font-size: 19px; line-height: 23px; height: 23px; }
.tabbar [aria-current="page"] { color: var(--coral-strong, var(--coral-deep)); font-weight: 600; }
.badge { position: absolute; top: 3px; left: calc(50% + 5px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--coral-strong, var(--coral-deep)); color: #fff; font: 700 10px/17px system-ui; font-style: normal; text-align: center; }

/* ---------- 共用按鈕 ---------- */
.btn-coral, .btn-green, .btn-line, .btn-soft, .btn-dash { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-radius: 12px; font-size: 16px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.btn-coral { background: var(--coral); color: var(--on-coral); }
.btn-green { background: var(--green); color: #fff; }
.btn-line { background: #fff; color: var(--text-2); border: 1px solid var(--line); font-weight: 400; }
.btn-soft { background: var(--bg); color: var(--text); font-size: 14px; font-weight: 400; padding: 12px 16px; border-radius: 8px; }
.btn-dash { width: 100%; background: #fff; color: var(--coral-text); border: 1px dashed var(--coral-line); font-size: 14px; font-weight: 500; border-radius: 8px; }
.btn-coral[disabled], .btn-green[disabled] { background: #E6E6E6; border-color: #E6E6E6; color: #8A8A8A; opacity: 1; cursor: not-allowed; }
.btn-big { width: 100%; padding: 13px; }
.link-btn { padding: 10px; font-size: 13px; color: var(--text-3); }

/* ---------- 賣場首頁 ---------- */
.home { max-width: 1100px; margin: 0 auto; padding: 16px 16px 32px; }
.toolrow { display: flex; align-items: center; gap: 8px; }
.searchbox { flex: 1; display: flex; align-items: center; gap: 8px; height: 52px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--soft-shadow); }
.searchbox i { font-size: 16px; color: var(--text-3); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; }
.searchbox.in-sheet { margin: 12px 0; box-shadow: none; }
.iconbtn { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: var(--soft-shadow); color: var(--text-2); font-size: 16px; }
.iconbtn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.cats { display: flex; gap: 8px; margin: 18px -16px 16px; padding: 4px 16px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text-2); font-size: 13px; font-weight: 500; line-height: 1.6; }
.cat[aria-selected="true"] { background: var(--coral); border-color: var(--coral-text); color: var(--on-coral); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pcard { position: relative; display: flex; flex-direction: column; min-width: 0; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); overflow: hidden; }
.pc-img { position: relative; display: block; aspect-ratio: 1; background: var(--bg); overflow: hidden; }
.pc-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: grid; place-items: center; width: 100%; height: 100%; background: #F5F5F5; color: var(--text-3); font-size: 13px; }
.pc-fav { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); color: #8A8A8A; font-size: 13px; }
.pc-fav.is-on { color: var(--coral-text); }
.pc-fav.is-on i { font-weight: 900; }
.pc-fav.pop i { animation: heart .3s ease-out; }
@keyframes heart { 40% { transform: scale(1.3); } }
.pc-body { flex: 1; display: flex; flex-direction: column; padding: 12px; }
.pc-name { font-size: 14px; font-weight: 500; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 16px; margin-bottom: 8px; }
.pcard .chip-sold { font-size: 11px; line-height: 1.6; padding: 0 6px; }
.chip-ok, .chip-pre, .chip-out { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.chip-ok { background: #E8F5E9; color: var(--green); }
.chip-pre { background: #EDE7F6; color: #5E35B1; }
.chip-out { background: #EEEEEE; color: #888; }
.chip-stock { font-size: 13px; color: var(--text-3); }
.chip-sold { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; padding: 1px 8px; border: 1px solid var(--line, #e5d8d0); border-radius: 999px; white-space: nowrap; }
.stock { font-size: 11px; line-height: 1.6; color: var(--text-3); }
.pc-price { margin-top: auto; margin-bottom: 8px; color: var(--coral-text); font-size: 16px; font-weight: 700; line-height: 1.2; }
.pc-price small { font-size: 16px; }
.pc-btn { width: 100%; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 500; line-height: 1.45; }
.pcard.is-out .pc-img img { opacity: .55; }
.allshown { grid-column: 1 / -1; justify-self: center; display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 16px; border-radius: 12px; background: var(--bg); font-size: 16px; }
.allshown i { color: #4CAF50; }
.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding: 40px 16px; color: var(--text-3); text-align: center; font-size: 14px; }
.empty.big { padding: 80px 16px; }
.empty .btn-coral, .empty .btn-line { padding: 10px 20px; font-size: 14px; }

/* ---------- 頁尾（照樂賣 merchant-footer 實測） ---------- */
.sfoot { padding-top: 32px; background: var(--coral); color: var(--on-coral); }
.sfoot-in { display: grid; gap: 20px; padding: 0 24px 24px; }
.sfoot-brand { max-width: 380px; }
.sfoot h2 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.sfoot-brand p { margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--on-coral); opacity: .88; }
.sfoot-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 32px; }
.sfoot-links div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sfoot-links b { margin-bottom: 4px; font-size: 13px; font-weight: 700; line-height: 1.6; }
.sfoot-links button { font-size: 13px; line-height: 19px; color: var(--on-coral); text-align: left; }
.sfoot .social { display: flex; justify-content: center; gap: 10px; margin: 0; padding: 16px 24px; border-top: 1px solid rgba(255, 255, 255, .2); }
.sfoot .social a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; background: rgba(255, 255, 255, .15); color: var(--on-coral); font-size: 16px; }
.sfoot-bottom { display: grid; justify-items: center; gap: 10px; padding: 20px 20px 22px; background: rgba(0, 0, 0, .42); text-align: center; }
.sfoot-copy { font-size: 12px; line-height: 1.6; color: rgba(255, 255, 255, .92); }
.sfoot-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.6; }
.sfoot-sub button { color: #fff; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.sfoot-sub span { color: rgba(255, 255, 255, .45); }
.sfoot-role { font-size: 11px; line-height: 1.6; color: rgba(255, 255, 255, .82); }

/* ---------- 底部抽屜、側邊抽屜 ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .4); animation: fade .2s ease-out; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 88dvh; overflow-y: auto; padding: 8px 20px calc(20px + var(--safe-b)); background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .12); animation: up .25s ease-out; }
.sheet-grip { width: 40px; height: 4px; margin: 0 auto 8px; border-radius: 999px; background: var(--line); }
.sheet h2 { margin: 4px 0 8px; font-size: 17px; font-weight: 600; line-height: 1.6; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: 90%; max-width: 400px; display: flex; flex-direction: column; background: var(--bg); animation: slide .25s ease-out; }
.drawer.more { width: 320px; max-width: 86%; background: #fff; box-shadow: -4px 0 20px rgba(0, 0, 0, .12); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 16px; font-weight: 500; line-height: 1.6; }
.drawer.more .drawer-head { padding: 14px 16px 12px; border-bottom-color: var(--line-2); }
.drawer.more .drawer-head h2 { font-weight: 700; }
.drawer-x { padding: 4px; font-size: 20px; line-height: 1; color: var(--text-3); }
.drawer.more .drawer-x { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: #F6F5F3; color: var(--muted); font-size: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.drawer.more .drawer-body { padding: 6px 0 16px; }
.drawer-foot { display: grid; padding: 12px 14px calc(12px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
.drawer-foot .btn-coral { padding: 13px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.is-leaving.sheet { animation: down .2s ease-in forwards; }
.is-leaving.drawer { animation: slide-out .2s ease-in forwards; }
.is-leaving.scrim { animation: fade-out .2s ease-in forwards; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes slide { from { transform: translateX(100%); } }
@keyframes slide-out { to { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.opt-list { display: grid; }
.opt-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 15px; text-align: left; }
.opt-row.is-on { color: var(--coral-text); font-weight: 600; }
.f-label { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.f-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.f-chip { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text-2); font-size: 14px; }
.f-chip[aria-pressed="true"] { background: var(--coral); border-color: var(--coral-text); color: var(--on-coral); font-weight: 500; }
.f-check { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.f-check input { width: 18px; height: 18px; accent-color: var(--coral-text); }
.f-range { display: flex; align-items: center; gap: 10px; color: var(--text-3); }
.f-range .inp { flex: 1; }
.sheet-btns { display: grid; grid-template-columns: 1fr 1.75fr; gap: 12px; margin-top: 20px; }
.sheet-btns.one { grid-template-columns: 1fr; }
.sheet-btns .btn-line, .sheet-btns .btn-coral { padding: 13px; font-size: 15px; }
.lightbox { position: fixed; inset: 0; z-index: 31; display: grid; place-items: center; padding: 16px; pointer-events: none; animation: fade .2s ease-out; }
.lightbox > * { pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 90dvh; object-fit: contain; }
.lb-x { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .9); font-size: 16px; }

/* ---------- 表單 ---------- */
.inp { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; line-height: 1.4; }
textarea.inp { resize: vertical; min-height: 83px; }
select.inp { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 34px; }
.inp:focus { outline: none; border-color: var(--coral-text); }
.inp[aria-invalid="true"] { border-color: #F44336; }
.inp::placeholder { color: var(--text-3); }
.fld { display: grid; gap: 6px; }
.fld + .fld, #ship-extra:not(:empty), #pay-extra:not(:empty), #pay-extra + .fld { margin-top: 16px; }
.fld > label { font-size: 14px; font-weight: 500; line-height: 1.6; }
.req { color: #F44336; font-style: normal; margin-left: 2px; }
.hint { font-size: 12px; line-height: 1.4; color: var(--text-3); }
.err { font-size: 12px; color: #F44336; }
.err:empty { display: none; }

/* ---------- 商品頁 ---------- */
.pdp { max-width: 720px; margin: 0 auto; padding-bottom: 80px; }
.gallery { position: relative; margin: 16px 16px 0; aspect-ratio: 1; background: var(--bg); border-radius: 12px; box-shadow: var(--card-shadow); display: grid; place-items: center; overflow: hidden; }
.gallery > img { width: 100%; height: 100%; object-fit: contain; }
.gallery .noimg { border-radius: 12px; }
.g-expand { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px; }
.pinfo { margin: 16px 16px 0; padding: 16px; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); }
.cat-tag { display: inline-flex; padding: 2px 8px; border-radius: 8px; background: var(--bg); color: var(--text-2); font-size: 12px; line-height: 1.6; }
.pinfo h1 { margin-top: 8px; font-size: 20px; font-weight: 600; line-height: 1.4; }
.pinfo .pc-meta { margin: 4px 0 0; min-height: 23px; }
.pinfo .chip-ok { padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 500; }
.pprice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pprice span { color: var(--coral-text); font-size: 24px; font-weight: 700; line-height: 1.6; }
.free-pill { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: #43A047; color: #fff; font-size: 12px; font-weight: 600; font-style: normal; line-height: 1.6; }
.pbox { margin: 12px 16px 0; padding: 14px 16px; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); }
.pbox-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.vpick { width: calc(100% - 32px); display: flex; align-items: center; gap: 10px; font-size: 14px; text-align: left; }
.vpick .pbox-label { margin: 0; font-size: 14px; font-weight: 400; color: var(--text-3); }
.vpick-val { flex: 1; color: var(--text-2); }
.vpick-val b { color: var(--coral-text); font-weight: 500; }
.vpick i { font-size: 12px; color: var(--text-3); }
.free-hint { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #F0EEEA; font-size: 12.5px; line-height: 1.55; color: #4A4A4A; }
.free-hint i { font-size: 13px; color: #B0ADA6; }
.free-hint b { color: var(--coral-text); font-weight: 600; }
.stepper { display: inline-flex; align-items: stretch; height: 38px; }
.stepper button { width: 38px; border: 1px solid #E0E0E0; background: #fff; font-size: 18px; font-weight: 500; line-height: 1; }
.stepper button:first-child { border-radius: 8px 0 0 8px; }
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.stepper button[disabled] { color: #CCC; }
.stepper output { display: grid; place-items: center; width: 52px; border-top: 1px solid #E0E0E0; border-bottom: 1px solid #E0E0E0; font-size: 15px; font-weight: 600; }
.stepper.sm { height: 36px; gap: 4px; }
.stepper.sm button { width: 36px; border-radius: 4px !important; border-color: var(--line); font-size: 13px; font-weight: 400; }
.stepper.sm output { width: 32px; border: 0; font-size: 14px; font-weight: 500; }
.also { margin: 20px 16px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.also h2 { margin-bottom: 4px; font-size: 24px; font-weight: 800; line-height: 1.6; letter-spacing: .24px; }
.also-row { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 18px 8px; }
.also-row::-webkit-scrollbar { display: none; }
.also-card { flex: none; width: 164px; background: #fff; border-radius: 18px; box-shadow: var(--card-shadow); overflow: hidden; }
.also-card .pc-img { width: 164px; }
.also-card b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; margin: 12px 12px 0; font-size: 15px; font-weight: 600; line-height: 1.45; }
.also-card .pc-price { display: block; margin: 16px 12px 14px; font-size: 16px; font-weight: 800; }
.also-card .pc-price small { font-size: 12px; font-weight: 500; }
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + var(--safe-b)); background: #fff; box-shadow: 0 -2px 8px rgba(0, 0, 0, .08); }
.buybar .bb-sum { flex: 1; }
.buybar .btn-coral, .buybar .btn-green { width: 119px; min-height: 48px; padding: 12px; border-radius: 12px; font-size: 16px; font-weight: 600; white-space: normal; line-height: 1.25; }
.buybar.in-sheet { position: sticky; bottom: calc(-20px - var(--safe-b)); margin-top: 0; }
.bb-sum { display: grid; }
.bb-sum small { font-size: 12px; line-height: 1.6; color: var(--text-2); }
.bb-sum b { color: var(--coral-text); font-size: 20px; font-weight: 700; line-height: 1.6; }
.bb-sum b small { font-size: 12px; color: var(--coral-text); }
body[data-page="p"] { padding-bottom: 0; }
body[data-page="p"] .tabbar { display: none; }

/* 規格抽屜 */
.sheet:has(.vs-head) { padding: 0 0 calc(20px + var(--safe-b)); border-radius: 16px 16px 0 0; overflow: visible; }
.vs-head { position: relative; display: flex; align-items: flex-end; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid #F0F0F0; }
.vs-thumb { flex: none; width: 96px; height: 96px; margin-top: -48px; border-radius: 10px; border: 3px solid #fff; background: #F1F1F1; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); overflow: hidden; }
.vs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vs-thumb .noimg { font-size: 11px; }
.vs-head > div { flex: 1; min-width: 0; padding-right: 28px; }
.vs-price { color: var(--coral-text); font-size: 20px; font-weight: 700; line-height: 1.3; }
.vs-picked { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.vs-stock { font-size: 12px; color: var(--text-3); }
.vs-head .sheet-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; font-size: 18px; color: var(--text-3); }
.vs-body { max-height: 55dvh; overflow-y: auto; }
.vs-sec { padding: 14px 16px; border-bottom: 1px solid #F0F0F0; }
.vs-label { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text-2); line-height: 1.6; }
.vs-opts { display: grid; gap: 8px; }
.vs-opt { position: relative; display: flex; align-items: center; min-height: 46px; padding: 6px 40px 6px 12px; border: 1px solid #E0E0E0; border-radius: 8px; background: #fff; font-size: 14px; font-weight: 500; text-align: left; }
.vs-opt i { position: absolute; right: 14px; color: var(--coral-text); opacity: 0; }
.vs-opt[aria-checked="true"] { border-color: var(--coral-text); background: var(--coral-soft); color: var(--coral-text); }
.vs-opt[aria-checked="true"] i { opacity: 1; }
.vs-opt[disabled] { color: #BBB; background: #FAFAFA; cursor: not-allowed; }
.vs-sec .free-hint { margin-top: 12px; }
.vs-opts.nudge { animation: nudge .35s ease-out; }
@keyframes nudge { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* ---------- 購物車 ---------- */
.added-banner { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; padding: 9px 12px; border-radius: 8px; background: #E6F4EA; color: #1B5E20; font-size: 13px; }
.ci-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ci { display: grid; grid-template-columns: 60px 1fr; gap: 10px; padding: 12px; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); }
.ci-img { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.ci-img img { width: 100%; height: 100%; object-fit: cover; }
.ci-img .noimg { font-size: 11px; }
.ci-body { min-width: 0; }
.ci-name { display: block; font-size: 14px; font-weight: 600; line-height: 1.6; }
.ci-sub { font-size: 12px; line-height: 1.6; color: var(--text-3); }
.ci-v { font-size: 13px; font-weight: 500; line-height: 1.6; color: var(--coral-text); }
.ci-price { font-size: 13px; line-height: 1.6; color: var(--text-2); }
.ci-side { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.ci-total { margin-left: auto; color: var(--coral-text); font-size: 16px; font-weight: 600; }
.ci-del { display: grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0; font-size: 15px; color: var(--text-3); }
.ci-note { grid-column: 1 / -1; width: 100%; height: 38px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #FAFAFA; font-size: 13px; resize: none; }
.csum { margin-top: 12px; padding: 16px; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); }
.csum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.csum-hint { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px; line-height: 1.55; color: #4A4A4A; }
.csum-hint i { font-size: 13px; color: #43A047; }
.csum-hint i.fa-truck { color: #B0ADA6; }
.csum-hint b { color: var(--coral-text); }
.csum-total { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding: 12px 0 8px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.csum-total b { color: var(--coral-text); font-size: 20px; font-weight: 700; }
.cartpage { padding-bottom: 150px; }
.paybar { position: fixed; left: 0; right: 0; bottom: calc(56px + var(--safe-b)); z-index: 19; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #fff; box-shadow: 0 -2px 8px rgba(0, 0, 0, .08); }
.paybar .btn-coral { min-width: 48%; }

/* ---------- 結帳 ---------- */
body[data-page="checkout"] { padding-bottom: 0; }
body[data-page="checkout"] .tabbar { display: none; }
.checkout { padding-bottom: 100px; }
.checkout .paybar { bottom: 0; padding-bottom: calc(12px + var(--safe-b)); }
.co-sec { margin-bottom: 24px; }
.co-sec > h2 { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--coral); font-size: 18px; font-weight: 600; line-height: 1.6; }
.co-member { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #F0EEEA; font-size: 12.5px; color: var(--text-2); }
.pill-line { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border: 1px solid var(--coral-line); border-radius: 999px; color: var(--coral-text); font-size: 12.5px; line-height: 1.2; }
.pill-green { border-color: #A9E3C1; color: #06913F; }
.co-card { padding: 16px; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); }
.co-same { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; }
.co-same input { width: 18px; height: 18px; accent-color: var(--coral-text); }
.coupon { display: flex; gap: 8px; }
.store-picked { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #FAFAFA; font-size: 14px; }
.store-picked span { margin-left: 8px; font-size: 12px; color: var(--text-3); }
.store-picked p { font-size: 12px; color: var(--text-2); }
.paynote { display: grid; gap: 8px; padding: 12px; border-radius: 8px; background: #FAFAFA; border: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--text-2); }
.paynote.ok { background: #E6F4EA; border-color: #CDE8D4; color: #1B5E20; font-weight: 500; }
.paynote.warn { background: #FFF8E6; border-color: #FBE3A8; }
.paynote .big { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.5; }
.paynote .btn-soft { justify-self: start; padding: 8px 14px; }
.sum-items { list-style: none; margin: 0; padding: 0; }
.sum-items li { display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sum-items li:first-child { padding-top: 0; }
.si-img { width: 50px; height: 50px; border-radius: 6px; background: #F5F5F5; overflow: hidden; }
.si-img img { width: 100%; height: 100%; object-fit: cover; }
.si-img .noimg { font-size: 10px; }
.sum-items b { font-size: 14px; font-weight: 500; line-height: 1.6; }
.sum-items .ci-sub { font-size: 13px; color: var(--text-2); }
.si-total { font-weight: 600 !important; }
.checkout .csum-total, .ocard .csum-total { border-top-width: 2px; }
.link-in { color: var(--coral-text); text-decoration: underline; font-size: inherit; }
.stores { list-style: none; margin: 0; padding: 0; }
.stores button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.stores small { grid-column: 1 / -1; color: var(--text-2); font-size: 13px; }
.stores span { color: var(--text-3); font-size: 13px; }

/* ---------- 訂單、會員 ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 16px 16px 32px; }
.sec-title { margin: 4px 0 14px; font-size: 17px; font-weight: 800; line-height: 1.6; }
.done-head { display: grid; justify-items: center; gap: 4px; padding: 16px 0 20px; text-align: center; }
.done-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #4CAF50; color: #fff; font-size: 28px; }
.done-head h1 { margin-top: 8px; font-size: 20px; font-weight: 600; }
.done-head p { font-size: 14px; color: var(--text-2); }
.done .btn-big { margin-top: 4px; }
.demo-link { display: block; margin-top: 14px; text-align: center; color: var(--text-3); font-size: 13px; text-decoration: underline; }
.ocard { display: grid; gap: 10px; margin-bottom: 12px; padding: 16px; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); }
.ocard-top { display: flex; justify-content: space-between; align-items: flex-start; }
.ocard-top small { display: block; font-size: 12px; color: var(--text-3); }
.ocard-top b { font-size: 16px; font-weight: 600; }
.ostat { display: inline-flex; padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.ostat-warn { background: #FFF3D6; color: #A26300; }
.ostat-accent { background: #FFEDEC; color: #E04646; }
.ostat-info { background: #E3F0FB; color: #1F64A8; }
.ostat-ok { background: #E8F5E9; color: var(--green); }
.ostat-mute { background: #EEE; color: #888; }
.last5 { display: grid; gap: 6px; }
.last5 label { font-size: 13px; font-weight: 500; }
.last5 > div { display: flex; gap: 8px; }
.last5 .btn-coral { padding: 10px 16px; font-size: 14px; border-radius: 8px; }
.member { padding: 40px 20px; }
.mcard { display: grid; justify-items: center; gap: 6px; padding: 24px; background: #fff; border-radius: 20px; box-shadow: 0 4px 20px rgba(0, 0, 0, .05); text-align: center; }
.mcard img { width: 64px; height: 64px; border-radius: 50%; }
.mcard h1 { margin-top: 6px; font-size: 20px; font-weight: 700; }
.mcard > p { font-size: 13px; color: var(--text-2); }
.mlist { list-style: none; margin: 12px 0 0; padding: 0; width: 100%; display: grid; gap: 10px; text-align: left; }
.mlist li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: #FAF8F6; }
.mlist .mi { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--coral); color: var(--on-coral); font-size: 15px; }
.mlist b { font-size: 14px; font-weight: 600; }
.mlist small { display: block; font-size: 12px; color: var(--text-3); }
.mlogin { margin: 16px 0 22px; padding: 24px; border-radius: 20px; box-shadow: 0 4px 20px rgba(0, 0, 0, .05); }
.mlogin .inp { height: 44px; border-radius: 12px; border-color: #E5E7EB; font-size: 16px; }
.mlogin .btn-big { margin-top: 18px; }

/* ---------- 商家簡介 ---------- */
body[data-page="about"] { background: #F6F5F3; }
body[data-page="about"] .shophead { display: none; }
.about .cover { position: relative; height: 219px; background: linear-gradient(160deg, var(--coral-light), var(--coral-soft)); }
.cover-share { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .88); box-shadow: 0 2px 8px rgba(0, 0, 0, .1); color: var(--text); font-size: 14px; }
.about-card { position: relative; margin: -64px 16px 0; padding: 0 16px 16px; background: #fff; border-radius: 22px; box-shadow: 0 6px 18px rgba(40, 30, 20, .05); }
.about-top { display: flex; gap: 14px; }
.about-logo { flex: none; width: 86px; height: 86px; margin-top: -30px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .1); }
.about-top > div { padding-top: 12px; min-width: 0; }
.about-card h1 { font-size: 21px; font-weight: 800; line-height: 1.25; }
.about-top p { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.about-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0; text-align: center; }
.stats div + div { border-left: 1px solid var(--line-2); }
.stats b { display: block; font-size: 18px; font-weight: 800; line-height: 1.3; }
.stats small { font-size: 11px; color: var(--text-3); }
.about-card .social { display: flex; justify-content: center; gap: 12px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line-2); }
.about-card .social a { width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 1px 3px rgba(40, 30, 20, .06); font-size: 19px; }
.about-card .social a { display: grid; place-items: center; flex: none; }
.about-card .social a.so-line { color: #06C755; }
.about-card .social a.so-ig { color: #E1306C; }
.about-card .social a.so-threads { color: #111; }
.about-card .social a.so-fb { color: #1877F2; }
.terms-sec { padding: 24px 16px; }
.terms-sec .sec-title { position: relative; padding-left: 11px; }
.terms-sec .sec-title::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 4px; border-radius: 2px; background: var(--coral); }
.terms-sec .co-card { border-radius: 16px; padding: 14px; box-shadow: 0 1px 2px rgba(40, 30, 20, .05), 0 4px 14px rgba(40, 30, 20, .04); }
.terms { position: relative; display: grid; gap: 10px; max-height: 140px; overflow: hidden; font-size: 13px; line-height: 1.75; }
.terms:not(.open)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none; }
.terms.open { max-height: none; }
.link-more { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--coral-deep); }

/* ---------- 更多 ---------- */
.more-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px 4px; }
.more-tiles > * { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; background: #F6F5F3; font-size: 12px; line-height: 1.2; color: var(--text); }
.more-tiles i { font-size: 17px; color: var(--coral-text); }
.more-title { display: flex; align-items: center; gap: 7px; padding: 18px 16px 8px; font-size: 12px; font-weight: 700; letter-spacing: .48px; color: var(--muted); }
.more-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--coral); }
.more-cats { list-style: none; margin: 0; padding: 0; }
.more-cats a { display: flex; align-items: center; gap: 12px; padding: 9px 16px; font-size: 15px; }
.more-cats .mc { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--coral-light); color: var(--on-coral); font-size: 14px; }

/* 提示 */
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); z-index: 40; display: inline-flex; width: max-content; pointer-events: none; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 12px 24px; border-radius: 12px; transform: translateX(-50%); background: rgba(50, 50, 50, .92); color: #fff; font-size: 14px; line-height: 1.6; animation: toast .2s ease-out; }
.toast-ok { background: rgba(76, 175, 80, .95); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* 示意圖標示 */
.stock-tag { position: absolute; left: 8px; bottom: 8px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 10px; line-height: 1.6; }
.gallery .stock-tag { left: 10px; bottom: 10px; }
.credit { display: block; margin: 6px 16px 0; font-size: 10px; color: var(--text-3); }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { left: 50%; right: auto; width: 480px; margin-left: -240px; }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .shophead { padding: 10px max(16px, calc(50% - 534px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }



/* 商品照片輪播（照樂賣 carousel：滑動換張、縮圖同步） */
.g-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.g-track::-webkit-scrollbar { display: none; }
.g-slide { flex: none; width: 100%; height: 100%; scroll-snap-align: start; display: grid; place-items: center; }
.g-slide img, .g-slide video { width: 100%; height: 100%; object-fit: cover; } /* 每張都裁成一樣的正方形，放大才看原圖 */
.g-slide video { object-fit: contain; }
.g-slide video { background: #000; }
.gallery-thumbs button.is-video { background: #2C2C2C; color: #fff; display: grid; place-items: center; font-size: 16px; }
.gallery-thumbs { display: flex; gap: 8px; margin: 8px 16px 0; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.gallery-thumbs button { flex: none; width: 56px; height: 56px; padding: 0; border-radius: 8px; border: 2px solid transparent; background: var(--bg); overflow: hidden; }
.gallery-thumbs button.active { border-color: var(--coral-text); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
/* 公告輪播 */
.announce-text { display: inline-block; transition: opacity .3s; }
.announce-text.fade-out { opacity: 0; }
.store-fields { display: grid; gap: 12px; }
.store-fields a { color: var(--coral-text); }

/* 寬螢幕：商品頁左圖右資訊，底部購買列跟內容同寬 */
@media (min-width: 1024px) {
  .pdp { max-width: 1080px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; padding-bottom: 100px; }
  .pdp > .pdp-media { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 16px; }
  .pdp > :not(.pdp-media) { grid-column: 2; margin-left: 0; }
  .pdp-media .gallery { margin-right: 0; }
  .pdp-media .gallery-thumbs { margin-right: 0; }
  .buybar:not(.in-sheet) { left: 50%; right: auto; width: min(1080px, 100%); transform: translateX(-50%); border-radius: 16px 16px 0 0; }
  .tabbar { left: 50%; right: auto; width: min(720px, 100%); transform: translateX(-50%); border-radius: 16px 16px 0 0; }
}

/* 商品介紹 */
.pdesc { margin: 12px 16px 0; padding: 16px; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); }
.pdesc h2 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.pdesc-body { font-size: 14px; line-height: 1.85; color: #3A3A3A; white-space: normal; word-break: break-word; }
.single-v { margin-top: 4px; font-size: 13px; color: var(--coral-text); }

/* 輪播左右箭頭與張數 */
.g-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #2C2C2C; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: pointer; font-size: 15px; transition: opacity .15s; }
.g-prev { left: 10px; } .g-next { right: 10px; }
.g-nav:disabled { opacity: 0; pointer-events: none; }
.g-count { position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 3px 9px; border-radius: 12px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; font-weight: 600; }
.gallery:focus-visible { outline: 3px solid var(--focus, var(--coral)); outline-offset: 3px; }
.gallery > .stock-tag { left: auto; right: 48px; }
@media (hover: none) and (max-width: 767px) { .g-nav { width: 34px; height: 34px; font-size: 13px; } }
/* 電腦版：主圖依螢幕高度縮小，縮圖一定看得到、不被底部購買列擋住 */
@media (min-width: 1024px) {
  .pdp > .pdp-media { top: 80px; }
  .pdp-media .gallery { width: min(100%, calc(100vh - 290px)); min-width: 320px; margin-left: auto; margin-right: auto; }
  .pdp-media .gallery-thumbs { width: min(100%, calc(100vh - 290px)); min-width: 320px; margin-left: auto; margin-right: auto; }
  .gallery-thumbs button { width: 64px; height: 64px; }
}

/* 會員登入與會員頁 */
.login-btns { display: grid; gap: 10px; margin-top: 16px; }
.login-btns.sm { grid-template-columns: 1fr 1fr; margin-top: 8px; }
.btn-login { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.btn-login.line { background: #06C755; color: #fff; }
.btn-login.line i { font-size: 22px; }
.btn-login.google { background: #fff; color: #3C4043; border-color: #DADCE0; }
.btn-login.is-busy { opacity: .6; pointer-events: none; }
.login-btns.sm .btn-login { min-height: 42px; font-size: 14px; gap: 6px; padding: 0 8px; }
.login-note { margin-top: 10px; text-align: center; }
.lookup-h { margin-top: 20px; }
.me-card { text-align: center; }
.me-pic { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--coral-soft); color: var(--coral-text); font-size: 28px; font-weight: 700; }
.me-via { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.me-via .fa-line { color: #06C755; }
.me-stats { display: grid; grid-template-columns: 1fr 1fr; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.me-stats b { display: block; font-size: 18px; color: var(--text-1, #2C2C2C); }
.me-stats small { color: var(--text-3); font-size: 12px; }
.me-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 16px 0 12px; }
.me-tabs button { min-height: 44px; border-radius: 22px; border: 1px solid var(--line); background: #fff; font-size: 15px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.me-tabs button[aria-selected="true"] { background: var(--coral); border-color: var(--coral); color: var(--on-coral); }
.me-sub { font-size: 14px; margin: 16px 0 6px; color: var(--text-2); }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; align-items: end; }
.me-logout { display: flex; align-items: center; gap: 6px; margin: 20px auto 0; min-height: 44px; color: var(--text-3); }
.co-member.is-me { display: flex; align-items: center; gap: 8px; }
.co-member.is-me img { border-radius: 50%; }
.co-login { display: block; }

.oa-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 14px; min-height: 40px; border-radius: 20px; background: #E9F9EF; color: #05813A; font-size: 13px; font-weight: 600; text-decoration: none; }
.chk-row { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; font-size: 15px; }
.chk-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--coral); }
.chk-row small { display: block; color: var(--text-3); font-size: 12px; }

/* 優惠 */
.cpn-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.cpn-row .inp { text-transform: uppercase; }
.btn-line { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--coral); color: var(--coral-text); background: #fff; font-weight: 700; cursor: pointer; }
.cpn-msg { min-height: 18px; font-size: 13px; margin: 4px 0 0; }
.cpn-msg.ok { color: #1E7A46; }
.cpn-msg.bad { color: #C62828; }
.credit-row { margin: 6px 0 8px; }
.csum-row.disc span:last-child { color: #C62828; }
.csum-hint.promo i { color: var(--coral-text); }
.earn-note { margin-top: 6px; color: #1E7A46; }
.me-stats.three { grid-template-columns: repeat(3, 1fr); }
.tier-box { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #FFF7E6; text-align: left; }
.tier-now { margin: 0 0 4px; font-weight: 700; color: #8A5A00; display: flex; gap: 6px; align-items: center; }
.tier-bar { height: 6px; border-radius: 3px; background: #F3E3C0; overflow: hidden; margin-top: 6px; }
.tier-bar i { display: block; height: 100%; background: #E0A100; }
.credit-card { text-align: center; }
.credit-big { font-size: 32px; font-weight: 800; margin: 4px 0; color: var(--coral-text); }
.ledger { list-style: none; margin: 12px 0 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.ledger small { display: block; color: var(--text-3); font-size: 12px; }
.ledger .plus { color: #1E7A46; font-weight: 700; }
.ledger .minus { color: #C62828; font-weight: 700; }

/* 訂單留言 */
.msg-btn { width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.th-list { list-style: none; margin: 8px 0; padding: 4px; max-height: 45vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.th-list li { max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.th-list li p { margin: 0; overflow-wrap: anywhere; }
.th-list li small { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.th-customer { align-self: flex-end; background: var(--coral-soft, #FFE9E6); }
.th-seller { align-self: flex-start; background: #F1F0EE; }
.th-list .th-empty { max-width: 100%; background: none; }
.th-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.th-form .btn-coral { min-height: 44px; padding: 0 18px; }

/* 商品販售條件、到貨通知、加價購 */
.p-terms { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--text-2); }
.p-terms li { display: flex; gap: 8px; align-items: center; }
.p-terms i { color: var(--coral-text); width: 16px; text-align: center; }
.p-terms .bad { color: #C62828; font-weight: 700; }
.p-terms .bad i { color: #C62828; }
.restock-btn { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; }
.addon-box { background: #FFF8EC; border: 1px dashed #F0C987; border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.addon-box h2 { font-size: 15px; margin: 0 0 8px; display: flex; gap: 6px; align-items: center; color: #8A5A00; }
.addon-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.addon-box li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.addon-box .si-img img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.addon-box small { display: block; color: var(--coral-text); font-weight: 700; }
.addon-box .btn-line { min-height: 38px; padding: 0 12px; }

/* 熱銷、新品、推薦好友 */
.pc-img { position: relative; }
.chip-hot, .chip-new { position: absolute; top: 8px; left: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip-hot { background: #E53935; color: #fff; }
.chip-new { background: #1E7A46; color: #fff; }
.ref-card h3 { margin: 0 0 6px; font-size: 16px; display: flex; gap: 6px; align-items: center; }
.ref-card p { margin: 0 0 8px; font-size: 14px; }
.ref-link { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ref-link .inp { font-size: 13px; }
.ref-link .btn-coral { min-height: 44px; padding: 0 16px; }
.more-tiles { grid-template-columns: repeat(2, 1fr); }

/* 活動標籤、會員等級價 */
.camp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.camp-chips span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #B4232C; background: #FFF0F0; border-radius: 6px; padding: 3px 8px; }
.tier-price { margin: 6px 0 0; font-size: 13px; color: #8A5A00; } .tier-price i { margin-right: 4px; } .tier-price b { font-size: 15px; }

/* 平板、電腦：對話框置中（用 translate，不跟進場動畫的 transform 打架）；篩選／排序貼在按鈕下方 */
@media (min-width: 640px) {
  .sheet:not(.lightbox) { top: 50%; bottom: auto; translate: 0 -50%; max-height: min(88dvh, 760px); padding: 20px 24px 24px; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .22); animation: pop .18s ease-out; }
  .sheet:not(.lightbox):has(.vs-head) { padding: 0 0 24px; }
  .is-leaving.sheet:not(.lightbox) { animation: pop-out .15s ease-in forwards; }
  .sheet .sheet-grip { display: none; }
  .sheet.is-pop { top: var(--pop-top); left: var(--pop-left); width: var(--pop-w); max-height: var(--pop-max); margin-left: 0; translate: none; padding: 16px 18px 18px; border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .05); transform-origin: top right; }
  .sheet.is-pop h2 { font-size: 16px; }
  .sheet.is-pop .opt-row { padding: 11px 4px; }
  .sheet.is-pop .opt-row:last-child { border-bottom: 0; }
  .sheet.is-pop .sheet-btns { margin-top: 16px; }
  .scrim.is-pop { background: rgba(0, 0, 0, .06); }
}
@keyframes pop { from { opacity: 0; scale: .97; } }
@keyframes pop-out { to { opacity: 0; scale: .97; } }

/* 對話框本身拿焦點時不畫框；篩選的按鈕固定在底部（小手機不用捲才看得到） */
.sheet:focus, .drawer:focus { outline: none; }
.sheet-btns.sheet-foot { position: sticky; bottom: calc(-20px - var(--safe-b)); margin: 20px -20px calc(-20px - var(--safe-b)); padding: 12px 20px calc(16px + var(--safe-b)); background: #fff; box-shadow: 0 -1px 0 var(--line); }
.bb-sum b { white-space: nowrap; }
/* 窄手機（320px）：搜尋框可以縮，篩選鈕不會被擠出畫面 */
.searchbox { min-width: 0; }
@media (max-width: 359px) { .searchbox { padding: 12px 12px; } .toolrow { gap: 6px; } .iconbtn { width: 40px; height: 40px; } }
/* 小按鈕：外觀不變，點擊範圍放大到 44px */
.pc-fav::after, .g-expand::after { content: ""; position: absolute; inset: -7px; }
.link-more, button[data-doc] { display: inline-flex; align-items: center; min-height: 40px; }
.g-expand { width: 34px; height: 34px; font-size: 13px; }
@media (min-width: 640px) { .sheet-btns.sheet-foot { bottom: -24px; margin: 20px -24px -24px; padding: 12px 24px 20px; } .sheet.is-pop .sheet-btns.sheet-foot { bottom: -18px; margin: 16px -18px -18px; padding: 12px 18px 16px; border-radius: 0 0 14px 14px; } }

/* 點擊範圍 */
.ci-name { padding: 4px 0; margin: -4px 0; }
.pill-line { min-height: 36px; }
.co-same { min-height: 40px; display: flex; align-items: center; gap: 8px; }
.vs-head .sheet-x { width: 40px; height: 40px; top: 6px; right: 6px; }


/* ===== 前台打磨 1 ===== */
/* 1. 規格視窗：頭／可捲的選項／底部購買列，購買列不會再卡在中間蓋住選項 */
.sheet.vsheet { display: flex; flex-direction: column; max-height: calc(100dvh - 72px); padding: 0; } /* 手機：縮圖往上凸 48px，上面再留 24px */
.vsheet .vs-head { flex: none; }
.vsheet .vs-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
.vsheet .vs-foot { flex: none; padding: 8px 16px calc(12px + var(--safe-b)); background: #fff; border-top: 1px solid #F0F0F0; }
.vsheet .buybar.in-sheet { position: static; padding: 0; box-shadow: none; background: none; }
.vs-hint { margin: 0 0 6px; font-size: 12.5px; line-height: 1.5; color: var(--coral-text); text-align: right; }
.vs-hint:empty { display: none; }
.vs-opt { gap: 12px; }
.vs-opt-l { flex: 1; min-width: 0; }
.vs-opt-p { flex: none; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; }
.vs-opt[aria-checked="true"] .vs-opt-p { color: var(--coral-text); }
.vs-opt[disabled] .vs-opt-p { color: #BBB; }
@media (min-width: 640px) {
  .sheet.vsheet { max-height: min(90vh, 640px); padding: 0; overflow: hidden; }
  .sheet:not(.lightbox).vsheet { padding: 0; }
  .vsheet .vs-head { align-items: center; padding-right: 56px; }
  .vsheet .vs-thumb { width: 72px; height: 72px; margin-top: 0; border-width: 0; box-shadow: none; }
  .vsheet .vs-foot { padding: 10px 20px 16px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .sheet.vsheet { max-height: calc(100dvh - 24px); overflow: hidden; }
  .vsheet .vs-head { align-items: center; padding: 10px 56px 10px 16px; }
  .vsheet .vs-thumb { width: 56px; height: 56px; margin-top: 0; border-width: 0; box-shadow: none; }
  .vsheet .vs-sec { padding: 10px 16px; }
  .vsheet .vs-foot { padding: 8px 16px calc(8px + var(--safe-b)); }
}

/* 2. 放大看圖：全螢幕深色，蓋過頂部、底部固定列 */
.sheet.lightbox { position: fixed; inset: 0; left: 0; right: 0; top: 0; bottom: 0; width: auto; max-width: none; max-height: none; margin: 0; translate: none; z-index: 45; display: grid; place-items: center; padding: 0; background: rgba(0, 0, 0, .92); border-radius: 0; box-shadow: none; overflow: hidden; pointer-events: auto; animation: fade .2s ease-out; }
.is-leaving.sheet.lightbox { animation: fade-out .15s ease-in forwards; }
.lightbox .lb-img { width: auto; height: auto; max-width: min(92vw, 1100px); max-height: 88dvh; object-fit: contain; border-radius: 4px; user-select: none; }
.lightbox .lb-x { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #222; font-size: 18px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.lb-nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; transition: background .15s, opacity .15s; }
.lb-nav:hover { background: rgba(255, 255, 255, .28); }
.lb-nav:disabled { opacity: .25; cursor: default; }
.lb-prev { left: calc(12px + env(safe-area-inset-left, 0px)); }
.lb-next { right: calc(12px + env(safe-area-inset-right, 0px)); }
.lb-count { position: absolute; left: 50%; bottom: calc(16px + var(--safe-b)); translate: -50% 0; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.scrim:has(+ .lightbox) { background: rgba(0, 0, 0, .6); z-index: 44; }

/* 7. 按鈕字永遠不斷行：字級跟著螢幕縮、按鈕可以伸縮 */
.buybar { gap: 10px; }
.buybar .bb-sum { flex: 1 0 auto; min-width: 0; }
.buybar .btn-coral, .buybar .btn-green { flex: 0 1 168px; width: auto; min-width: 0; padding: 12px 10px; white-space: nowrap; font-size: clamp(13px, 3.9vw, 16px); line-height: 1.25; }
.paybar .btn-coral { white-space: nowrap; font-size: clamp(14px, 4.2vw, 16px); }

/* 10. 購物車：加減鈕用主題色、夠大好按；快沒貨才提醒；備註收起來 */
.stepper { height: 40px; }
.stepper button { width: 40px; border-color: var(--coral-line); color: var(--coral-text); font-size: 20px; }
.stepper button:hover:not([disabled]) { background: var(--coral-soft); }
.stepper button[disabled] { color: #CCC; border-color: var(--line); }
.stepper output { width: 48px; border-color: var(--coral-line); font-variant-numeric: tabular-nums; }
.ci-low { color: #C2410C; font-weight: 600; }
.ci-note-add { grid-column: 1 / -1; justify-self: start; min-height: 32px; padding: 4px 0; font-size: 13px; color: var(--coral-text); }

/* 11. 篩選小選單：四個供貨方式一排放得下 */
.sheet.is-pop .f-chip { padding: 7px 13px; }


/* ===== 前台打磨 2 ===== */
:root { --wrap: 1240px; }
/* 3. 電腦版：頂部選單取代底部分頁 */
.topnav { display: none; }
.sh-back { flex: none; }
.badge { font-family: inherit; font-variant-numeric: tabular-nums; }
.top-menu .opt-row { justify-content: flex-start; gap: 12px; }
.top-menu .opt-row i { width: 18px; text-align: center; color: var(--text-3); }
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .shophead { padding: 10px max(24px, calc(50% - var(--wrap) / 2)); }
  .topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
  .topnav > a, .topnav-more { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 999px; color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
  .topnav > a:hover, .topnav-more:hover { background: var(--coral-soft); color: var(--coral-text); }
  .topnav > a i:not(.badge) { font-size: 15px; }
  .topnav [aria-current="page"] { color: var(--coral-text); background: var(--coral-soft); font-weight: 600; }
  .topnav .badge { position: static; margin-left: -2px; }
  .topnav-more { width: 40px; justify-content: center; padding: 0; font-size: 16px; }
  body[data-page="about"] .shophead { display: flex; }
  .more-add-home { display: none !important; }
  .paybar { bottom: 0; padding-bottom: calc(12px + var(--safe-b)); }
}
.sheet.top-pop.is-pop { padding: 6px; }
/* 600–1023：底部分頁滿版，不再是浮動的膠囊 */
@media (min-width: 600px) and (max-width: 1023px) {
  .tabbar { left: 0; right: 0; width: auto; transform: none; border-radius: 0; }
  .tabbar > a, .tabbar > button { font-size: 12px; }
}
/* 16. 更多抽屜：分類用商品照片當圖示 */
.more-cats .mc { overflow: hidden; background: var(--bg); flex: none; }
.more-cats .mc img { width: 100%; height: 100%; object-fit: cover; }
.more-cats a { min-height: 48px; }


/* ===== 前台打磨 3 ===== */
:root { --tabbar: calc(56px + var(--safe-b)); }
@media (min-width: 1024px) { :root { --tabbar: 0px; } }
@media (orientation: landscape) and (max-height: 500px) { :root { --tabbar: calc(44px + var(--safe-b)); } }
body { padding-bottom: var(--tabbar); }
.paybar { bottom: var(--tabbar); }
/* 有頁尾的頁面：頁尾深色底一路延伸到分頁列下面，不留灰條、分頁列不蓋住頁尾 */
body:has(.sfoot) { padding-bottom: 0; }
.sfoot-bottom { padding-bottom: calc(22px + var(--tabbar)); }

/* 12. 中文斷行：內文 pretty、標題 balance；數字＋單位不拆 */
body { text-wrap: pretty; }
h1, h2, h3, .sfoot h2, .about-card h1 { text-wrap: balance; }
.nb { white-space: nowrap; }

/* 8. 共用空狀態 */
.empty-state { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 48px 16px; text-align: center; }
.es-ico { width: 56px; height: 56px; margin-bottom: 8px; color: var(--coral-light); }
.empty-state h2 { font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--text); }
.empty-state p { max-width: 32em; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.empty-state .btn-coral, .empty-state .btn-line { margin-top: 12px; min-width: 160px; padding: 11px 24px; font-size: 15px; border-radius: 999px; }
.cartpage.is-empty { padding-bottom: 32px; }

/* 17. 頁面標題：跟頂部店名列對齊 */
.page-title { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 16px; font-size: 22px; font-weight: 800; line-height: 1.35; }
.page-title small { font-size: 14px; font-weight: 500; color: var(--text-3); }

/* 6. 結帳：標題下的線改成細線；手機版上方可展開「訂單明細」 */
.co-sec > h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.co-peek { margin: 0 0 20px; background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); }
.co-peek summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; }
.co-peek summary::-webkit-details-marker { display: none; }
.co-peek summary span { flex: 1; display: flex; align-items: baseline; gap: 8px; }
.co-peek summary small { font-size: 13px; font-weight: 400; color: var(--text-3); }
.co-peek summary b { color: var(--coral-text); font-variant-numeric: tabular-nums; }
.co-peek summary i { font-size: 12px; color: var(--text-3); transition: rotate .2s; }
.co-peek[open] summary i { rotate: 180deg; }
.co-peek .sum-items { padding: 4px 16px 4px; border-top: 1px solid var(--line-2); }
.co-peek .sum-items li:first-child { padding-top: 12px; }
.co-peek .sum-items li:last-child { border-bottom: 0; }
.side-cta { display: none; }
.col-side .co-sec { margin-bottom: 0; }
/* 600–1023：底部購買列／結帳列只跟內容欄一樣寬 */
@media (min-width: 600px) and (max-width: 1023px) {
  .paybar, .buybar:not(.in-sheet) { left: 50%; right: auto; width: min(720px, 100%); translate: -50% 0; border-radius: 16px 16px 0 0; }
}
/* ≥1024：購物車、結帳兩欄，右邊訂單摘要固定在畫面上，底部結帳列拿掉 */
@media (min-width: 1024px) {
  .home { max-width: calc(var(--wrap) + 48px); padding: 24px 24px 40px; }
  .page.wide { max-width: calc(var(--wrap) + 48px); padding: 24px 24px 56px; }
  .page-title { font-size: 26px; margin-bottom: 20px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
  .col-side { position: sticky; top: 89px; max-height: calc(100vh - 105px); overflow-y: auto; overscroll-behavior: contain; border-radius: 12px; }
  .col-side .csum { margin-top: 0; }
  .side-cta { display: flex; margin-top: 12px; }
  .cartpage .paybar, .checkout .paybar, .co-peek { display: none; }
  .cartpage, .checkout { padding-bottom: 56px; }
  .cartpage .side-cta { margin-top: 12px; }
}

/* 15. 電腦版商品格：自動欄數；可滑鼠的裝置整張卡片都能點，不另外放「查看商品」 */
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
}
@media (hover: hover) and (pointer: fine) {
  .pc-btn { display: none; }
  .pc-name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
  .pc-fav { z-index: 2; }
  .pcard { transition: box-shadow .2s, translate .2s; }
  .pcard:hover { box-shadow: 0 10px 28px rgba(40, 30, 20, .12); translate: 0 -2px; }
  .pc-img img { transition: scale .35s ease; }
  .pcard:hover .pc-img img { scale: 1.04; }
  .pcard:hover .pc-name { color: var(--coral-text); }
  .pcard:has(.pc-name:focus-visible) { outline: 2px solid var(--focus, var(--coral)); outline-offset: 2px; }
  .pc-name:focus-visible { outline: none; }
  .pc-price { margin-bottom: 0; }
}

/* 14. 商品頁 */
.gallery-thumbs { padding: 4px; }
.gallery-thumbs button { border: 0; }
.gallery-thumbs button.active { outline: 2px solid var(--coral-text); outline-offset: 2px; }
@media (min-width: 600px) and (max-width: 1023px) and (orientation: portrait) {
  .gallery { width: min(calc(100% - 32px), 60vh); margin: 16px auto 0; }
  .gallery-thumbs { width: min(calc(100% - 32px), 60vh); margin: 8px auto 0; }
}
@media (min-width: 1024px) {
  .pdp { max-width: calc(var(--wrap) + 48px); padding-left: 24px; padding-right: 24px; column-gap: 32px; }
  .pdp > .pdp-media { top: 66px; }
  .pdp > :not(.pdp-media):not(.buybar) { margin-right: 0; }
  .pdp-media .gallery, .pdp-media .gallery-thumbs { margin-left: 0; margin-right: 0; width: min(100%, calc(100vh - 250px)); }
  .pdp-media .gallery-thumbs { margin-left: 0; }
  .pdp .vpick { width: auto; justify-self: stretch; }
  .pdp > .also { grid-column: 1 / -1; margin: 32px 0 0; }
  .also-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; overflow: visible; margin: 0; padding: 4px 0 8px; }
  .also-card, .also-card .pc-img { width: auto; }
  .also h2 { font-size: 20px; margin-bottom: 12px; }
  .buybar:not(.in-sheet) { width: min(calc(var(--wrap) + 48px), 100%); }
}

/* 13. 商家簡介：同一個背景、同一個容器、封面矮一點、頁尾電腦版三欄 */
body[data-page="about"] { background: var(--bg); }
.about .cover { height: min(30vh, 220px); }
@media (min-width: 640px) {
  .about-card, .terms-sec { max-width: calc(var(--wrap) + 48px); margin-left: auto; margin-right: auto; }
  .about-card { margin-top: -64px; margin-left: max(16px, calc(50% - var(--wrap) / 2)); margin-right: max(16px, calc(50% - var(--wrap) / 2)); }
  .terms-sec { padding: 28px max(16px, calc(50% - var(--wrap) / 2)); max-width: none; }
}
@media (min-width: 768px) {
  .sfoot-in { grid-template-columns: 2fr 1fr 1fr; gap: 32px; max-width: calc(var(--wrap) + 48px); margin: 0 auto; padding: 0 24px 28px; }
  .sfoot-links { display: contents; }
  .sfoot .social { justify-content: flex-start; max-width: calc(var(--wrap) + 48px); margin: 0 auto; }
}

/* 18. 日期欄位：Safari 空白時高度不塌、看得到「選擇日期」 */
.date-wrap { position: relative; display: block; }
input[type="date"].inp { display: block; min-height: 46px; -webkit-appearance: none; appearance: none; text-align: left; }
input[type="date"].inp::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
.date-ph { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--text-3); font-size: 14px; pointer-events: none; display: none; }
.date-wrap.is-empty .date-ph { display: block; }
.date-wrap.is-empty input::-webkit-datetime-edit { color: transparent; }
.date-wrap.is-empty input:focus::-webkit-datetime-edit { color: inherit; }
.date-wrap.is-empty input:focus + .date-ph { display: none; }

/* 5. 手機橫放（矮螢幕）：拿掉公告、店名列變矮、分頁只剩圖示、底部列變薄、商品頁兩欄 */
@media (orientation: landscape) and (max-height: 500px) {
  .announce { display: none; }
  .shophead { height: 48px; padding-top: 4px; padding-bottom: 4px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .sh-brand img { width: 32px; height: 32px; }
  .sh-brand small { display: none; }
  .sh-brand b { font-size: 15px; }
  .tabbar { height: var(--tabbar); }
  .tabbar > a > span, .tabbar > button > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tabbar .badge { top: 2px; }
  .paybar { padding: 6px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left)); }
  .checkout .paybar { padding-bottom: calc(6px + var(--safe-b)); }
  .buybar:not(.in-sheet) { padding: 6px max(16px, env(safe-area-inset-right)) calc(6px + var(--safe-b)) max(16px, env(safe-area-inset-left)); }
  .paybar .bb-sum, .buybar:not(.in-sheet) .bb-sum { display: flex; align-items: baseline; gap: 8px; }
  .paybar .bb-sum b, .buybar:not(.in-sheet) .bb-sum b { font-size: 18px; line-height: 1.3; }
  .paybar .btn-coral, .buybar:not(.in-sheet) .btn-coral, .buybar:not(.in-sheet) .btn-green { min-height: 40px; padding: 8px 14px; }
  .cartpage { padding-bottom: 120px; }
  .checkout { padding-bottom: 72px; }
  .page { padding-top: 12px; }
  .member { padding: 12px 16px 24px; }
  .mcard { padding: 16px; }
  .mcard img { width: 44px; height: 44px; }
  .mcard h1 { margin-top: 0; font-size: 18px; }
  .mlogin { margin-top: 12px; padding: 16px; }
  .page-title { margin-bottom: 12px; font-size: 20px; }
  .co-sec > h2 { margin-bottom: 12px; }
  .about .cover { height: 120px; }
  .toast { bottom: calc(64px + var(--safe-b)); }
  /* 商品頁兩欄（跟電腦版同一套） */
  .pdp { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; align-items: start; padding: 0 max(16px, env(safe-area-inset-right)) 72px max(16px, env(safe-area-inset-left)); }
  .pdp > .pdp-media { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 48px; }
  .pdp > :not(.pdp-media):not(.buybar) { grid-column: 2; margin-left: 0; margin-right: 0; }
  .pdp .vpick { width: auto; justify-self: stretch; }
  .pdp-media .gallery { width: min(100%, calc(100dvh - 150px)); margin: 12px auto 0; }
  .pdp-media .gallery-thumbs { width: min(100%, calc(100dvh - 150px)); margin: 6px auto 0; }
  .gallery-thumbs button { width: 48px; height: 48px; }
  .pdp > .also { grid-column: 1 / -1; }
  .pinfo h1 { font-size: 18px; }
}


/* ===== 前台打磨 4 ===== */
/* 14. 你可能也喜歡：在商品兩欄外面，整排滿版 */
.pdp, .pdp.pdp { padding-bottom: 0; }
body[data-page="p"] main { padding-bottom: 96px; }
.pdp-more { max-width: 720px; margin: 0 auto; }
.also h2 { font-size: 18px; font-weight: 800; }
@media (min-width: 1024px) {
  .pdp-more { max-width: calc(var(--wrap) + 48px); padding: 0 24px; }
  .pdp-more .also { margin: 40px 0 0; }
}
@media (orientation: landscape) and (max-height: 500px) {
  body[data-page="p"] main { padding-bottom: 64px; }
  .pdp-more { max-width: none; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .pdp-more .also { margin-left: 0; margin-right: 0; }
}
/* 13. 有頁尾的頁面：內容不夠長時頁尾貼齊畫面底部，不露出一截空白 */
body:has(.sfoot) main { display: flex; flex-direction: column; min-height: calc(100dvh - 65px); }
body:has(.sfoot) main > * { width: 100%; }
body[data-page="about"] main { min-height: 100dvh; }
.about { flex: 1; display: flex; flex-direction: column; }
.sfoot { margin-top: auto; }
@media (min-width: 1024px) { body[data-page="about"] main { min-height: calc(100dvh - 65px); } }
/* 小按鈕放大到好按 */
.drawer-x { display: grid; place-items: center; min-width: 40px; min-height: 40px; }
.ci-name { min-height: 32px; }

@media (orientation: landscape) and (max-height: 500px) { .mcard > img { display: none; } .mcard { gap: 2px; padding: 12px 16px; } .lookup-h { margin-top: 12px; } }

@media (min-width: 1024px) {
  .about-card { margin-left: max(24px, calc(50% - var(--wrap) / 2)); margin-right: max(24px, calc(50% - var(--wrap) / 2)); }
  .terms-sec { padding-left: max(24px, calc(50% - var(--wrap) / 2)); padding-right: max(24px, calc(50% - var(--wrap) / 2)); }
}

/* 首頁橫幅 */
.banner { position: relative; margin: 0 0 12px; border-radius: 14px; overflow: hidden; background: #f3f3f3; }
.bn-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.bn-track::-webkit-scrollbar { display: none; }
.bn-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 2 / 1; display: block; }
.bn-slide img, .bn-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 桌機：2:1 在寬螢幕會到 600 多 px 高，壓到 360px 以內、裁切時保留中間偏上（手機不變） */
@media (min-width: 1024px) { .bn-slide { aspect-ratio: auto; height: min(360px, 50vw); } .bn-slide img, .bn-slide video { object-position: 50% 40%; } }
.bn-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.bn-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.6); transition: width .2s; }
.bn-dots i.on { width: 16px; background: #fff; }
/* 打開賣場的跳出視窗：置中（寬螢幕的 .sheet 有 margin-left 和 translate，這裡要抵消，不然會被推到左上） */
.sheet.modal { top: 50%; bottom: auto; left: 50%; right: auto; width: min(92vw, 420px); margin-left: 0; translate: none; transform: translate(-50%, -50%); border-radius: 20px; max-height: 84dvh; animation: none; padding-bottom: 20px; }
.lg-modal { padding: 0 !important; overflow: hidden; }
.lg-head { background: var(--coral); color: var(--on-coral); text-align: center; padding: 28px 20px 22px; }
.lg-head img { border-radius: 50%; border: 4px solid rgba(255,255,255,.7); background: #fff; object-fit: cover; }
.lg-head h2 { margin: 10px 0 2px; font-size: 20px; color: inherit; }
.lg-head p { margin: 0; opacity: .9; }
.lg-body { display: grid; gap: 8px; padding: 18px 22px 22px; text-align: center; }
.lg-body .hint { margin: 0 0 6px; color: var(--text-2); font-size: 14px; }
.lg-step { margin: 0; color: var(--coral-text); font-weight: 700; font-size: 14px; }
.lg-btn { display: block; padding: 14px; border-radius: 999px; background: #06C755; color: #fff; font-weight: 700; text-decoration: none; }
.lg-next { padding: 13px; border-radius: 999px; border: 0; background: #F2F3F5; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.tp-body { max-height: 52dvh; overflow-y: auto; }
.tp-skip { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-2); }

/* 兩層規格 */
.vs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vs-chip { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 15px; color: var(--text); cursor: pointer; }
.vs-chip[aria-checked="true"] { border-color: var(--coral); background: var(--coral-soft); color: var(--coral-text); font-weight: 700; }
.vs-chip:disabled { opacity: .4; cursor: not-allowed; }
.vs-chip.is-out { text-decoration: line-through; }
.vs-label2 { margin-top: 14px; }

/* 電腦版商品頁：主圖依螢幕高度縮小時，左欄跟著縮，右邊資訊直接接上，不留一大塊空白 */
@media (min-width: 1024px) {
  .pdp { grid-template-columns: minmax(320px, min(calc(50% - 16px), calc(100vh - 250px))) minmax(0, 1fr); }
}

/* iPhone／iPad（含 LINE 內建瀏覽器）：輸入框字小於 16px，點下去整頁會放大縮不回來 */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: max(16px, 1em) !important; }
}
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: max(16px, 1em) !important; }
}

/* 手機結帳：最下面「送出訂單即表示同意 購物須知」不能被底部付款列蓋住（付款列約 75px＋安全區） */
.checkout { padding-bottom: calc(120px + var(--safe-b)) !important; }
@media (min-width: 1024px) { .checkout { padding-bottom: 56px !important; } }

/* 要登入會員才看得到商品 */
.gate-card { margin-top: 24px; }
.gate-card > p { margin-bottom: 18px; }
.gate-links { display: flex; justify-content: center; gap: 20px; margin: 18px 0 32px; font-size: 15px; }
.gate-links a, .gate-links .link-in { color: var(--ink-2, #555); text-decoration: underline; }

/* 稽核修正：一長串沒空格的英文／數字（商品名、規格）不要把整頁撐寬，底部「加入購物車」才不會被推出畫面 */
h1, h2, h3, .pc-name, .ci-name, .csum-row > span:first-child { overflow-wrap: anywhere; }
.buybar { max-width: 100vw; }
.closed-bar { margin: 0; padding: 10px 16px; background: #FFF4E5; color: #8A4B00; font-size: 14px; display: flex; gap: 8px; align-items: center; justify-content: center; text-align: center; }
/* 第二輪稽核：會員中心分頁在 iPhone SE 不要擠成兩行 */
.me-tabs button { white-space: nowrap; font-size: clamp(13px, 3.6vw, 15px); padding: 0 6px; }
/* 鍵盤操作看得到現在在哪（結帳欄位原本拿掉了外框） */
.inp:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--focus, var(--coral)); outline-offset: 2px; }
/* 彈窗：按鈕固定在底部，內容長也看得到「同意」 */
.sheet.modal .sheet-btns { position: sticky; bottom: -20px; background: #fff; padding: 12px 0; margin-bottom: -20px; z-index: 1; }
.is-off { opacity: .55; pointer-events: none; }
.lg-later { display: block; margin: 10px auto 0; min-height: 40px; padding: 0 12px; border: 0; background: none; color: var(--text-2, #666); font-size: 14px; text-decoration: underline; cursor: pointer; }
/* 查詢物流進度 */
.track-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: 6px 0; }
.track-no { padding: 10px 0; border-top: 1px solid var(--line); }
.track-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.track-links .btn-line { min-height: 44px; padding: 0 14px; }
/* 規格照片：選規格清單左邊小圖 */
.vs-opt-img { flex: none; width: 40px; height: 40px; border-radius: 6px; overflow: hidden; background: #F1F1F1; }
.vs-opt-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* iPhone 鍵盤收起後底部列卡在中間：用 --vv-fix 推回去（data.js 開頭） */
.tabbar, .buybar:not(.in-sheet), .paybar, .sheet, .toast { translate: 0 var(--vv-fix, 0px); }
/* 商品頁也看得到購物車（分頁列在商品頁是收起來的） */
.pdp { position: relative; }
.pdp-cart { position: absolute; top: 10px; right: 10px; z-index: 30; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #2C2C2C; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); text-decoration: none; font-size: 18px; }
.pdp-cart-n { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--coral, #FF5D5D); color: var(--on-coral, #fff); font-size: 12px; line-height: 20px; text-align: center; }
@media (min-width: 900px) { .pdp-cart { display: none; } }
.msg-new { margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--coral, #FF5D5D); color: #fff; font-size: 12px; } /* 賣家回覆了留言 */

/* 手機（手指點）：小按鈕至少 40px（巡檢：愛心 30、搜尋框 28、照片左右 34、分類 38…） */
@media (pointer: coarse) {
  .searchbox { min-height: 44px; }
  .searchbox input { min-height: 40px; }
  .pc-fav { min-width: 40px; min-height: 40px; }
  .pc-btn, .cat, .ci-note-add, .addon-box .btn-line, .addon-box .btn-coral { min-height: 40px; }
  .g-nav, .g-expand { width: 40px; height: 40px; }
}
/* 長列表不用 content-visibility：每次換頁整個重畫，預估高度跟實際差很多，按返回回不到原位、往上捲會跳（第四輪巡檢） */
/* 寬畫面的彈出視窗置中（-50%）：不要被上面的 iPhone 底部校正蓋掉 */
@media (min-width: 640px) { .sheet:not(.lightbox):not(.is-pop) { translate: 0 calc(-50% + var(--vv-fix, 0px)); } }
.pdp-media { position: relative; } /* 購物車鍵放在照片右上角裡面 */
@media (pointer: coarse) { #about-share, .co-ask a, [data-copy] { min-height: 40px; display: inline-flex; align-items: center; } }
/* 600–1023（手機橫拿、iPad 直拿）購買列／結帳列是置中的（-50%）：上面那條 iPhone 底部校正把它蓋掉，列跑到畫面右邊外面、按不到（第五輪巡檢） */
@media (min-width: 600px) and (max-width: 1023px) { .paybar, .buybar:not(.in-sheet) { translate: -50% var(--vv-fix, 0px); } }
.p-preorder { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: #F3EEFF; color: #5B3FA8; font-size: 14px; }

/* 結帳頁的商品備註 */
.co-inote-w { display: block; margin-top: 6px; }
.co-inote { width: 100%; min-height: 36px; padding: 6px 10px; font-size: 14px; }

/* 第九輪：長備註自動換行；結帳頁商品備註欄佔整列寬 */
.ocard .ci-sub, .sum-items .ci-sub, .order-note { overflow-wrap: anywhere; }
.sum-items li > div { min-width: 0; }
.sum-items li .co-inote-w { grid-column: 1 / -1; }

/* 第十二輪：查訂單捲到結果時，標題不要被頂端固定的店名列蓋住 */
#lk-res, #lk-res h2 { scroll-margin-top: 80px; }

/* 第十六輪：購物車頁有結帳列，提示放在它上面 */
body:has(.cartpage .paybar) .toast { bottom: calc(56px + var(--safe-b) + 96px); }
.order-note { white-space: pre-line; }
.ocard .ci-sub { white-space: pre-line; }

.sfoot-by { font-size: 11px; line-height: 1.6; color: rgba(255, 255, 255, .82); }
.sfoot-by a { color: inherit; text-underline-offset: 3px; }
/* 下單自動成為會員（設定 autoMember）：結帳同意勾選、查訂單上面的會員資料 */
button.pill-line { background: none; cursor: pointer; font: inherit; font-size: 12.5px; }
.am-saved span { flex: 1 1 auto; min-width: 0; }
.am-row { margin: 10px 0 6px; font-size: 13.5px; line-height: 1.5; }
.am-prof { margin: 18px 0 8px; }
.am-prof .sec-title { margin-top: 0; }
.am-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: 14px; }
.am-kv dt { color: var(--text-3); }
.am-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
