/* 浪子彈飛 前台樣式：配色取自 LOGO（黑底、桃紅、紫、煙霧白），手機優先。 */
:root {
  --bg: #0a0a0f; --panel: #14141c; --panel-2: #1c1c27; --line: #2c2c3b;
  --pink: #ff1f8e; --pink-deep: color-mix(in srgb, var(--pink) 78%, #000); --purple: #b14dff; --smoke: #e8e6f2; --muted: #9a98ad;
  --danger: #ff5470; --radius: 14px; --bar: rgba(10, 10, 15, .9);
  --tab-h: 58px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--smoke); background: var(--bg);
  font: 15px/1.55 "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
body.locked { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* 背景：LOGO 後方那種桃紅與紫色的煙霧 */
.smoke {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 40vmax at 12% -5%, color-mix(in srgb, var(--purple) 30%, transparent), transparent 60%),
    radial-gradient(55vmax 38vmax at 100% 8%, color-mix(in srgb, var(--pink) 26%, transparent), transparent 60%),
    radial-gradient(70vmax 45vmax at 50% 110%, color-mix(in srgb, var(--purple) 16%, transparent), transparent 60%);
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 14px 28px; }

/* 頂列 */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bar); backdrop-filter: blur(10px);
  border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--pink), var(--purple), transparent) 1;
}
.topbar .brand img { height: 44px; display: block; }
.cart-btn { position: relative; width: 44px; height: 44px; border: 0; background: none; color: var(--smoke); }
.cart-btn .badge {
  position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px;
}

/* 主視覺 */
.hero { text-align: center; padding: 10px 0 4px; }
.hero-logo { width: min(100%, 520px); height: auto; filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--pink) 28%, transparent)); }
.store-name {
  display: inline-block; margin: 0 0 6px; padding: 3px 18px; font-weight: 800; font-style: italic; letter-spacing: .08em;
  color: #fff; background: linear-gradient(100deg, var(--pink), var(--purple)); transform: skewX(-10deg);
}

/* 跑馬燈 */
.marquee { overflow: hidden; white-space: nowrap; background: linear-gradient(90deg, var(--pink-deep), color-mix(in srgb, var(--purple) 78%, #000)); color: #fff; font-weight: 700; font-size: 14px; }
.marquee-track { display: inline-block; padding: 7px 0; animation: marquee linear infinite; }
.marquee-track span { display: inline-block; padding: 0 28px; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* 輪播活動圖 */
.slider { position: relative; overflow: hidden; margin: 6px 0 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.slides { display: flex; transition: transform .45s ease; }
.slides img { flex: 0 0 100%; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 7px; }
.dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.dots button.active { width: 22px; border-radius: 5px; background: var(--pink); }

/* 賣場優惠公告與商品上的優惠標籤 */
.notices, .promo-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.notices span, .promo-tags span {
  padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff;
  background: color-mix(in srgb, var(--pink) 18%, transparent); border: 1px solid var(--pink);
}
.promo-tags { margin: 14px 0 0; }
.card .promo { margin: 0; font-size: 12px; font-weight: 700; color: var(--pink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-hints { margin-top: 14px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--pink); background: color-mix(in srgb, var(--pink) 10%, transparent); }
.gift-text { margin: 4px 0 6px; font-size: 16px; font-weight: 700; line-height: 1.7; color: #ffe066; }
.cart-hints h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; color: var(--pink); }
.sheet-body.center .sums { text-align: left; margin: 0 0 14px; }
.cart-hints p { margin: 0; font-size: 13px; font-weight: 700; color: #fff; }
.cart-hints p + p { margin-top: 6px; }
.cart-hints p.ready { color: #ffe066; font-size: 14px; }
.cart-line .price s { color: var(--muted); font-weight: 400; font-size: 13px; }
.sums { display: grid; grid-template-columns: 1fr max-content; gap: 4px 16px; margin: 14px 0 0; font-size: 14px; }
.sums dt { color: var(--muted); }
.sums dd { margin: 0; text-align: right; }
.sums .off { color: var(--pink); }

/* 筆刷風格標題：斜體粗字加一道桃紅筆觸 */
.brush {
  position: relative; display: inline-block; margin: 0 0 14px; font-size: 22px; font-weight: 900; font-style: italic; letter-spacing: .06em;
}
.brush::after {
  content: ""; position: absolute; left: -6px; right: -14px; bottom: -4px; height: 7px;
  background: linear-gradient(90deg, var(--pink), var(--purple)); transform: skewX(-24deg); border-radius: 2px;
}

/* 搜尋與分類 */
.search input {
  width: 100%; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); outline: none;
}
.search input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 20%, transparent); }
/* 分類：六種呈現方式，由賣場在後台選，對應 body 的 cats-xxx */
.cats { display: flex; gap: 8px; padding: 14px 0; }
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none; padding: 7px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-weight: 700; white-space: nowrap; transform: skewX(-8deg);
}

/* 1. 三欄方塊：全部看得到 */
.cats-grid .cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cats-grid .cats button { padding: 10px 4px; font-size: 13px; white-space: normal; line-height: 1.3; transform: none; border-radius: 10px; }
@media (min-width: 640px) { .cats-grid .cats { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* 2. 自動換行標籤 */
.cats-wrap .cats { flex-wrap: wrap; }
.cats-wrap .cats button { padding: 6px 12px; font-size: 13px; }

/* 3. 橫向滑動列：右邊淡出，提示後面還有 */
.cats-scroll .cats, .cats-sticky .cats { overflow-x: auto; scrollbar-width: none; }
.cats-scroll .cats { padding-right: 40px; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }

/* 4. 置頂滑動列：捲動時黏在頂列下方，左右貼齊畫面邊緣 */
.cats-sticky .cats {
  position: sticky; top: 56px; z-index: 15; margin: 0 -14px; padding: 10px 14px;
  background: var(--bar); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}

/* 5. 左側直欄：分類固定在左邊，商品在右邊 */
.cats-sidebar .shop-body { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; margin-top: 14px; align-items: start; }
.cats-sidebar .cats {
  flex-direction: column; gap: 6px; padding: 0; position: sticky; top: 66px;
  max-height: calc(100vh - 66px - var(--tab-h) - 16px); overflow-y: auto; scrollbar-width: none;
}
.cats-sidebar .cats button { padding: 10px 4px; font-size: 12px; white-space: normal; line-height: 1.3; transform: none; border-radius: 8px; }
.cats-sidebar .cats button.active { box-shadow: none; }
.cats-sidebar .card h3 { font-size: 13px; }
.cats-sidebar .card .foot { flex-direction: column; align-items: flex-start; gap: 6px; }
@media (min-width: 640px) { .cats-sidebar .shop-body { grid-template-columns: 150px minmax(0, 1fr); } .cats-sidebar .cats button { font-size: 14px; } }

/* 6. 下拉選單 */
.cats-dropdown .cats { display: block; }
.cats select {
  width: 100%; padding: 12px 40px 12px 16px; border-radius: 10px; border: 1px solid var(--pink); background-color: var(--panel);
  color: #fff; font: inherit; font-weight: 700; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--pink) 50%), linear-gradient(135deg, var(--pink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 55%, calc(100% - 15px) 55%; background-size: 7px 7px; background-repeat: no-repeat;
}
.cats button.active { color: #fff; border-color: transparent; background: linear-gradient(100deg, var(--pink), var(--purple)); box-shadow: 0 4px 16px color-mix(in srgb, var(--pink) 35%, transparent); }

/* 商品卡 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card {
  display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover, .card:active { transform: translateY(-2px); border-color: var(--pink); box-shadow: 0 8px 24px color-mix(in srgb, var(--pink) 20%, transparent); }
/* 商品圖多半是直式長圖，卡片上一律裁成正方形（靠上），完整圖片在商品視窗看 */
.card .pic { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--panel-2); }
.card .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card .flag { position: absolute; top: 8px; left: -4px; padding: 2px 12px; background: #000c; color: var(--muted); font-size: 12px; font-weight: 700; transform: skewX(-10deg); }
.card.sold-out .pic img { filter: grayscale(.8) brightness(.6); }
.card .info { display: flex; flex-direction: column; gap: 4px; padding: 10px 11px 11px; flex: 1; }
.card h3 { margin: 0; font-size: 14px; line-height: 1.4; }
.note { margin: 0; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { color: var(--pink); font-weight: 900; font-size: 17px; font-style: italic; }
.card .go { padding: 3px 12px; border-radius: 4px; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(100deg, var(--pink), var(--purple)); transform: skewX(-10deg); }
.card.sold-out .go { background: var(--panel-2); color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* 按鈕 */
.btn {
  display: block; width: 100%; padding: 13px; margin-top: 12px; text-align: center; text-decoration: none;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--smoke); font-weight: 800; letter-spacing: .08em;
}
.btn.primary { border: 0; color: #fff; background: linear-gradient(100deg, var(--pink), var(--purple)); box-shadow: 0 6px 20px color-mix(in srgb, var(--pink) 35%, transparent); }
.btn:disabled { opacity: .6; }

/* 底部彈出視窗 */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .7); }
.sheet-body {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  padding: 22px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--panel); border-top: 3px solid var(--pink); border-radius: 20px 20px 0 0; animation: rise .22s ease-out;
}
@media (min-width: 640px) { .sheet { align-items: center; } .sheet-body { border-radius: 20px; border: 1px solid var(--line); border-top: 3px solid var(--pink); } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet-body.center { text-align: center; }
.sheet h3 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); }
.close { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 28px; line-height: 1; }

.p-head { display: flex; gap: 14px; }
.p-head img { width: 108px; height: 108px; flex: none; object-fit: cover; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.p-head h2 { margin: 0 28px 4px 0; font-size: 17px; line-height: 1.4; }
.p-head .note { -webkit-line-clamp: 4; }
.p-meta { margin: 8px 0 0; display: flex; align-items: baseline; gap: 12px; }
.p-meta .price { font-size: 24px; }
.stock { color: var(--muted); font-size: 13px; }

.options { display: flex; flex-wrap: wrap; gap: 8px; }
.options button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.options button.active { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 16%, transparent); color: #fff; box-shadow: 0 0 0 1px var(--pink) inset; }
.options button.out { color: #5d5b6e; text-decoration: line-through; background: transparent; }

.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 42px; height: 40px; border: 0; background: var(--panel-2); font-size: 18px; }
.qty input, .qty span { width: 56px; height: 40px; line-height: 40px; text-align: center; border: 0; background: transparent; outline: none; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty.small button { width: 32px; height: 32px; font-size: 16px; }
.qty.small span { width: 36px; height: 32px; line-height: 32px; }

/* 購物車 */
.cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 58px; height: 58px; flex: none; object-fit: cover; border-radius: 10px; background: var(--panel-2); }
.cart-line .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-line .mid strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line .mid span { font-size: 13px; color: var(--muted); }
.cart-line .mid .price { font-size: 15px; color: var(--pink); }
.total { text-align: right; font-size: 15px; margin: 14px 0 0; }
.total strong { font-size: 24px; color: var(--pink); font-style: italic; margin-left: 8px; }

form label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
form input, form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 11px 12px; resize: vertical;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--smoke); outline: none;
}
form input:focus, form textarea:focus { border-color: var(--pink); }
.form-error { margin: 0 0 4px; color: var(--danger); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.order-no { font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: .06em; color: var(--pink); margin: 4px 0 10px; }

/* 底部導覽 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bar); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.tabbar > * {
  flex: 1; display: flex; align-items: center; justify-content: center; border: 0; background: none;
  color: var(--muted); font-weight: 800; font-size: 14px; letter-spacing: .1em; text-decoration: none;
}
.tabbar .active { color: #fff; }
.tabbar .active span { border-bottom: 3px solid var(--pink); padding-bottom: 3px; }

/* 右側固定按鈕：LINE 客服、回到頂端。位置在底部導覽上方，低於彈出視窗 */
.fab { position: fixed; right: 12px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); z-index: 25; display: flex; flex-direction: column; gap: 10px; }
.fab > * { width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .55); }
.fab-line { background: #06c755; }
.fab-top { background: var(--panel-2); color: #fff; border: 1px solid var(--pink); }
@media (min-width: 992px) { .fab { right: calc(50vw - 480px - 70px); } }

/* 提示與年齡確認 */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px); transform: translateX(-50%); z-index: 60;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  padding: 10px 20px; border-radius: 18px; background: #fff; color: #111; font-weight: 700; box-shadow: 0 8px 24px #000a;
}
.toast.error { background: var(--danger); color: #fff; }
.gate { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 5, 8, .96); }
.gate-box { width: 100%; max-width: 380px; text-align: center; }
.gate-box img { width: 100%; }
.gate-box h2 { margin: 6px 0; font-size: 20px; }
.gate-box p { margin: 0 0 8px; color: var(--muted); }
.gate-deny { color: var(--danger) !important; margin-top: 16px !important; }

/* 訊息頁與訂單查詢頁 */
.notice, .box { margin-top: 18px; padding: 18px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.notice { text-align: center; }
.notice h1 { font-size: 20px; margin: 0 0 6px; }
.notice p { margin: 0; color: var(--muted); }
.box h2 { margin: 0 0 10px; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.box dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 10px; font-size: 14px; }
.box dt { color: var(--muted); }
.box dd { margin: 0; }
.box table { width: 100%; border-collapse: collapse; font-size: 14px; }
.box td { padding: 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.box td.num { text-align: right; white-space: nowrap; padding-left: 10px; }
.box td small { color: var(--muted); display: block; }
.box .sum { text-align: right; margin: 10px 0 0; }
.box .sum strong { color: var(--pink); font-size: 20px; font-style: italic; margin-left: 8px; }
.query-form { display: flex; gap: 8px; margin-top: 14px; }
.query-form input { flex: 1; min-width: 0; margin: 0; }
.query-form .btn { width: auto; margin: 0; padding: 0 22px; }
.status { flex: none; padding: 2px 12px; border-radius: 4px; font-size: 12px; font-weight: 800; color: #fff; background: var(--purple); transform: skewX(-10deg); }
.status.pending { background: #a37400; }
.status.completed { background: #1f9d55; }
.status.cancelled { background: #555466; }
.back { display: inline-block; margin-top: 16px; color: var(--pink); text-decoration: none; font-weight: 700; }

/* ---- 底部導覽：圖示與五種樣式，由賣場在後台選，對應 body 的 tab-xxx ---- */
.tabbar > * { position: relative; flex-direction: column; gap: 3px; font-size: 12px; letter-spacing: .06em; }
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .active { color: var(--pink); }
.tabbar .active span { border-bottom: 0; padding-bottom: 0; }
.tab-badge {
  position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--pink); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; line-height: 17px; letter-spacing: 0;
}
/* 只有圖示 */
.tab-icon .tabbar span { display: none; }
.tab-icon .tabbar svg { width: 27px; height: 27px; }
/* 只有文字：選中的項目底下一道主色線 */
.tab-text .tabbar svg { display: none; }
.tab-text .tabbar > * { font-size: 14px; letter-spacing: .1em; }
.tab-text .tabbar .active { color: var(--smoke); }
.tab-text .tabbar .active span { border-bottom: 3px solid var(--pink); padding-bottom: 3px; }
.tab-text .tab-badge { top: 9px; left: auto; right: 14%; }
/* 懸浮膠囊 */
.tab-floating .tabbar {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--tab-h); padding-bottom: 0;
  border: 1px solid var(--pink); border-radius: 999px; box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
}
.tab-floating { padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.tab-floating .fab { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 26px); }
.tab-floating .toast { bottom: calc(var(--tab-h) + 34px); }
/* 主色底條 */
.tab-accent .tabbar { background: linear-gradient(100deg, var(--pink), var(--purple)); border-top: 0; }
.tab-accent .tabbar > * { color: rgba(255, 255, 255, .72); }
.tab-accent .tabbar .active { color: #fff; }
.tab-accent .tabbar .active::before { content: ""; position: absolute; inset: 7px 14%; border-radius: 12px; background: rgba(255, 255, 255, .2); }
.tab-accent .tab-badge { background: #fff; color: var(--pink); }

/* ---- 白底色系：把寫死的白字與深色底改成跟著色系走 ---- */
.mode-light .smoke { opacity: .45; }
.mode-light .options button.active, .mode-light .cart-hints p, .mode-light .cats select, .mode-light .notices span,
.mode-light .promo-tags span, .mode-light .fab-top { color: var(--smoke); }
.mode-light .cart-hints p.ready, .mode-light .gift-text { color: var(--pink); }
.mode-light .card .flag { color: #fff; }
.mode-light .topbar .brand img, .mode-light .hero-logo { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.gate { color: #e8e6f2; }
.gate-box p { color: #9a98ad; }

/* ---- 主色當底色的元件：字色跟著 --on-accent（主色偏亮時是深色字） ---- */
.cart-btn .badge, .store-name, .cats button.active, .card .go, .btn.primary, .tab-badge, .marquee { color: var(--on-accent, #fff); }
.card.sold-out .go { color: var(--muted); }
.tab-accent .tabbar > * { color: color-mix(in srgb, var(--on-accent, #fff) 70%, transparent); }
.tab-accent .tabbar .active { color: var(--on-accent, #fff); }
.tab-accent .tabbar .active::before { background: color-mix(in srgb, var(--on-accent, #fff) 18%, transparent); }
.tab-accent .tab-badge { background: var(--on-accent, #fff); color: var(--pink); }
/* ---- 資訊按鈕（例如購買須知）：和分類排在一起，用虛線框與主色字區分 ---- */
.cats button.note-btn { color: var(--pink); border-style: dashed; border-color: var(--pink); background: transparent; }
.note-content { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: 15px; max-height: 58vh; overflow-y: auto; }
/* 商品視窗裡的優惠試算：照目前數量加入後能折多少 */
.deal { margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--pink); background: color-mix(in srgb, var(--pink) 12%, transparent); }
/* 橫向滑動的分類列：用滑鼠的裝置（電腦）顯示細捲軸並可拖曳，讓沒有觸控的人也知道能捲、捲得動 */
@media (hover: hover) and (pointer: fine) {
  .cats-scroll .cats, .cats-sticky .cats { scrollbar-width: thin; scrollbar-color: var(--pink) transparent; cursor: grab; padding-bottom: 10px; user-select: none; }
  .cats-scroll .cats::-webkit-scrollbar, .cats-sticky .cats::-webkit-scrollbar { display: block; height: 6px; }
  .cats-scroll .cats::-webkit-scrollbar-thumb, .cats-sticky .cats::-webkit-scrollbar-thumb { background: var(--pink); border-radius: 3px; }
  .cats-scroll .cats:active, .cats-sticky .cats:active { cursor: grabbing; }
}
/* 猜你喜歡：商品視窗與購物車底部的橫向推薦列 */
.recs { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); }
.recs h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; color: var(--pink); }
.rec-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.rec { flex: 0 0 112px; scroll-snap-align: start; display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, transform .15s; }
.rec:hover { border-color: var(--pink); transform: translateY(-2px); }
.rec img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: top; background: var(--panel); display: block; }
.rec .rn { padding: 6px 7px 0; font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.rec .rp { padding: 2px 7px 7px; font-size: 13px; font-weight: 700; color: var(--pink); }
.rec .rt { margin: 0 7px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 免運進度條（購物車）與送出訂單前的免運提醒 */
.free-ship { margin: 14px 0 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--pink); background: color-mix(in srgb, var(--pink) 10%, transparent); }
.free-ship p { margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.free-ship small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.ship-track { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--smoke) 14%, transparent); overflow: hidden; }
.ship-track div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--purple)); transition: width .4s; }
.free-ship.done { border-color: #2ecc71; background: color-mix(in srgb, #2ecc71 12%, transparent); }
.free-ship.done .ship-track div { background: #2ecc71; }
.ship-nudge { margin: 8px 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--pink); background: color-mix(in srgb, var(--pink) 10%, transparent); }
.ship-nudge button { margin-left: 6px; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--pink); background: none; color: var(--pink); font-size: 12px; font-weight: 700; }

/* 結帳：配送方式、付款方式、超商門市 */
.pick-group { margin: 14px 0 4px; padding: 0; border: 0; }
.pick-group legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.pick { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.pick.active { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 10%, var(--panel-2)); }
.pick.disabled { opacity: .45; cursor: not-allowed; }
.pick input { accent-color: var(--pink); width: 18px; height: 18px; flex: none; margin: 0; }
.pick-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pick-text strong { font-size: 14px; }
.pick-text small { font-size: 12px; color: var(--muted); }
.pick em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--pink); white-space: nowrap; }
.cvs-box { margin: 0 0 10px; padding: 12px; border: 1px dashed var(--pink); border-radius: 10px; }
.cvs-box .btn { display: block; text-align: center; text-decoration: none; }
.cvs-box .hint { margin: 8px 0 0; }
#cvsPicked { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; padding: 10px; border-radius: 8px; background: color-mix(in srgb, #2ecc71 12%, transparent); border: 1px solid #2ecc71; }
#cvsPicked[hidden] { display: none; }
#cvsPicked strong::before { content: "✔ "; color: #2ecc71; }
#cvsPicked span { font-size: 13px; }
#cvsPicked small { font-size: 12px; color: var(--muted); }
.transfer-box { margin: 12px 0; padding: 12px; text-align: left; border: 1px solid var(--pink); border-radius: 10px; background: color-mix(in srgb, var(--pink) 8%, transparent); }
.transfer-box h4 { margin: 0 0 6px; color: var(--pink); }
.transfer-box p { margin: 0 0 6px; white-space: pre-line; font-weight: 700; }
.transfer-box small { color: var(--muted); }

/* ==== 選擇取貨門市（自建門市清單；縣市、區域、搜尋、結果清單） ==== */
.cvs-box button.btn { width: 100%; }
.store-picker .picker-filters { display: flex; gap: 8px; margin: 10px 0 8px; }
.store-picker select, .store-picker input[type="search"] {
  width: 100%; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--smoke); font-size: 15px; outline: none;
}
.store-picker select:focus, .store-picker input[type="search"]:focus { border-color: var(--pink); }
.store-picker select:disabled { opacity: .5; }
.store-picker .picker-hint { margin: 8px 0; font-size: 12px; color: var(--muted); }
.store-results { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; margin-bottom: 12px; overscroll-behavior: contain; }
.store-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: inherit; }
.store-item:hover, .store-item:focus-visible { border-color: var(--pink); outline: none; }
.store-item strong { font-size: 14px; }
.store-item span { font-size: 13px; }
.store-item small { font-size: 12px; color: var(--muted); }
.mode-light .store-picker select, .mode-light .store-picker input[type="search"] { color: inherit; }
/* ==== 選擇取貨門市 結束 ==== */

/* ---- 電腦瀏覽時以手機版面顯示（主頁設置「電腦瀏覽」，body.phone-frame） ----
   螢幕寬於 600px 時，把整個賣場限制在畫面中間 430px，排版沿用手機的規則：
   商品兩欄、分類三欄方塊、彈出視窗從下方滑出；固定在畫面上的底部導覽、右下按鈕也對齊這個寬度。 */
@media (min-width: 600px) {
  html:has(body.phone-frame) { background: radial-gradient(ellipse at top, #1a1a24 0%, #050508 70%) fixed; }
  body.phone-frame { --frame: 430px; max-width: var(--frame); margin: 0 auto; min-height: 100vh; position: relative;
    box-shadow: 0 0 0 1px var(--line), 0 0 80px rgba(0, 0, 0, .8); }
  .phone-frame .wrap { max-width: none; }
  .phone-frame .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone-frame.cats-grid .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .phone-frame.cats-sidebar .shop-body { grid-template-columns: 82px minmax(0, 1fr); }
  .phone-frame.cats-sidebar .cats button { font-size: 12px; }
  .phone-frame .tabbar { left: 50%; right: auto; width: var(--frame); transform: translateX(-50%); }
  .phone-frame .fab { right: calc(50vw - var(--frame) / 2 + 12px); }
  .phone-frame .toast { max-width: calc(var(--frame) - 32px); }
  .phone-frame .sheet { align-items: flex-end; }
  .phone-frame .sheet-body { max-width: var(--frame); border-radius: 20px 20px 0 0; border: 0; border-top: 3px solid var(--pink); }
  .phone-frame .smoke { left: 50%; right: auto; width: var(--frame); transform: translateX(-50%); }
}

/* 購物車底部固定的「立即結帳」，以及訂單確認頁 */
.cart-bar { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); z-index: 5; margin: 16px -16px calc(-20px - env(safe-area-inset-bottom));
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, .35); }
.cart-bar .btn { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0; }
.cart-bar .btn strong { font-size: 18px; }
.back-link { position: absolute; top: 14px; left: 14px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; padding: 4px 2px; }
.back-link:hover { color: var(--pink); }
#checkoutSheet h2 { margin-top: 26px; }
.co-summary { margin-bottom: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.co-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.co-line:last-child { border-bottom: 0; }
.co-name { display: flex; flex-direction: column; min-width: 0; }
.co-name small { color: var(--muted); font-size: 12px; }
.co-price { white-space: nowrap; font-weight: 700; }
.co-summary .sums { margin-top: 8px; }
.co-summary .total { margin: 6px 0 0; }

/* 訂單完成：優惠明細小字，佔滿一整列 */
.sums dd.promo-note { grid-column: 1 / -1; margin: -2px 0 4px; text-align: left; font-size: 12px; font-weight: 400; color: var(--muted); }

/* 訂單查詢頁的購買須知等資訊（可收合） */
.query-note { margin-top: 14px; padding: 0; }
.query-note summary { cursor: pointer; padding: 14px 16px; font-weight: 800; color: var(--pink); list-style: none; }
.query-note summary::-webkit-details-marker { display: none; }
.query-note summary::after { content: "＋"; float: right; color: var(--muted); }
.query-note[open] summary::after { content: "－"; }
.query-note-body { padding: 0 16px 16px; font-size: 14px; line-height: 1.8; }

/* 訂單查詢：7-11 取貨進度（統一數網貨態） */
.logi { margin: 4px 0 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--pink) 45%, transparent);
  background: color-mix(in srgb, var(--pink) 8%, transparent); }
.logi.problem { border-color: #ff9f43; background: rgba(255, 159, 67, .1); }
.logi h3 { margin: 0 0 8px; font-size: 14px; color: var(--pink); }
.logi-steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 10px; font-size: 12px; text-align: center; }
.logi-steps li { flex: 1; padding: 6px 2px; border-radius: 6px; background: rgba(128, 128, 128, .18); opacity: .7; }
.logi-steps li.done { background: var(--pink); color: var(--on-accent); font-weight: 700; opacity: 1; }
.logi-now { margin: 0 0 10px; font-size: 15px; font-weight: 700; line-height: 1.5; }
.logi.problem .logi-now { color: #ff9f43; }
.logi dl { margin-bottom: 6px; }
.logi dd a { margin-left: 6px; font-size: 12px; color: var(--pink); white-space: nowrap; }
.logi-history summary { cursor: pointer; font-size: 13px; opacity: .85; }
.logi-history ul { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid color-mix(in srgb, var(--pink) 40%, transparent); font-size: 13px; }
.logi-history li { margin: 0 0 8px; line-height: 1.5; }
.logi-history time { display: block; font-size: 11px; opacity: .65; }

/* 彈跳公告（每個賣場自己設定圖片或文字） */
.popup { position: fixed; inset: 0; z-index: 85; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 5, 8, .82); }
.popup[hidden] { display: none; }
.popup-box { position: relative; width: 100%; max-width: 440px; max-height: 92vh; display: flex; flex-direction: column; gap: 12px; }
.popup-box img { display: block; width: 100%; max-height: calc(92vh - 70px); object-fit: contain; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.popup-box h2 { margin: 0 0 8px; font-size: 19px; color: var(--pink); }
#popupBody:has(.popup-text) { padding: 20px 18px; border-radius: 14px; background: var(--panel, #17151f); border: 1px solid color-mix(in srgb, var(--pink) 45%, transparent); overflow-y: auto; }
.popup-text { white-space: pre-line; line-height: 1.8; font-size: 15px; }
.popup-x { position: absolute; top: -12px; right: -8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: #111; font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); z-index: 1; }
.popup-ok { width: 100%; }

/* 輪播圖下方固定的資訊圖（加盟資訊等） */
.info-banner { margin: 0 0 10px; }
.info-banner img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
/* 彈跳公告的綠色「加入 LINE@」按鈕（LINE 品牌綠） */
.popup-line { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 16px; border-radius: 999px;
  background: #06c755; color: #fff; font-size: 16px; font-weight: 800; text-decoration: none; box-shadow: 0 4px 16px rgba(6, 199, 85, .35); }
.popup-line[hidden] { display: none; }
.popup-line:hover, .popup-line:active { background: #05b14c; color: #fff; }
.popup-line svg { width: 24px; height: 24px; flex: none; }

/* 商品視窗的圖片輪播（最多 5 張） */
.gallery { position: relative; margin: 0 0 14px; border-radius: 14px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.g-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.g-track::-webkit-scrollbar { display: none; }
.g-slide { flex: 0 0 100%; aspect-ratio: 1 / 1; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; cursor: zoom-in; background: var(--panel-2); }
.g-slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.g-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding-bottom: 3px; }
.g-nav.prev { left: 8px; } .g-nav.next { right: 8px; }
.g-nav[hidden] { display: none; }
.g-nav:disabled { opacity: .25; cursor: default; }
.g-count { position: absolute; top: 8px; right: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; }
.g-zoom { position: absolute; left: 8px; bottom: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; pointer-events: none; }
.g-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.g-dots[hidden] { display: none; }
.g-dots button { pointer-events: auto; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .3); box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); cursor: pointer; }
.g-dots button.active { width: 20px; border-radius: 4px; background: var(--pink); }
@media (min-width: 640px) { .g-slide { aspect-ratio: 4 / 3; } }

/* 全螢幕放大檢視 */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .95); }
.lightbox[hidden] { display: none; }
.lb-track { height: 100%; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: pan-x pinch-zoom; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-slide.zoomed { overflow: auto; display: block; touch-action: pan-x pan-y pinch-zoom; }
.lb-slide.zoomed img { max-width: none; max-height: none; }
.lb-x { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92);
  color: #111; font-size: 28px; line-height: 1; cursor: pointer; z-index: 2; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18);
  color: #fff; font-size: 32px; line-height: 1; cursor: pointer; padding-bottom: 4px; z-index: 2; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
.lb-nav[hidden] { display: none; }
.lb-nav:disabled { opacity: .2; cursor: default; }
.lb-foot { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); text-align: center; color: rgba(255, 255, 255, .85); font-size: 13px; pointer-events: none; }

/* 購物車裡自動加入的贈品 */
.cart-gifts { margin: 4px 0 8px; padding: 8px 10px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--pink) 60%, transparent);
  background: color-mix(in srgb, var(--pink) 8%, transparent); }
.cart-gifts[hidden] { display: none; }
.cart-line.gift { border: 0; padding: 6px 0; }
.cart-line.gift .gift-icon { width: 44px; flex: none; text-align: center; font-size: 26px; }
.cart-line.gift strong { color: var(--pink); }
.cart-line.gift .price s { opacity: .6; }
.co-line.gift .co-name { color: var(--pink); }
