/**
 * CEREAL Typography 收斂層 v1.1 (2026-07-05)
 *
 * 目標：仿 Zara —— 全站單一字體家族 + 4 檔字重（300/400/500/700）。
 * 只管 font-family / font-weight，不動 size / layout / color。
 *
 * v1.1：英文降階變細（對標 Zara 的 300 主導），中文不動。
 * 手法 = "Cereal Latin" unicode-range 只吃英數標點；@font-face 把細一階的
 * 字形掛在原字重槽位（400 槽→Light、500 槽→Regular、700 槽→Medium），
 * 頁面所有 font-weight 宣告不必改，中文字落到 PingFang 維持原字重。
 * Apple 裝置走 local() 真 Helvetica Neue；其他平台下載 Switzer（ITF FFL
 * 免費商用，License 見 assets/fonts/FFL.txt）。
 * Icon fonts（basel-font, simple-line-icons, Font Awesome, dashicons,
 * vc_grid_v1, vcpb-plugin-icons, TablePress, WC_BIS）一律不碰：
 * 本檔所有 selector 皆為元素/文字類，不覆蓋任何 ::before/::after icon 規則。
 *
 * 載入順序：wp_enqueue_scripts priority 30002（basel-dynamic 為 inline style 印在最後，
 * 故本檔 family 規則一律 !important）；digits 登入模板另走 digits_custom_css hook。
 */

/* ============================================================
 * 0. Cereal Latin —— 英文專用降階字面（unicode-range 不含 CJK）
 *    字體 URL 用根絕對路徑：digits 登入頁會把本檔 inline 進 <style>，
 *    相對路徑會以頁面 URL 解析而 404
 * ============================================================ */
@font-face {
    font-family: "Cereal Latin";
    src: local("HelveticaNeue-Light"), local("Helvetica Neue Light"),
         url("/wp-content/plugins/jose956-26-new-theme/assets/fonts/Switzer-Light.woff2") format("woff2");
    font-weight: 300 400; /* 300 與 400 槽位都渲染 Light 字面 */
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Cereal Latin";
    src: local("HelveticaNeue"), local("Helvetica Neue"),
         url("/wp-content/plugins/jose956-26-new-theme/assets/fonts/Switzer-Regular.woff2") format("woff2");
    font-weight: 500; /* 500 槽位渲染 Regular 字面 */
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Cereal Latin";
    src: local("HelveticaNeue-Medium"), local("Helvetica Neue Medium"),
         url("/wp-content/plugins/jose956-26-new-theme/assets/fonts/Switzer-Medium.woff2") format("woff2");
    font-weight: 700; /* 700 槽位渲染 Medium 字面 */
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* 主 stack：Cereal Latin 只吃英數，中文落到 PingFang 一條龍 */
    --cereal-font-main: "Cereal Latin", "Helvetica Neue", Helvetica, Arial,
        "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

/* ============================================================
 * 1. 全站基底 —— 覆蓋 basel-dynamic 的 Noto Sans 基底
 * ============================================================ */
body, p, blockquote, figcaption, li, dt, dd,
h1, h2, h3, h4, h5, h6,
.title, .title-alt, .subtitle, .font-alt, .font-default, .basel-entry-meta,
input, select, textarea, button, optgroup,
.btn, .button, .added_to_cart,
table, th, td, caption, label, legend {
    font-family: var(--cereal-font-main) !important;
}

/* 導覽：桌機主選單 / 下拉 / topbar / breadcrumb / footer */
.main-nav .menu li a,
.basel-navigation .menu li a,
.mega-menu-list li a,
.mobile-nav .menu-item > a,
.topbar-wrapp, .topbar-menu ul li a,
.woocommerce-breadcrumb, .breadcrumbs,
.footer-container, .copyrights-wrapper {
    font-family: var(--cereal-font-main) !important;
}

/* WooCommerce 商流元素 */
.price, .amount, .woocommerce-Price-amount,
.product-title, .product_title, .cart-empty,
.single_add_to_cart_button, .add_to_cart_button, .checkout-button,
.variations label, .reset_variations, .quantity .qty,
.woocommerce-store-notice, p.demo_store,
.woocommerce-error, .woocommerce-info, .woocommerce-message,
.cart_totals, .shop_table,
form.checkout .form-row label, form.checkout .form-row input,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.select2-container .select2-selection,
.wc-tabs li a {
    font-family: var(--cereal-font-main) !important;
}

/* ============================================================
 * 2. 幽靈字體 / 特例修正
 *    原宣告 Khula / Source Sans Pro / Karla / Lucida Sans Unicode
 *    —— 全站根本沒載入這些 webfont，實際是靜默 fallback
 * ============================================================ */
a.clect,
a.SaleFontBn,
[class*="yith-wcbm-css-badge"] div.yith-wcbm-css-text,
div.wpcf7-validation-errors,
font.demofont {
    font-family: var(--cereal-font-main) !important;
}

/* Smart Slider 3：字體設定存在 slide 資料內（Roboto/Noto Sans），
 * CSS 檔改不到源頭，此處覆蓋輸出（slider 箭頭/圓點為 SVG，不受影響） */
.n2-ss-slider div, .n2-ss-slider span,
.n2-ss-slider a, .n2-ss-slider p, .n2-ss-slider h1,
.n2-ss-slider h2, .n2-ss-slider h3 {
    font-family: var(--cereal-font-main) !important;
}

/* digits 登入/OTP 彈窗（原 Roboto / Helvetica Neue） */
.digits-form, .digits-form input, .digits-form button,
.dig-box, .dig-container, .digits_login_form,
[class^="dig_"], [class*=" dig_"] {
    font-family: var(--cereal-font-main) !important;
}

/* ============================================================
 * 3. 字重收斂 —— 允許 300 / 400 / 500 / 700
 *    禁用 100 / 200 / 501 / 600 / 800 / 900 / bolder / lighter
 * ============================================================ */

/* 價格原為 weight 100（過細），統一 400 */
.single-product .price,
.single-product .price .amount,
.popup-quick-view .price,
.product-grid-item .price,
.product-grid-item .price .amount {
    font-weight: 400 !important;
}

/* 缺貨標籤原 weight 100 + 10px */
.labels-rounded .out-of-stock {
    font-weight: 400 !important;
}

/* 尺寸表 accordion 原 weight 501（typo） */
.sizechartbakery112.vc_tta-color-white.vc_tta-style-flat .vc_tta-panel.vc_active .vc_tta-panel-heading a {
    font-weight: 500 !important;
}

/* store notice 原 font-family: sans-serif 裸寫 */
p.woocommerce-store-notice.demo_store,
p.woocommerce-store-notice.demo_store a {
    font-family: var(--cereal-font-main) !important;
}

/* bolder / lighter 類（a.clect、font.demofont 等自訂 CSS） */
a.clect, font.demofont {
    font-weight: 500 !important;
}

/* mini-cart 價格 / widget 標題原 weight 100（basel 自訂 CSS） */
.widget-title,
.widget_shopping_cart .quantity,
.widget_shopping_cart .quantity .amount,
.widget_shopping_cart .woocommerce-Price-amount,
.widget_shopping_cart .total .amount {
    font-weight: 400 !important;
}

/* ============================================================
 * 4. 實測殘留補刀（94 PDP computed style 掃描後補）
 * ============================================================ */

/* basel-dynamic 有 h1 a, h2 a, h3 a... 家族規則，蓋掉商品連結 */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
.title a, .product-title a,
.vc_tta-panel-title, .vc_tta-panel-title a, .vc_tta-title-text,
.jose956-preorder-badge,
.product_meta, .posted_in, .tagged_as, .posted_in a, .tagged_as a {
    font-family: var(--cereal-font-main) !important;
}

/* 價格系（相關商品/mini-cart bdi 殘留 weight 100）統一 400 */
.woocommerce-Price-amount, .woocommerce-Price-amount bdi,
.woocommerce-Price-currencySymbol,
.product_meta, .posted_in, .tagged_as {
    font-weight: 400 !important;
}

/* weight 200 殘留：variation swatch 名 / 註冊頁 h2 */
.single-product-content .variations .swatches-select > div,
.basel-registration-page h2 {
    font-weight: 400 !important;
}

/* weight 600 禁用 → 500（表頭 / 下拉選單 / tabs / mini-cart 小計） */
table tr th,
.mega-menu-list > li > a,
.basel-navigation .menu > li.menu-item-design-full-width .sub-menu > li > a,
.basel-navigation .menu > li.menu-item-design-sized .sub-menu > li > a,
.wc-tabs li a, .wc-tabs li.active a,
.jose956-p3-tabs-nav li a,
.basel-load-more, .weight-bold,
.woocommerce-ordering.with-list .selected-order,
.login-form-side .create-account-text,
a.jose956-menu-item.active {
    font-weight: 500 !important;
}

/* digits 登入彈窗（.dig-box 系；刻意排除 i / fa / icon 元素避免誤傷 icon font） */
.dig-box div, .dig-box p, .dig-box label, .dig-box input, .dig-box button,
.dig-box a, .dig-box select, .dig-box textarea, .dig-box h1, .dig-box h2, .dig-box h3,
.dig-box span:not([class*="fa"]):not([class*="icon"]),
.digits-login-form label, .digits-login-form input, .digits-login-form button {
    font-family: var(--cereal-font-main) !important;
}

/* TranslatePress 語言切換器 */
.trp-language-item-name, .trp_language_switcher_shortcode a {
    font-family: var(--cereal-font-main) !important;
}

/* ============================================================
 * 5. v1.2 排版微調（Jose 7/5 視覺反饋）—— 對標 Zara
 * ============================================================ */

/* 5a. /latest/ SORT BY 列 → 對齊分類導覽
 *     （跟 jose956-custom-menu.css 同節奏：13px、≤480px 降 12px、字距 .5px；
 *     SORT BY 本體 500 比照 active 選單項，現行排序標籤 400） */
.jose956-sort-trigger-wrap button {
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    font-weight: 500 !important;
}
.jose956-current-sort { font-weight: 400 !important; }
.jose956-sort-trigger-wrap button svg {
    /* chevron 線寬 2.5 對細字體太重 */
    stroke-width: 1.5 !important;
    width: 12px; height: 12px;
}
a.jose956-sort-option {
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    font-weight: 400 !important;
}
a.jose956-sort-option.active { font-weight: 500 !important; }

/* WooCommerce 分類頁（/new/ BEST SELLER 等）的 SORT BY 掛在 a.open-filters，
 * 跟 /latest/ 的 trigger-wrap 是兩個元件，樣式必須同步 */
.shop-loop-head a.open-filters,
.shop-loop-head .basel-filter-buttons a.open-filters {
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    font-weight: 500 !important;
}
.shop-loop-head a.open-filters svg {
    stroke-width: 1.5 !important;
    width: 12px; height: 12px;
}
@media (max-width: 480px) {
    .jose956-sort-trigger-wrap button,
    .shop-loop-head a.open-filters,
    .shop-loop-head .basel-filter-buttons a.open-filters,
    a.jose956-sort-option {
        font-size: 12px !important;
    }
}

/* 5b.（已退役 2026-07-06）mini-cart 舊排版字級補償——Zara 全螢幕 mini-cart 上線後
   （basel-child mini-cart.php 覆寫＋cereal-cart-zara.css），字級由 cart-zara 全權管理 */

/* 5c. PDP 購買區：規格 label / 清除 收斂 12px；價格 14px 平衡中文標題的視覺份量 */
.summary .price, .summary .price .amount { font-size: 14px !important; }
.variations .label, .variations td.label, .variations label {
    font-size: 12px !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
/* jose956-layout.css 的 .mobile-moved-summary 系列有 15px !important，
 * 需同等 specificity（本檔載入較晚，同分後者勝） */
.reset_variations,
.mobile-moved-summary .reset_variations,
.summary .reset_variations {
    font-size: 12px !important;
    letter-spacing: 0.5px;
}
/* basel 用 content:"X" + basel-font 畫圖示，但該字位無 glyph，fallback 成細體字母 X 很突兀 → 拿掉 */
.reset_variations::before { display: none !important; content: none !important; }

/* 5d. 加入購物車 → Zara 式白底黑框（disabled/未選規格狀態不動） */
.single_add_to_cart_button {
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 1px !important;
}
.single_add_to_cart_button:not(.disabled) {
    background-color: #fff !important;
    color: #242424 !important;
    border: 1px solid #242424 !important;
}
.single_add_to_cart_button:not(.disabled):hover {
    background-color: #242424 !important;
    color: #fff !important;
}
/* 底部固定 bar 對標 Zara mobile ADD：bar 留內距、按鈕內縮帶 1px 黑框 */
#jose956-bottom-bar {
    background: #fff !important;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom)) !important;
}
#jose956-bottom-bar .jose956-add-to-cart-btn {
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 1px !important;
    background-color: #fff !important;
    color: #242424 !important;
    border: 1px solid #242424 !important;
}
/* 未選規格（無 .ready-to-add）：灰框灰字提示尚不可加購 */
#jose956-bottom-bar .jose956-add-to-cart-btn:not(.ready-to-add) {
    color: #999 !important;
    border-color: #ccc !important;
}
#jose956-bottom-bar .jose956-add-to-cart-btn.ready-to-add:hover {
    background-color: #242424 !important;
    color: #fff !important;
}

/* digits 獨立登入頁（?login=true，容器 .digloginpage / .dig_bdy_container）
 * digits 對 label/input/button 有直接規則，須直接元素覆蓋 */
.digloginpage label, .digloginpage input, .digloginpage button, .digloginpage a,
.digloginpage div, .digloginpage span:not([class*="fa"]):not([class*="icon"]),
.dig_bdy_container label, .dig_bdy_container input, .dig_bdy_container button,
.dig_bdy_container a, .dig_bdy_container div,
.dig_bdy_container span:not([class*="fa"]):not([class*="icon"]) {
    font-family: var(--cereal-font-main) !important;
}

/* ============================================================
   商品卡片價格對標 Zara listing（2026-07-05 Jose 對比截圖）
   Zara 實測：11px / 300 / lh16 / #000、NT$ 後帶空隙、千分位。
   我們原況：11px / 400 / lh17.6 / 一般 #4c4c4c 特價 #202020。
   劃線原價維持灰色不動（保留特價辨識）。
   ============================================================ */
@media (max-width: 991px) {
    .product-grid-item .woocommerce-Price-amount,
    .product-grid-item .woocommerce-Price-amount bdi,
    .product-grid-item .woocommerce-Price-currencySymbol,
    .product-grid-item .cereal-card-price {
        font-size: 11px !important;
        font-weight: 300 !important;
        line-height: 16px !important;
        color: #000 !important;
    }
    .product-grid-item del .woocommerce-Price-amount,
    .product-grid-item del .woocommerce-Price-amount bdi {
        color: #ababab !important;
    }
    .product-grid-item .woocommerce-Price-currencySymbol {
        margin-right: 3px; /* Zara「NT$ 980」符號後空隙 */
    }
}
