:root {
  color-scheme: light;
  --bg: #fff; --soft: #f4f4f2; --ink: #141414; --mute: #6b6b6b; --line: #e3e3e0;
  --red: #c42d1a; --orange: #a85800; --lineg: #06c755; --warn-bg: #fff3c4; --warn-line: #ecd9a3;
  --tap: 44px;
  /* 雙十一外觀跟 DM 正式版（~/pns-dm-layouts 的 J 版，shared/pchome.css）同一套：紅粉漸層底、黃色券、白色圓角區塊、緞帶標題。
     小字（13px 以下）在黃、紅底上用深紅或白；亮紅只用在大字與按鈕。DM 改色時這裡跟著改。 */
  --brand: #e60023; --brand-2: #ff3d7f; --brand-dark: #b8001b; --gold: #ffe14a; --ink: #1a1a1a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  /* 頁面很長（七百多張卡）：漸層只在第一屏，往下是深紅 */
  margin: 0; background: linear-gradient(180deg, #ec1846 0, var(--brand) 320px, var(--brand-dark) 1200px) var(--brand-dark) no-repeat; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 頁首是活動主視覺：直接放在紅底上、置中白字，最上面一個黃色斜體大「11.11」（跟 DM 頁首同樣子） */
.top { position: relative; color: #fff; text-align: center; padding: 22px 16px 14px; max-width: 1100px; margin: 0 auto; }
.top .hero-num {
  font: italic 900 80px/.95 "Helvetica Neue", Arial, sans-serif; color: var(--gold); margin: 6px 0 4px;
  text-shadow: 4px 4px 0 var(--brand-dark), 0 0 24px rgba(255, 225, 74, .5);
}
/* 語言鈕（Evan 10/8）：頁首右上，跟 chip 同風格 */
.top .lang {
  position: absolute; top: 12px; right: 16px; z-index: 1; min-height: 32px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .7); border-radius: 999px; background: transparent; color: #fff; font: inherit; font-size: 13px; cursor: pointer;
}
.top .store { font-size: 12px; letter-spacing: .16em; color: rgba(255, 255, 255, .9); font-weight: 700; }
.top h1 { font-size: 24px; line-height: 1.25; margin: 2px 0 2px; font-weight: 800; letter-spacing: .04em; }
.top p { margin: 4px 0; }
.top :focus-visible { outline-color: #fff; }
.period { font-size: 20px; font-weight: 700; }
/* 今天適用的優惠：半透明深色圓角框裡的黃字（DM 頁首「首三日限定」那塊） */
.today { display: inline-block; font-size: 14.5px; font-weight: 800; color: var(--gold); background: rgba(0, 0, 0, .18); line-height: 1.5; padding: 6px 16px; border-radius: 14px; }
.asof { font-size: 12.5px; color: rgba(255, 255, 255, .9); }
/* 活動規則與滿額禮直接列出（Evan 10/4：收在「活動規則」裡客人不會點開）。行距收緊、不再加段距 */
/* 白色圓角區塊＋下緣一條陰影（DM 的 .block）：篩選、每一區商品、怎麼訂購、活動規則都用這個 */
.filters, .sec, .info, .rules, #secs > p.none {
  background: #fff; border-radius: 18px; box-shadow: 0 6px 0 rgba(0, 0, 0, .12);
  margin-left: 8px; margin-right: 8px;
}
@media (min-width: 1124px) { .filters, .sec, .info, .rules, #secs > p.none { margin-left: auto; margin-right: auto; } }
/* 區塊標題是粉紅→紅的緞帶，壓在區塊上緣、置中，兩邊黃色星星 */
.sec h2, .info h2, .rules h2 {
  display: flex; justify-content: center; align-items: center; gap: 6px; width: fit-content; max-width: 100%; margin: -40px auto 10px;
  padding: 6px 20px; border-radius: 999px; color: #fff; font-size: 17px; font-weight: 800; text-align: center;
  background: linear-gradient(90deg, var(--brand-2), var(--brand)); box-shadow: 0 4px 0 var(--brand-dark);
}
.sec h2::before, .sec h2::after, .info h2::before, .info h2::after, .rules h2::before, .rules h2::after { content: "✦"; color: var(--gold); font-size: 13px; }
.rules { font-size: 13.5px; max-width: 1100px; margin-top: 40px; margin-bottom: 8px; padding: 22px 16px 16px; scroll-margin-top: 72px; }
.rules-link { font-size: 14px; font-weight: 700; }
.rules-link a { color: inherit; text-decoration: underline; }
.rules ul, .rules ol { margin: 0; padding-left: 18px; line-height: 1.5; }
.rules li + li { margin-top: 2px; }
/* 三段時間軸在最上面、跟規則分開一點；「型錄未列出的優惠」是小標 */
.rules .timeline { font-weight: 600; margin-bottom: 6px; }
.rules .sub { font-weight: 700; margin: 6px 0 2px; }

.banner { max-width: 1100px; margin: 0 8px 10px; padding: 10px 16px; font-size: 14px; line-height: 1.5; border-radius: 12px; text-align: center; }
@media (min-width: 1124px) { .banner { margin-left: auto; margin-right: auto; } }
.banner.warn { background: var(--warn-bg); }
/* 「11/6 開始」：黃色券（DM 的折價券色），字用深紅 */
.banner.phase { background: linear-gradient(90deg, #fff3b0, var(--gold)); color: var(--brand-dark); font-weight: 800; }

.filters { max-width: 1100px; padding: 10px 0 8px; margin-top: 4px; margin-bottom: 14px; }
/* 分頁列：深紅底白字，選中的那一格黃字黃底線（DM 頂部分頁同樣子），捲動時一直在上面 */
.stick { position: sticky; top: 0; z-index: 3; background: var(--brand-dark); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.row { display: flex; gap: 6px; overflow-x: auto; padding: 3px 12px; scrollbar-width: none; align-items: center; max-width: 1100px; margin: 0 auto; }
.row::-webkit-scrollbar { display: none; }
.row .lbl { font-size: 12px; color: var(--mute); flex: none; width: 30px; }
/* 英文標籤比「尺寸」「原價」長，30px 放不下；中文維持原寬度 */
:lang(en) .row .lbl { width: auto; }
.chip {
  flex: none; min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
  padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.tabs { padding-top: 0; padding-bottom: 0; gap: 2px; }
.tabs .chip { border: 0; padding: 0 10px; border-radius: 0; font-weight: 700; color: rgba(255, 255, 255, .85); background: none; }
.tabs .chip[aria-pressed="true"] { background: none; color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }
.stick :focus-visible { outline-color: #fff; }
.custom { display: flex; gap: 6px; align-items: center; padding: 3px 12px 6px 48px; font-size: 14px; max-width: 1100px; margin: 0 auto; }
.custom input { width: 96px; min-height: var(--tap); font-size: 16px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; }
.apply { min-height: var(--tap); padding: 0 14px; border: 0; border-radius: 6px; background: var(--ink); color: #fff; cursor: pointer; }

.result { max-width: 1100px; margin: 0 auto; padding: 0 12px 0 14px; background: #fff4d6; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.link { background: none; border: 0; padding: 0 4px; min-height: var(--tap); text-decoration: underline; cursor: pointer; white-space: nowrap; }

main { max-width: 1100px; margin: 0 auto; }
/* 每一區一個白色圓角區塊，緞帶標題壓在上緣（規則在上面共用那段）。
   緞帶高出區塊 40px：第一區的這段空間用 main 的 padding 撐（不用 margin），篩選後 showResults 捲到 #secs 頂端時緞帶才不會被黏頂分頁蓋住。
   左右內距收到 6px、卡片內距 5px：375px 寬時卡片內容寬跟改版前差不多，「AW26｜任兩件 8 折」才放得下一行 */
main { padding-top: 40px; }
.sec { padding: 22px 6px 10px; margin-bottom: 14px; }
.sec + .sec { margin-top: 54px; }
/* 這一區的優惠：黃色券條、深紅字（DM 折價券的配色） */
.sec .d { font-size: 13px; font-weight: 700; color: var(--brand-dark); background: linear-gradient(90deg, #fff3b0, var(--gold)); margin: 0 0 10px; padding: 7px 12px; border-radius: 10px; text-align: center; }
.key { font-size: 12px; color: var(--mute); margin: 0 0 12px; }
.key b { color: var(--ink); }
/* 同一排的卡片拉成一樣高（Evan 11/3：每張的「加入訂單」要在同一條水平線）。
   卡片是 <button>，按鈕預設把內容垂直置中：拉高後短的那張圖會往下掉（10/4 實測 19px）。
   所以 .card 一定要是由上往下排的 flex 欄，內容貼上緣、「加入訂單」推到最底（tests/storefront-html.test.js 釘住兩邊）。 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; align-items: stretch; }
/* 平板以上固定 4 欄（Evan 10/4：不管螢幕多寬都 4 欄）。手機維持 2 欄：375px 排 4 欄每張只剩約 80px，看不清楚。 */
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* 只限 <p>：none 同時是尺寸狀態的 class（卡片的售完尺寸），不限定會把每個售完尺寸撐成 105px 高 */
p.none { padding: 40px 20px; text-align: center; color: var(--mute); font-size: 14px; line-height: 1.8; }
p.none .link { color: var(--ink); }

/* 卡片：白底、淡紅細框、圓角（DM 商品格 .it）；整張都可以點，底部的「加入訂單」只是讓人一眼知道能點 */
.card { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; min-width: 0; text-align: left; background: #fff; border: 1px solid #ffd0d0; padding: 5px 5px 8px; border-radius: 12px; cursor: pointer; }
/* 「加入訂單」前面的彈性空白：內容短的卡由它撐開，「加入訂單」就貼在卡片底部；最少留 8px */
.card::after { content: ""; flex: 1 0 8px; order: 1; }
.card:hover { border-color: var(--brand); }
.card .ph { display: block; background: #fff; border: 1px solid var(--line); border-radius: 6px; aspect-ratio: 1 / 1; position: relative; overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tag { position: absolute; top: 7px; right: 7px; font-size: 11px; background: #fff; border: 1px solid var(--ink); padding: 1px 5px; border-radius: 3px; }
.card .nm { display: block; font-size: 14px; margin: 8px 0 1px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.card .cta {
  display: flex; align-items: center; justify-content: center; min-height: 36px; order: 2; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700;
}
/* 卡片是 flex 欄，折扣標不設的話會被拉成整條寬 */
.card .deal { align-self: flex-start; }
.card:hover .cta { background: var(--brand-dark); }
.card .cl { display: block; font-size: 12.5px; color: var(--mute); overflow-wrap: anywhere; }
/* 季別：同名同色、價格不同的卡（例：SS26／AW25 Mechanism Bibs White）客人靠這個分 */
.card .ss { font-size: 10.5px; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; white-space: nowrap; }
/* 價格放大加粗。這是原價（實付要看怎麼搭），所以用黑字；DM 的紅色價格是專區價，型錄卡上沒有那個數字。優惠條件是黃色券標、深紅字 */
.orig { display: block; font-size: 19px; font-weight: 800; margin-top: 4px; letter-spacing: .01em; }
.deal {
  display: inline-block; max-width: 100%; font-size: 12.5px; font-weight: 700; color: var(--brand-dark); background: linear-gradient(90deg, #fff3b0, var(--gold));
  margin-top: 3px; padding: 2px 7px; border-radius: 4px; line-height: 1.4; overflow-wrap: anywhere;
}
/* 優惠圖示（src/icons.js）：線條跟著文字色 */
.ic { width: 1.3em; height: 1.3em; vertical-align: -.3em; margin-right: 4px; flex: none; }
/* 面板裡價格在品名下方，字再大一點 */
.prices .orig { font-size: 22px; }
.dnote { display: block; font-size: 11.5px; color: var(--mute); }
.sz { display: flex; gap: 2px 8px; margin-top: 5px; font-size: 12.5px; flex-wrap: wrap; }
.sz .store, .sz .low { font-weight: 700; }
.sz .transfer { color: var(--mute); }
.sz .transfer::after { content: "*"; }
.sz .none { color: #b5b5b1; text-decoration: line-through; }
.sz .hl { background: var(--warn-bg); border-radius: 3px; padding: 0 2px; }
.sz.unknown { color: var(--mute); }
.lowline { display: block; font-size: 12px; color: var(--orange); margin-top: 3px; font-weight: 600; }
/* 英文版（Evan 10/8「壓迫感太重」）：英文句子比中文長、行數多，次要文字只在英文調小一級、紅字減粗；中文不動 */
:lang(en) .deal { font-size: 12px; font-weight: 600; }
:lang(en) .lowline { font-size: 11.5px; font-weight: 500; }
:lang(en) .card .cl, :lang(en) .sz { font-size: 12px; }
:lang(en) .rules { font-size: 12.5px; }
:lang(en) .today { font-size: 13.5px; }
:lang(en) .key { font-size: 11.5px; }
:lang(en) .hint { font-size: 12px; font-weight: 500; }
:lang(en) .sum ul { font-size: 13px; line-height: 1.5; }
/* 面板右上的關閉鈕會蓋住右上角的女款／男女通用標籤（10/8 實測重疊 28px），中英都移到左上（Evan 10/8） */
.sheet .big .tag { right: auto; left: 7px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.info { max-width: 1100px; margin-top: 40px; margin-bottom: 8px; padding: 22px 16px 14px; font-size: 13.5px; line-height: 1.75; }
.info ol { margin: 0; padding-left: 20px; }
.mute { color: var(--mute); font-size: 12.5px; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: linear-gradient(90deg, var(--brand-dark), var(--brand)); color: #fff;
  padding: 6px 12px calc(10px + env(safe-area-inset-bottom));
}
/* 底部列是紅底（DM 底部那條）：提示、說明、件數改白字，件數徽章黃底深紅字 */
.bar .hint { color: #fff; }
.bar .note { color: rgba(255, 255, 255, .9); }
.bar .count b { background: var(--gold); color: var(--brand-dark); }
.bar :focus-visible { outline-color: #fff; }
.bar .hint, .bar .note, .bar .actions { max-width: 1100px; margin-left: auto; margin-right: auto; }
.hint { font-size: 12.5px; color: var(--red); font-weight: 600; margin: 0 0 6px; min-height: 1em; }
.note { font-size: 12.5px; color: var(--mute); margin: 6px 0 0; }
.actions { display: flex; gap: 8px; align-items: center; }
.count { flex: 1 0 auto; min-width: 0; min-height: var(--tap); text-align: left; background: none; border: 0; padding: 0; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
/* 件數是紅色圓形徽章（購物車那種） */
.count b {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; margin: 0 2px;
  border-radius: 999px; background: var(--brand); color: #fff; font-size: 14px;
}
.btn {
  min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px;
  font-size: 15px; font-weight: 700; padding: 0 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
/* 「LINE 詢問設定中，請先複製訊息」比「用 LINE 送出訂單」長很多：375px 寬時讓它換行，不要把「訂單 N 件」擠成 0 寬 */
.btn.line { background: var(--lineg); color: #fff; white-space: normal; text-align: center; line-height: 1.2; }
.btn.ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.dark { background: var(--brand); color: #fff; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn:disabled, .btn[aria-disabled="true"] { background: #d6d6d2; border-color: #d6d6d2; color: #fff; cursor: not-allowed; pointer-events: none; }
/* 停用的 LINE 按鈕上的字（「設定中，請先複製訊息」）是要讀的說明：灰底白字對比太低，改深灰字（約 5:1） */
.btn.line[aria-disabled="true"] { background: var(--soft); color: var(--mute); }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 8; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: #fff; border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  max-width: 640px; margin: 0 auto;
}
.close { position: absolute; top: 8px; right: 8px; width: var(--tap); height: var(--tap); border: 0; background: #fff; border-radius: 50%; font-size: 18px; cursor: pointer; z-index: 1; }
.sheet .big { background: #fff; border: 1px solid var(--line); border-radius: 8px; height: 240px; display: flex; align-items: center; justify-content: center; position: relative; }
.sheet .big img { max-height: 92%; max-width: 92%; object-fit: contain; }
.sheet h2 { font-size: 18px; margin: 12px 0 0; padding-right: 48px; overflow-wrap: anywhere; }
.sheet .color { font-size: 14px; color: var(--mute); }
.sheet .code { font-size: 12px; color: var(--mute); margin-top: 2px; }
.prices { margin-top: 6px; }
.sbtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; margin: 12px 0 6px; }
.sbtns button { min-height: 52px; border: 1.5px solid var(--ink); background: #fff; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1.15; padding: 4px 2px; }
.sbtns button small { display: block; font-size: 11px; font-weight: 500; color: var(--mute); margin-top: 2px; }
.sbtns button.transfer { border-style: dashed; }
.sbtns button:disabled { border-color: #e0e0dc; color: #b5b5b1; cursor: not-allowed; }
.sbtns button:disabled .s { text-decoration: line-through; }
.sbtns button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.sbtns button[aria-pressed="true"] small { color: #ddd; }
.shint { font-size: 13px; color: var(--mute); min-height: 18px; margin: 4px 0; }

#cartSheet h2 { font-size: 18px; margin: 4px 0 8px; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; gap: 8px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; font-size: 14px; }
.items .t { min-width: 0; overflow-wrap: anywhere; }
.items .st { display: block; font-size: 12.5px; color: var(--mute); }
.items .pr { display: block; font-size: 13px; margin-top: 1px; }
.items .pr[data-role="pair"], .items .pr[data-role="zone"], .items .pr[data-role="bundle"] { color: var(--red); font-weight: 600; }
.sum { background: var(--soft); border-radius: 8px; padding: 8px 12px; margin: 8px 0 4px; }
.sum p { margin: 0 0 2px; }
.sum ul { list-style: none; margin: 0; padding: 0; font-size: 14px; font-weight: 600; line-height: 1.6; }
.confirm { font-size: 13px; font-weight: 600; margin: 8px 0; }
.rm { flex: none; min-height: var(--tap); min-width: var(--tap); padding: 0 10px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 13px; background: #e9f9ef; border-radius: 8px; padding: 12px; margin: 4px 0 10px; line-height: 1.6; }
#cartSheet .actions .btn { flex: 1; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(130px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--ink); color: #fff; font-size: 14px; padding: 10px 16px; border-radius: 8px; max-width: calc(100% - 32px);
}
