/* 前台樣式修正（前台只有編譯檔，CSS module 類別名稱帶雜湊，所以用「名稱開頭」選取）。
 * index.html 以 <link href="/local-assets/storefront-style.css?v=日期"> 載入；AWS 與 Linux 同一份。 */

/* 通知中心：通知卡片（灰底＝未讀、白底＝已讀）改成圓角 */
[class*="NotificationPage_notificationItem__"] {
  border-radius: 12px;
}

/* 置頂（2026-11-30）：網站與 App 共用。
 * 頁首（Logo、搜尋、我的最愛、購物車）：首頁、產品、搜尋、通知、訂單記錄、會員中心等所有頁面上下滑動都固定在最上方。
 * 頁首高度 64px（antd Layout.Header），各頁的工具列接在頁首下方。
 * iPhone 鍵盤開著時上下滑動：local-assets/sticky-header.js 先收起鍵盤（頁首才不會跑掉）。
 * App 狀態列區域（頁首上方）露出內容：網頁畫不到那一塊（iOS App 的 WebView 延伸到狀態列底下），要改 iOS App
 * （2026-11-30 在模擬器實測：頁首加高往上移、fixed 白條都畫不到那一排，只能改 App）。 */
:root {
  --yite-header-height: 64px;
}
#root .ant-layout > header.ant-layout-header {
  position: sticky;
  top: 0;
  z-index: 900;
}


/* App 首頁商品橫向滑動列（552 分塊 APP_HOME_STRIP 的 [data-yite-strip]）與兌換中心橫向列（[data-yite-exchange-strip]）：
 * 原本 scroll-snap-type:x mandatory，iPhone 上不管滑多大力都只停在附近一兩張（實測全寬快滑只移 3 張）。
 * 取消吸附，用系統的慣性捲動：滑動越大、越快，商品移動越遠越快（2026-11-30）。 */
[data-yite-strip],
[data-yite-exchange-strip] {
  scroll-snap-type: none !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* 通知中心：「全部已讀」「編輯」那一列（頁面區塊的第一列）接在頁首下方置頂。
 * 只有含通知清單的頁面才套用。底色用 box-shadow 往外多塗 10px（不佔版面，未捲動時位置不變；
 * App 的 notification_mobile_patch.js 會把這一列的 margin 設為 0，所以不用 margin／padding）。 */
#root section:has([class*="NotificationPage_notificationList__"]) > .ant-row:first-child {
  position: sticky;
  top: calc(var(--yite-header-height) + 10px);
  z-index: 899;
  background: #fff;
  box-shadow: 0 0 0 10px #fff;
}

/* 訂單記錄：「訂單記錄」標題、選擇月份、搜尋那一列接在頁首下方置頂（底色與頁面相同 #f6f6f6）。 */
#root section:has(.order-history-card) > .ant-flex:first-child {
  position: sticky;
  top: calc(var(--yite-header-height) + 10px);
  z-index: 899;
  background: #f6f6f6;
  box-shadow: 0 0 0 10px #f6f6f6;
}
/* 查詢列下方的分隔線（顏色加深 #bfbfbf），跟著查詢列置頂；寬度與訂單方框相同（不滿版，使用者 12:03 指定）；
 * 線下面再留 9px 頁面底色，捲上來的訂單方框在線下方一點才被切掉，看得出是分隔線、不像方框的上緣。 */
#root section:has(.order-history-card) > .ant-flex:first-child::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  height: 10px;
  box-sizing: border-box;
  border-top: 1px solid #bfbfbf;
  background: #f6f6f6;
  pointer-events: none;
}
/* 原本查詢列下方的分隔線（antd Divider）會跟著訂單捲走：改由上面的橫線取代，這條只保留間距 */
#root section:has(.order-history-card) > .ant-flex:first-child + .ant-divider {
  visibility: hidden;
}

/* 購物車（與確認訂單｜結帳頁）：「購物車　購買商品：N 種」標題列（552 CART_KIND_COUNT 的 [data-cart-kind-count]）
 * 接在頁首下方置頂，下方分隔線與訂單記錄相同（#bfbfbf、寬度＝內容、線下留 9px 底色），原本的分隔線只保留間距（2026-11-30）。 */
#root section > [data-cart-kind-count]:first-child {
  position: sticky;
  top: calc(var(--yite-header-height) + 10px);
  z-index: 899;
  background: #fff;
  box-shadow: 0 0 0 10px #fff;
}
#root section > [data-cart-kind-count]:first-child::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  height: 10px;
  box-sizing: border-box;
  border-top: 1px solid #bfbfbf;
  background: #fff;
  pointer-events: none;
}
#root section > [data-cart-kind-count]:first-child + .ant-divider {
  visibility: hidden;
}

/* 客戶中心 → 我的點數：點數紀錄（/point/transaction）、兌換紀錄（/point/redeem）的標題列（標題、期間選單、返回；
 * 552 的 .yite-record-head）接在頁首下方置頂，下方深色分隔線（#bfbfbf、寬度＝內容）並留空白（2026-11-30）。
 * 標題列上方留白縮小：頁面區塊 padding-top 30px＋列的 margin-top 12px（共 42px）→ 8px＋2px（10px），
 * 未捲動時的位置就是置頂位置（頁首 + 10px），捲動時不會跳動。 */
#root section:has(> .ant-row > .ant-col > .yite-record-head) {
  padding-top: 8px !important;
}
#root .ant-col > .yite-record-head {
  position: sticky;
  top: calc(var(--yite-header-height) + 10px);
  z-index: 899;
  margin-top: 2px !important;
  margin-bottom: 24px !important;
  background: #fff;
  box-shadow: 0 0 0 10px #fff;
}
#root .ant-col > .yite-record-head::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  height: 10px;
  box-sizing: border-box;
  border-top: 1px solid #bfbfbf;
  background: #fff;
  pointer-events: none;
}

/* 購物車「全選」列：固定在標題列分隔線正下方（標題列 top 74 + 高 28 + 分隔線區 20 ＝ 頁首 + 58px）（2026-11-30）。
 * App 卡片版（shopping_mobile_patch 的 [data-yite-cart-table]）：thead 為 block，與第一個商品框留 12px，
 * 間隔用 thead 自己的白底 padding（白色陰影蓋不住商品框），商品框捲到下面時被蓋住。 */
html[data-yite-shopping] [data-yite-cart-table][data-yite-selectable] .ant-table-thead {
  position: sticky;
  top: calc(var(--yite-header-height) + 58px);
  z-index: 898;
  padding-bottom: 12px;
  background: #fff;
}
/* 全選灰色框上下留白縮小：th 上下 12px → 4px，勾選框點擊區 44px → 32px（框高 69 → 40px）。 */
html[data-yite-shopping] [data-yite-cart-table][data-yite-selectable] .ant-table-thead th.ant-table-selection-column {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}
html[data-yite-shopping] [data-yite-cart-table][data-yite-selectable] .ant-table-thead th.ant-table-selection-column .ant-checkbox-wrapper {
  min-height: 32px !important;
  height: 32px !important;
}
/* 未捲動時全選列與標題列的距離＝置頂後的距離（分隔線區 20px）：原本隱藏的 antd 分隔線上下各 24px＋1px 共 49px，
 * 捲動時標題列先停、全選列還要再往上 29px 才停，看起來間隔忽大忽小。改成只留 20px，兩列一起移動、一起停。 */
#root section:has(.ant-table-selection-column) > [data-cart-kind-count]:first-child + .ant-divider {
  height: 0;
  margin: 0 0 20px;
  border: 0;
}
/* 網頁版：表格在 .ant-table-content（overflow:auto）裡，表頭無法對畫面置頂；
 * 寬度足以放下整張表（最小 1200px）時取消內層捲動，表頭儲存格改置頂。窄螢幕仍維持左右捲動。 */
@media (min-width: 1260px) {
  html:not([data-yite-shopping]) #root section:has(> [data-cart-kind-count]:first-child) .ant-table:has(.ant-table-selection-column) .ant-table-content {
    overflow: visible !important;
  }
  html:not([data-yite-shopping]) #root section:has(> [data-cart-kind-count]:first-child) .ant-table:has(.ant-table-selection-column) .ant-table-thead > tr > th {
    position: sticky;
    top: calc(var(--yite-header-height) + 58px);
    z-index: 898;
  }
}

/* App 產品頁「產品規格」：App 的 app_layout_patch.js（iOS／Android 共用）把產品分頁內所有欄位設成滿版
 * （[data-yite-product-intro] .ant-col { flex:0 0 100% }，原意是讓「產品介紹」圖片滿版），
 * 規格的「項目（ant-col-6）＋內容（ant-col-18）」因此上下拆成兩列。只針對這種兩欄規格列改回同一列：
 * 項目 35%、內容 65%（App 內滿版寬度較窄，原本 25%／75% 的項目欄太擠）。網站不受影響（沒有 data-yite-product）（2026-11-30）。 */
html[data-yite-product] [data-yite-product-intro] .ant-row:has(> .ant-col-6 + .ant-col-18) {
  flex-wrap: nowrap !important;
}
html[data-yite-product] [data-yite-product-intro] .ant-row:has(> .ant-col-6 + .ant-col-18) > .ant-col-6 {
  flex: 0 0 35% !important;
  max-width: 35% !important;
}
html[data-yite-product] [data-yite-product-intro] .ant-row:has(> .ant-col-6 + .ant-col-18) > .ant-col-18 {
  flex: 0 0 65% !important;
  max-width: 65% !important;
  min-width: 0;
}
