/* 只針對 DOLLS 模板中的 Product Collection */
.dolls-price-left .wc-block-components-product-price,
.dolls-price-left .wc-block-grid__product-price,
.dolls-price-left .price,
.dolls-price-left .wc-block-components-product-price__value {
    text-align: left !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
    width: 100% !important;
    display: block !important;
}
/* 只針對 DOLLS 頁，讓標題高度較一致，避免價格上下跳 */
.dolls-price-left .wc-block-components-product-name,
.dolls-price-left .wc-block-grid__product-title,
.dolls-price-left .wc-block-product-title {
    min-height: 3.2em;
    line-height: 1.2;
}

.dolls-price-left .wc-block-components-product-price,
.dolls-price-left .wc-block-grid__product-price,
.dolls-price-left .price {
    margin-top: 8px !important;
}


/* ==============================
   XXXX DOLL - YITH Option Thumbnail Matrix
   PC hover preview / Mobile tap preview support
   ============================== */

/* 整個 YITH 選項區 */
.single-product #yith-wapo-container,
.single-product .yith-wapo-container,
.single-product .yith-wapo-block {
    background: #111111 !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    margin-top: 16px !important;
}

/* PC 端右側選項區內部滾動，避免產品頁被拉太長 */
@media (min-width: 768px) {
    .single-product .summary #yith-wapo-container,
    .single-product .summary .yith-wapo-container {
        max-height: 680px !important;
        overflow-y: auto !important;
        padding-right: 8px !important;
    }

    .single-product .summary #yith-wapo-container::-webkit-scrollbar,
    .single-product .summary .yith-wapo-container::-webkit-scrollbar {
        width: 6px;
    }

    .single-product .summary #yith-wapo-container::-webkit-scrollbar-thumb,
    .single-product .summary .yith-wapo-container::-webkit-scrollbar-thumb {
        background: #444;
        border-radius: 10px;
    }

    .single-product .summary #yith-wapo-container::-webkit-scrollbar-track,
    .single-product .summary .yith-wapo-container::-webkit-scrollbar-track {
        background: #181818;
    }
}

/* 每一組選項 */
.single-product .yith-wapo-addon {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 0 !important;
    padding: 9px 0 11px !important;
    margin: 0 !important;
}

.single-product .yith-wapo-addon:last-child {
    border-bottom: 0 !important;
}

/* 選項組標題 */
.single-product .yith-wapo-addon h3,
.single-product .yith-wapo-addon h4,
.single-product .yith-wapo-addon .title,
.single-product .yith-wapo-addon-title {
    color: #ffffff !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    margin: 0 0 7px !important;
    padding: 0 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .35px !important;
}

/* 選項描述縮短 */
.single-product .yith-wapo-addon .description,
.single-product .yith-wapo-addon-description,
.single-product .yith-wapo-addon p {
    color: #9e9e9e !important;
    font-size: 10px !important;
    line-height: 1.35 !important;
    margin: 0 0 6px !important;
}

/* 選項列表：小圖矩陣 */
.single-product .yith-wapo-options,
.single-product .yith-wapo-option-list,
.single-product .yith-wapo-addon .options,
.single-product .yith-wapo-addon .options-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: flex-start !important;
}

/* 單個選項卡片 */
.single-product .yith-wapo-option,
.single-product .yith-wapo-addon .option {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    background: #1b1b1b !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 5px !important;
    padding: 2px !important;
    margin: 0 !important;
    text-align: center !important;
    position: relative !important;
    transition: all .15s ease !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

/* hover */
.single-product .yith-wapo-option:hover,
.single-product .yith-wapo-addon .option:hover {
    border-color: #D86B1C !important;
    box-shadow: 0 0 0 1px rgba(216,107,28,0.45) !important;
}

/* 選中狀態 */
.single-product .yith-wapo-option:has(input:checked),
.single-product .yith-wapo-addon .option:has(input:checked),
.single-product .yith-wapo-option.xdoll-selected,
.single-product .yith-wapo-addon .option.xdoll-selected {
    border-color: #D86B1C !important;
    background: #2a1a10 !important;
    box-shadow: 0 0 0 2px rgba(216,107,28,0.45) !important;
}

/* 圖片變小方圖 */
.single-product .yith-wapo-option img,
.single-product .yith-wapo-addon .option img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 3px !important;
}

/* 隱藏 radio / checkbox 原生圓點，用邊框表達選中 */
.single-product .yith-wapo-option input[type="radio"],
.single-product .yith-wapo-option input[type="checkbox"],
.single-product .yith-wapo-addon .option input[type="radio"],
.single-product .yith-wapo-addon .option input[type="checkbox"] {
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* 隱藏文字，避免變成直排 */
.single-product .yith-wapo-option label,
.single-product .yith-wapo-addon .option label {
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 沒圖片的 Default / No Upgrade 選項 */
.single-product .yith-wapo-option.xdoll-no-img,
.single-product .yith-wapo-addon .option.xdoll-no-img {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.single-product .yith-wapo-option.xdoll-no-img::after,
.single-product .yith-wapo-addon .option.xdoll-no-img::after {
    content: "NONE";
    color: #aaaaaa;
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
}

/* 放大預覽浮層 */
.xdoll-option-preview {
    position: fixed;
    z-index: 999999;
    background: #ffffff;
    color: #222222;
    border-radius: 8px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.35);
    padding: 8px;
    width: 190px;
    display: none;
    pointer-events: none;
    text-align: center;
}

.xdoll-option-preview img {
    width: 174px;
    height: 174px;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px;
    border-radius: 5px;
}

.xdoll-option-preview .xdoll-preview-title {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
    color: #222222;
}

.xdoll-option-preview .xdoll-preview-price {
    font-size: 12px;
    line-height: 1.3;
    color: #D86B1C;
    font-weight: 700;
    margin-top: 2px;
}

/* 手機端：點擊後置中顯示 */
@media (max-width: 767px) {
    .single-product .summary #yith-wapo-container,
    .single-product .summary .yith-wapo-container {
        max-height: none !important;
        overflow-y: visible !important;
    }

    .single-product .yith-wapo-option,
    .single-product .yith-wapo-addon .option {
        width: 52px !important;
        min-width: 52px !important;
        max-width: 52px !important;
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
    }

    .single-product .yith-wapo-option img,
    .single-product .yith-wapo-addon .option img {
        width: 46px !important;
        height: 46px !important;
        max-width: 46px !important;
        max-height: 46px !important;
    }

    .xdoll-option-preview {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 220px;
        padding: 10px;
        pointer-events: auto;
    }

    .xdoll-option-preview img {
        width: 200px;
        height: 200px;
    }
}
/* Make NONE / no-image options clickable and clean */
.single-product .yith-wapo-option.xdoll-no-img,
.single-product .yith-wapo-addon .option.xdoll-no-img {
    cursor: pointer !important;
}

.single-product .yith-wapo-option.xdoll-no-img::after,
.single-product .yith-wapo-addon .option.xdoll-no-img::after {
    pointer-events: none !important;
}


/* Let YITH native radio/checkbox handle all selections */
.single-product .yith-wapo-option,
.single-product .yith-wapo-addon .option {
    position: relative !important;
}

/* Make the real input cover the whole option card */
.single-product .yith-wapo-option input[type="radio"],
.single-product .yith-wapo-option input[type="checkbox"],
.single-product .yith-wapo-addon .option input[type="radio"],
.single-product .yith-wapo-addon .option input[type="checkbox"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    z-index: 20 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    margin: 0 !important;
}

/* Prevent image/text from stealing clicks */
.single-product .yith-wapo-option img,
.single-product .yith-wapo-addon .option img,
.single-product .yith-wapo-option label,
.single-product .yith-wapo-addon .option label,
.single-product .yith-wapo-option::after,
.single-product .yith-wapo-addon .option::after {
    pointer-events: none !important;
}


/* Fix NONE / no-image radio option click area */
.single-product .yith-wapo-option.xdoll-no-img,
.single-product .yith-wapo-addon .option.xdoll-no-img {
    cursor: pointer !important;
    position: relative !important;
}

/* Keep no-image option input clickable */
.single-product .yith-wapo-option.xdoll-no-img input[type="radio"],
.single-product .yith-wapo-addon .option.xdoll-no-img input[type="radio"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    z-index: 30 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* NONE text should not block clicking */
.single-product .yith-wapo-option.xdoll-no-img::after,
.single-product .yith-wapo-addon .option.xdoll-no-img::after {
    pointer-events: none !important;
}


/* ==============================
   XXXX DOLL - Clean NONE Radio Style
   Make NONE look consistent before/after selecting
   ============================== */

/* NONE option base */
.single-product .yith-wapo-option.xdoll-no-img,
.single-product .yith-wapo-addon .option.xdoll-no-img {
    position: relative !important;
    cursor: pointer !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Let the real radio cover the whole NONE box, but invisible */
.single-product .yith-wapo-option.xdoll-no-img input[type="radio"],
.single-product .yith-wapo-addon .option.xdoll-no-img input[type="radio"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    z-index: 30 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    margin: 0 !important;
}

/* Custom radio circle - unselected */
.single-product .yith-wapo-option.xdoll-no-img::before,
.single-product .yith-wapo-addon .option.xdoll-no-img::before {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    top: 8px !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255,255,255,0.65) !important;
    background: transparent !important;
    transform: translateX(-50%) !important;
    z-index: 5 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
}

/* Custom radio circle - selected */
.single-product .yith-wapo-option.xdoll-no-img:has(input[type="radio"]:checked)::before,
.single-product .yith-wapo-addon .option.xdoll-no-img:has(input[type="radio"]:checked)::before,
.single-product .yith-wapo-option.xdoll-no-img.xdoll-selected::before,
.single-product .yith-wapo-addon .option.xdoll-no-img.xdoll-selected::before {
    border-color: #D86B1C !important;
    background: radial-gradient(circle, #D86B1C 0 42%, transparent 45%) !important;
}

/* NONE text */
.single-product .yith-wapo-option.xdoll-no-img::after,
.single-product .yith-wapo-addon .option.xdoll-no-img::after {
    content: "NONE" !important;
    position: absolute !important;
    left: 50% !important;
    top: 24px !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    text-align: center !important;
    color: #bdbdbd !important;
    font-size: 7px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    writing-mode: horizontal-tb !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

/* Selected NONE card border */
.single-product .yith-wapo-option.xdoll-no-img:has(input[type="radio"]:checked),
.single-product .yith-wapo-addon .option.xdoll-no-img:has(input[type="radio"]:checked),
.single-product .yith-wapo-option.xdoll-no-img.xdoll-selected,
.single-product .yith-wapo-addon .option.xdoll-no-img.xdoll-selected {
    border-color: #D86B1C !important;
    background: #2a1a10 !important;
    box-shadow: 0 0 0 2px rgba(216,107,28,0.35) !important;
}

/* Selected NONE text color */
.single-product .yith-wapo-option.xdoll-no-img:has(input[type="radio"]:checked)::after,
.single-product .yith-wapo-addon .option.xdoll-no-img:has(input[type="radio"]:checked)::after,
.single-product .yith-wapo-option.xdoll-no-img.xdoll-selected::after,
.single-product .yith-wapo-addon .option.xdoll-no-img.xdoll-selected::after {
    color: #ffffff !important;
}


/* ==============================
   XXXX DOLL - YITH Price Summary Styling
   Product price / Total options / Order total
   ============================== */

/* YITH total price box */
.single-product #wapo-total-price-table,
.single-product .wapo-total-price-table,
.single-product .yith-wapo-total-price-table,
.single-product .yith-wapo-total-options {
    background: #111111 !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin: 14px 0 12px !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28) !important;
}

/* Table reset */
.single-product #wapo-total-price-table table,
.single-product .wapo-total-price-table table,
.single-product .yith-wapo-total-price-table table {
    width: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/* Each price row */
.single-product #wapo-total-price-table tr,
.single-product .wapo-total-price-table tr,
.single-product .yith-wapo-total-price-table tr {
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

.single-product #wapo-total-price-table tr:last-child,
.single-product .wapo-total-price-table tr:last-child,
.single-product .yith-wapo-total-price-table tr:last-child {
    border-bottom: 0 !important;
}

/* Labels */
.single-product #wapo-total-price-table th,
.single-product #wapo-total-price-table td,
.single-product .wapo-total-price-table th,
.single-product .wapo-total-price-table td,
.single-product .yith-wapo-total-price-table th,
.single-product .yith-wapo-total-price-table td {
    background: transparent !important;
    border: 0 !important;
    padding: 6px 0 !important;
    color: #d6d6d6 !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 500 !important;
}

/* Price amounts */
.single-product #wapo-total-price-table .amount,
.single-product .wapo-total-price-table .amount,
.single-product .yith-wapo-total-price-table .amount {
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Product price / options labels softer */
.single-product #wapo-total-price-table .wapo-product-price th,
.single-product #wapo-total-price-table .wapo-total-options th,
.single-product .wapo-total-price-table .wapo-product-price th,
.single-product .wapo-total-price-table .wapo-total-options th {
    color: #bdbdbd !important;
}

/* Total options value slightly warm */
.single-product #wapo-total-price-table .wapo-total-options .amount,
.single-product .wapo-total-price-table .wapo-total-options .amount {
    color: #e6b37a !important;
}

/* Order total row: highlight */
.single-product #wapo-total-price-table .wapo-total-order th,
.single-product #wapo-total-price-table .wapo-total-order td,
.single-product .wapo-total-price-table .wapo-total-order th,
.single-product .wapo-total-price-table .wapo-total-order td {
    padding-top: 9px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
}

/* Order total amount */
.single-product #wapo-total-price-table .wapo-total-order .amount,
.single-product .wapo-total-price-table .wapo-total-order .amount {
    color: #D86B1C !important;
    font-size: 17px !important;
    font-weight: 800 !important;
}

/* If YITH outputs plain divs instead of table */
.single-product .yith-wapo-total-price-table div,
.single-product .yith-wapo-total-options div {
    background: transparent !important;
    color: #d6d6d6 !important;
}

/* Mobile compact */
@media (max-width: 767px) {
    .single-product #wapo-total-price-table,
    .single-product .wapo-total-price-table,
    .single-product .yith-wapo-total-price-table,
    .single-product .yith-wapo-total-options {
        padding: 10px 12px !important;
        border-radius: 8px !important;
    }

    .single-product #wapo-total-price-table th,
    .single-product #wapo-total-price-table td,
    .single-product .wapo-total-price-table th,
    .single-product .wapo-total-price-table td {
        font-size: 13px !important;
    }

    .single-product #wapo-total-price-table .wapo-total-order .amount,
    .single-product .wapo-total-price-table .wapo-total-order .amount {
        font-size: 16px !important;
    }
}


/* ==============================
   MD Included as Standard Notice
   ============================== */

.single-product .md-included-standard {
    background: linear-gradient(135deg, #151515 0%, #101010 100%) !important;
    border: 1px solid rgba(216,107,28,0.38) !important;
    border-radius: 10px !important;
    padding: 12px 13px !important;
    margin: 0 0 12px !important;
    color: #d6d6d6 !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.24) !important;
}

/* Title */
.single-product .md-included-standard .md-standard-title {
    color: #ffffff !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: .35px !important;
    margin: 0 0 5px !important;
}

/* Subtitle */
.single-product .md-included-standard .md-standard-subtitle {
    color: #bdbdbd !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    margin: 0 0 8px !important;
}

/* List */
.single-product .md-included-standard .md-standard-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px 7px !important;
    padding: 0 !important;
    margin: 0 0 8px !important;
    list-style: none !important;
}

/* List item */
.single-product .md-included-standard .md-standard-list li {
    position: relative !important;
    color: #e5e5e5 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    padding-left: 12px !important;
    margin: 0 !important;
}


/* ==============================
   XXXX DOLL - Product Grid Title Alignment Only
   只統一產品列表標題高度，不調整圖片
   ============================== */

body:not(.single-product) .woocommerce ul.products li.product .woocommerce-loop-product__title,
body:not(.single-product) ul.products li.product .woocommerce-loop-product__title,
body:not(.single-product) .wc-block-grid__product-title,
body:not(.single-product) .wc-block-components-product-title,
body:not(.single-product) .wc-block-components-product-name,
body:not(.single-product) .wc-block-product-template .wp-block-post-title,
body:not(.single-product) .wp-block-post-template .wp-block-post-title {
    min-height: 66px !important;
    line-height: 1.35 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* 統一價格區高度，令 Add to Cart 按鈕更齊 */
body:not(.single-product) .woocommerce ul.products li.product .price,
body:not(.single-product) ul.products li.product .price,
body:not(.single-product) .wc-block-components-product-price,
body:not(.single-product) .wc-block-grid__product-price {
    min-height: 24px !important;
    margin-top: 8px !important;
}
/* ==============================
   XXXX DOLL - Navigation Dropdown Stay Longer
   讓導航下拉欄更穩定，不容易消失
   只影響電腦端
   ============================== */

@media (min-width: 782px) {

    /* 讓下拉欄消失時有一點延遲 */
    .wp-block-navigation .wp-block-navigation__submenu-container {
        transition:
            opacity 0.18s ease,
            visibility 0s linear 0.28s,
            transform 0.18s ease !important;
    }

    /* 滑過父級選單時，立即顯示 */
    .wp-block-navigation .wp-block-navigation-item:hover > .wp-block-navigation__submenu-container,
    .wp-block-navigation .wp-block-navigation-item:focus-within > .wp-block-navigation__submenu-container {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        transition-delay: 0s, 0s, 0s !important;
        pointer-events: auto !important;
    }

    /* 增加下拉欄上方可 hover 區域，避免鼠標移動時斷開 */
    .wp-block-navigation .wp-block-navigation__submenu-container::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: -12px;
        height: 12px;
        display: block;
        background: transparent;
    }

    /* 下拉欄本身加一點上移，減少與主導航的空隙 */
    .wp-block-navigation .wp-block-navigation__submenu-container {
        margin-top: 0 !important;
    }
}