/**
 * DP Categories Frontend Styles
 * 商品分類顯示 - 前端樣式
 */

/* 手機版防止水平捲動 */
@media screen and (max-width: 767px) {
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .site-content,
    .ast-container,
    .elementor,
    .elementor-section-wrap {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
}

/* 容器 */
.dp-categories-wrapper {
    padding: 30px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Grid 佈局 */
.dp-categories-grid {
    display: grid;
    gap: 29px;
    margin: 0;
    padding: 0;
}

/* 響應式欄位設定 */
.dp-categories-wrapper[data-columns="2"] .dp-categories-grid {
    grid-template-columns: repeat(2, 1fr);
}

.dp-categories-wrapper[data-columns="3"] .dp-categories-grid {
    grid-template-columns: repeat(3, 1fr);
}

.dp-categories-wrapper[data-columns="4"] .dp-categories-grid {
    grid-template-columns: repeat(4, 1fr);
}

.dp-categories-wrapper[data-columns="5"] .dp-categories-grid {
    grid-template-columns: repeat(5, 1fr);
}

.dp-categories-wrapper[data-columns="6"] .dp-categories-grid {
    grid-template-columns: repeat(6, 1fr);
}

.dp-categories-wrapper[data-columns="7"] .dp-categories-grid {
    grid-template-columns: repeat(7, 1fr);
}

.dp-categories-wrapper[data-columns="8"] .dp-categories-grid {
    grid-template-columns: repeat(8, 1fr);
}

/* 分類項目容器 */
.dp-category-item {
    display: flex;
    flex-direction: column;
}

/* 圖片卡片 - 獨立區塊 */
.dp-category-image-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.dp-category-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* 連結樣式 */
.dp-category-link,
.dp-category-title-link {
    display: block;
    text-decoration: none !important;
    color: inherit;
}

.dp-category-link:hover,
.dp-category-link:focus,
.dp-category-link:active,
.dp-category-title-link:hover,
.dp-category-title-link:focus,
.dp-category-title-link:active {
    text-decoration: none !important;
    color: inherit;
    outline: none;
}

/* 圖片容器 - 331:141 比例 (約 2.35:1) */
.dp-category-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 42.6%;
    /* 141/331 = 0.426 = 42.6% 維持 331x141 比例 */
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

/* 圖片樣式 */
.dp-category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dp-category-image-card:hover .dp-category-image {
    transform: scale(1.08);
}

/* 分類標題 - 無背景、靠左對齊 */
.dp-category-title {
    margin: 0;
    padding: 0;
    margin-top: 25px;
    font-size: 22px;
    font-weight: 600;
    text-align: left;
    color: #2d3748;
    background: transparent;
    line-height: 1.4;
    letter-spacing: 0.5px;
    border: none;
}

.dp-category-title-link:hover .dp-category-title {
    color: #1a202c;
}

/* 響應式設計 */
@media screen and (max-width: 1400px) {
    .dp-categories-wrapper[data-columns="8"] .dp-categories-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media screen and (max-width: 1200px) {

    .dp-categories-wrapper[data-columns="7"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="8"] .dp-categories-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .dp-categories-wrapper[data-columns="6"] .dp-categories-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media screen and (max-width: 992px) {

    .dp-categories-wrapper[data-columns="5"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="6"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="7"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="8"] .dp-categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .dp-categories-grid {
        gap: 16px;
    }
}

@media screen and (max-width: 768px) {

    .dp-categories-wrapper[data-columns="3"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="4"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="5"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="6"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="7"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="8"] .dp-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dp-category-title {
        font-size: 14px;
        padding: 14px 10px;
    }

    .dp-categories-grid {
        gap: 14px;
    }

    .dp-category-image-card {
        border-radius: 12px;
    }
}

@media screen and (max-width: 576px) {
    .dp-categories-wrapper[data-columns="2"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="3"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="4"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="5"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="6"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="7"] .dp-categories-grid,
    .dp-categories-wrapper[data-columns="8"] .dp-categories-grid,
    .dp-categories-wrapper .dp-categories-grid {
        grid-template-columns: 1fr;
    }

    .dp-category-title {
        font-size: 16px;
        padding: 12px 0;
    }

    .dp-categories-grid {
        gap: 16px;
    }

    .dp-category-image-card {
        border-radius: 12px;
    }

    .dp-categories-wrapper {
        padding: 20px 0;
    }

    /* 強制 Elementor shortcode 容器自適應高度 */
    .elementor-shortcode:has(.dp-categories-wrapper),
    .elementor-widget-shortcode:has(.dp-categories-wrapper),
    .elementor-widget-shortcode .elementor-shortcode {
        display: block !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }
}

/* Elementor 相容性 */
.elementor-widget-shortcode .dp-categories-wrapper,
.elementor-shortcode .dp-categories-wrapper {
    width: 100%;
}

/* Elementor 容器手機版響應式 - 移除最小高度讓內容自動撐開 */
@media screen and (max-width: 767px) {
    /* 高優先級選擇器 - 覆蓋 Elementor 的 CSS 變數 */
    body .elementor .e-con:has(.dp-categories-wrapper),
    body .e-con:has(.dp-categories-wrapper),
    .elementor-page .e-con:has(.dp-categories-wrapper),
    .e-con.e-parent:has(.dp-categories-wrapper),
    .e-con.e-con:has(.dp-categories-wrapper) {
        --min-height: auto !important;
        min-height: auto !important;
        height: auto !important;
    }

    /* 多層嵌套的容器也要處理 */
    body .e-con:has(.e-con .dp-categories-wrapper),
    body .e-con:has(.e-con .e-con .dp-categories-wrapper) {
        --min-height: auto !important;
        min-height: auto !important;
        height: auto !important;
    }

    /* 針對 e-con-inner 容器 - 確保高度自適應 */
    body .e-con:has(.dp-categories-wrapper) > .e-con-inner,
    body .e-con-boxed:has(.dp-categories-wrapper) > .e-con-inner {
        min-height: auto !important;
        height: auto !important;
    }

    /* 強制覆蓋 Elementor 內聯樣式 - 針對所有包含 dp-categories 的父容器 */
    body.elementor-page .e-con.e-parent:has(.dp-categories-wrapper),
    body.elementor-page .e-con.e-child:has(.dp-categories-wrapper),
    body.elementor-page .e-con-boxed:has(.dp-categories-wrapper) {
        --min-height: auto !important;
        --container-max-width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* 確保 shortcode widget 容器也能自適應 */
    body .elementor-widget-shortcode:has(.dp-categories-wrapper) {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    /* 針對背景容器 - 確保背景能完全包覆內容 */
    body .e-con[data-settings*="background"]:has(.dp-categories-wrapper) {
        min-height: auto !important;
        height: auto !important;
        padding-bottom: 30px !important;
    }
}

/* WooCommerce 相容性 */
.woocommerce .dp-categories-wrapper {
    width: 100%;
}

/* 確保在任何主題下都正常顯示 */
.dp-category-item *,
.dp-category-item *::before,
.dp-category-item *::after {
    box-sizing: border-box;
}

/* 移除 WordPress 預設連結底線 */
.dp-category-link,
.dp-category-link:visited {
    text-decoration: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
}

/* 圖片延遲載入支援 */
.dp-category-image[loading="lazy"] {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

/* 無障礙性改善 */
.dp-category-link:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.dp-category-link:focus:not(:focus-visible) {
    outline: none;
}

.dp-category-link:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ========================================
   商品列表樣式 - dp_products shortcode
   ======================================== */

/* 商品列表容器 */
.dp-products-wrapper {
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

/* 工具列 */
.dp-products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    flex-wrap: wrap;
    gap: 12px;
}

.dp-products-sorting {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dp-products-sorting label {
    font-size: 16px;
    color: #4a5568;
    font-weight: 500;
    white-space: nowrap;
}

.dp-orderby-select {
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%234a5568" d="M6 8L1 3h10z"/></svg>') no-repeat right 12px center;
    background-size: 10px;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 200px;
    white-space: nowrap;
}

.dp-orderby-select:hover {
    border-color: #cbd5e0;
}

.dp-orderby-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.dp-products-count {
    font-size: 14px;
    color: #718096;
}

/* 商品網格 */
.dp-products-grid {
    display: grid;
    gap: 30px 20px;
    margin: 0;
    padding: 0;
}

.dp-products-wrapper[data-columns="2"] .dp-products-grid,
.dp-products-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.dp-products-wrapper[data-columns="3"] .dp-products-grid,
.dp-products-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.dp-products-wrapper[data-columns="4"] .dp-products-grid,
.dp-products-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.dp-products-wrapper[data-columns="5"] .dp-products-grid,
.dp-products-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.dp-products-wrapper[data-columns="6"] .dp-products-grid,
.dp-products-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* 商品項目 - 符合圖片排版 */
.dp-product-item {
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* 商品連結 */
.dp-product-link {
    display: block;
    text-decoration: none !important;
    color: inherit;
}

.dp-product-link:hover,
.dp-product-link:focus {
    text-decoration: none !important;
    outline: none;
}

/* 商品圖片容器 - 固定 2:3 比例（寬:高） */
.dp-product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 150%;
    /* 3/2 = 1.5 = 150% 維持 2:3 比例 */
    overflow: hidden;
    background: transparent;
    border-radius: 0;
}

.dp-product-image-wrapper .dp-product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.dp-product-item:hover .dp-product-image-wrapper .dp-product-image {
    transform: scale(1.03);
}

/* ADD TO CART 按鈕覆蓋層 */
.dp-product-add-to-cart-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 10px 15px 10px;
    gap: 8px;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 2;
}

.dp-product-item:hover .dp-product-add-to-cart-overlay {
    opacity: 1 !important;
    visibility: visible !important;
}

.dp-add-to-cart-btn {
    display: inline-block;
    background-color: #f5e663 !important;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px 30px;
    border-radius: 0;
    text-decoration: none !important;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    border: none !important;
}

.dp-add-to-cart-btn:hover {
    background-color: #e6d85a !important;
    transform: scale(1.02);
    color: #ffffff !important;
}

/* 按鈕為 button 元素時的重置樣式 */
button.dp-add-to-cart-btn {
    border: none !important;
    cursor: pointer;
    font-family: inherit;
    background-color: #f5e663 !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none;
}

/* 載入中狀態 */
.dp-add-to-cart-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 已加入購物車狀態 */
.dp-add-to-cart-btn.added {
    background-color: #4CAF50 !important;
}

/* 查看購物車按鈕 */
.dp-view-cart-btn,
.dp-product-add-to-cart-overlay .added_to_cart {
    display: inline-block;
    background-color: #2d5a47;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 20px;
    border-radius: 0;
    text-decoration: none;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.dp-view-cart-btn:hover,
.dp-product-add-to-cart-overlay .added_to_cart:hover {
    background-color: #1e4030;
    color: #ffffff;
    text-decoration: none;
}

/* 確保所有狀態都沒有底線 */
.dp-product-add-to-cart-overlay .added_to_cart,
.dp-product-add-to-cart-overlay .added_to_cart:link,
.dp-product-add-to-cart-overlay .added_to_cart:visited,
.dp-product-add-to-cart-overlay .added_to_cart:hover,
.dp-product-add-to-cart-overlay .added_to_cart:active,
.dp-product-add-to-cart-overlay .added_to_cart:focus {
    text-decoration: none !important;
}

/* SELECT OPTIONS / VIEW PRODUCT 按鈕樣式 */
a.dp-add-to-cart-btn.dp-select-options {
    color: #ffffff;
}

a.dp-add-to-cart-btn.dp-select-options:hover {
    color: #ffffff;
}

/* 左上角 Icon (如 NEW 標籤) */
.dp-product-icon {
    position: absolute;
    z-index: 3;
}

.dp-product-icon img {
    display: block;
    max-width: 100%;
    height: auto;
}

.dp-icon-top-left {
    top: 8px;
    left: 8px;
    width: 45px;
    height: auto;
}

.dp-icon-top-left img {
    width: 100%;
}

/* 右下角 Icon (如舒適溫度圖示) */
.dp-icon-bottom-right {
    bottom: 8px;
    right: 8px;
    width: 60px;
    height: auto;
}

.dp-icon-bottom-right img {
    width: 100%;
}

/* 商品資訊區塊 - 置中對齊 */
.dp-product-info {
    padding: 15px 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}

/* 商品貨號 (灰色小字) */
.dp-product-sku {
    font-size: 16px;
    color: #727272;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 2px;
    min-height: 22px;
}

/* 商品顏色/規格 (灰色文字) */
.dp-product-color {
    font-size: 16px;
    color: #727272;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 2px;
    min-height: 22px;
}

/* 商品標題連結 */
.dp-product-title-link {
    text-decoration: none !important;
    color: inherit;
}

.dp-product-title-link:hover {
    text-decoration: none !important;
}

/* 商品標題 (灰色) */
.dp-product-title {
    margin: 0;
    font-size: 20px;
    font-weight: 400;
    color: #727272;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dp-product-title-link:hover .dp-product-title {
    color: #333;
}

/* 商品副標題 (黃色文字) */
.dp-product-subtitle {
    font-size: 16px;
    color: #eede02;
    line-height: 1.4;
    margin-top: 0;
    min-height: 22px;
}

/* 價格區塊 - 置中對齊 */
.dp-product-price {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 10px;
    line-height: 1.4;
    text-align: center;
    justify-content: center;
}

/* 特價格式：特價在前（黑色粗體），原價在後（灰色刪除線） */
.dp-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
    margin-left: 8px;
    text-decoration: line-through;
    order: 2;
}

.dp-product-price ins {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 700;
    order: 1;
}

/* 確保價格元素按正確順序排列 */
.dp-product-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
}

/* WooCommerce 價格相容性 */
.dp-product-price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.dp-product-price del .woocommerce-Price-amount {
    font-size: 14px;
    font-weight: 400;
    color: #999;
}

.dp-product-price ins .woocommerce-Price-amount {
    font-size: 17px;
    font-weight: 700;
    color: #575b5e;
}

/* 分頁 */
.dp-products-pagination-wrapper {
    margin-top: 40px;
}

.dp-products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dp-pagination-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

.dp-pagination-list li {
    margin: 0;
    padding: 0;
}

.dp-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s;
    cursor: pointer;
}

.dp-page-link:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
    text-decoration: none !important;
}

.dp-page-link.dp-page-active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.dp-page-link.dp-page-active:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

.dp-page-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    font-size: 14px;
    color: #a0aec0;
}

.dp-page-prev,
.dp-page-next {
    font-size: 16px;
}

/* 無商品 */
.dp-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 16px;
    background: #f7fafc;
    border-radius: 12px;
}

/* 錯誤訊息 */
.dp-error {
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
}

/* 載入中效果 */
.dp-products-wrapper.dp-loading {
    position: relative;
}

.dp-products-wrapper.dp-loading .dp-products-content {
    opacity: 0.5;
    pointer-events: none;
}

.dp-products-wrapper.dp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e2e8f0;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: dp-spin 0.8s linear infinite;
}

@keyframes dp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 響應式設計 - 商品列表 */
@media screen and (max-width: 1200px) {

    .dp-products-wrapper[data-columns="6"] .dp-products-grid,
    .dp-products-grid[data-columns="6"] {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media screen and (max-width: 992px) {

    .dp-products-wrapper[data-columns="5"] .dp-products-grid,
    .dp-products-wrapper[data-columns="6"] .dp-products-grid,
    .dp-products-grid[data-columns="5"],
    .dp-products-grid[data-columns="6"] {
        grid-template-columns: repeat(4, 1fr);
    }

    .dp-products-grid {
        gap: 24px 16px;
    }

    .dp-product-info {
        padding: 10px 0 0 0;
    }
}

@media screen and (max-width: 768px) {

    .dp-products-wrapper[data-columns="3"] .dp-products-grid,
    .dp-products-wrapper[data-columns="4"] .dp-products-grid,
    .dp-products-wrapper[data-columns="5"] .dp-products-grid,
    .dp-products-wrapper[data-columns="6"] .dp-products-grid,
    .dp-products-grid[data-columns="3"],
    .dp-products-grid[data-columns="4"],
    .dp-products-grid[data-columns="5"],
    .dp-products-grid[data-columns="6"] {
        grid-template-columns: repeat(3, 1fr);
    }

    .dp-products-toolbar {
        padding: 12px 16px;
    }

    .dp-products-sorting {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .dp-orderby-select {
        width: 100%;
    }

    .dp-product-title {
        font-size: 14px;
    }

    .dp-product-sku {
        font-size: 12px;
    }

    .dp-product-color {
        font-size: 12px;
    }

    .dp-product-price {
        font-size: 15px;
    }

    .dp-product-price del {
        font-size: 13px;
    }

    .dp-products-grid {
        gap: 20px 12px;
    }

    .dp-icon-top-left {
        width: 38px;
    }

    .dp-icon-bottom-right {
        width: 50px;
    }

    .dp-add-to-cart-btn {
        font-size: 12px;
        padding: 12px 30px;
        letter-spacing: 1px;
    }
}

@media screen and (max-width: 576px) {

    .dp-products-wrapper[data-columns="2"] .dp-products-grid,
    .dp-products-wrapper[data-columns="3"] .dp-products-grid,
    .dp-products-wrapper[data-columns="4"] .dp-products-grid,
    .dp-products-wrapper[data-columns="5"] .dp-products-grid,
    .dp-products-wrapper[data-columns="6"] .dp-products-grid,
    .dp-products-grid[data-columns="2"],
    .dp-products-grid[data-columns="3"],
    .dp-products-grid[data-columns="4"],
    .dp-products-grid[data-columns="5"],
    .dp-products-grid[data-columns="6"],
    .dp-products-wrapper .dp-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dp-products-grid {
        gap: 16px 10px;
    }

    .dp-product-info {
        padding: 8px 0 0 0;
        gap: 1px;
    }

    .dp-product-title {
        font-size: 13px;
    }

    .dp-product-sku {
        font-size: 11px;
    }

    .dp-product-color {
        font-size: 11px;
    }

    .dp-product-price {
        font-size: 14px;
        margin-top: 6px;
    }

    .dp-product-price del {
        font-size: 12px;
    }

    .dp-icon-top-left {
        width: 32px;
        top: 6px;
        left: 6px;
    }

    .dp-icon-bottom-right {
        width: 42px;
        bottom: 6px;
        right: 6px;
    }

    .dp-add-to-cart-btn {
        font-size: 10px;
        padding: 10px 20px;
        letter-spacing: 1px;
    }

    .dp-product-add-to-cart-overlay {
        padding: 0 10px 10px 10px;
    }

    .dp-page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }

    .dp-pagination-list {
        gap: 4px;
    }

    .dp-products-wrapper {
        padding: 15px 0;
    }

    /* 確保商品列表寬度填滿容器 */
    .dp-products-wrapper,
    .dp-products-toolbar,
    .dp-products-content,
    .dp-products-grid,
    .dp-products-pagination-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Elementor 容器手機版響應式 - 商品列表自適應高度 */
@media screen and (max-width: 767px) {
    /* 包含商品列表的 Elementor 容器 */
    body .e-con:has(.dp-products-wrapper),
    body .e-con-inner:has(.dp-products-wrapper),
    body.elementor-page .e-con.e-parent:has(.dp-products-wrapper),
    body.elementor-page .e-con.e-child:has(.dp-products-wrapper) {
        --min-height: auto !important;
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* 多層嵌套容器 */
    body .e-con:has(.e-con .dp-products-wrapper),
    body .e-con:has(.e-con .e-con .dp-products-wrapper) {
        --min-height: auto !important;
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* 確保 shortcode widget 不被裁切 */
    .elementor-widget-shortcode:has(.dp-products-wrapper),
    .elementor-shortcode:has(.dp-products-wrapper) {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    /* 商品分頁確保可見 */
    .dp-products-pagination-wrapper {
        position: relative;
        z-index: 10;
        padding-bottom: 20px;
    }

    /* 確保商品列表容器不被下方區塊覆蓋 */
    .dp-products-wrapper {
        position: relative;
        z-index: 1;
        padding-bottom: 30px !important;
    }
}

/* SR Only (螢幕閱讀器專用) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ====================================
   文章列表樣式 - [dp_posts]
   ==================================== */

.dp-posts-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* 工具列 - 與商品列表統一 */
.dp-posts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: inherit;
    background: transparent;
    border-radius: 0;
    flex-wrap: wrap;
    gap: 12px;
}

.dp-posts-sorting {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dp-posts-sorting label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
    white-space: nowrap;
}

.dp-posts-orderby-select {
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%234a5568" d="M6 8L1 3h10z"/></svg>') no-repeat right 12px center;
    background-size: 10px;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 200px;
    white-space: nowrap;
}

.dp-posts-orderby-select:hover {
    border-color: #cbd5e0;
}

.dp-posts-orderby-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.dp-posts-count {
    font-size: 14px;
    color: #718096;
}

/* 文章網格 */
.dp-posts-grid {
    display: grid;
    gap: 24px;
}

.dp-posts-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.dp-posts-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.dp-posts-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.dp-posts-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* 文章卡片 - 符合設計稿樣式 */
.dp-post-item {
    display: flex;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #b1b1b1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    height: 377px;
    box-sizing: border-box;
}

.dp-post-item:hover {
    background-color: #e6e6e6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 文章圖片 */
.dp-post-link {
    flex-shrink: 0;
    width: 254px;
    text-decoration: none;
    padding: 26px 16px;
    box-sizing: border-box;
}

.dp-post-image-wrapper {
    width: 222px;
    height: 324px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 12px;
}

.dp-post-image {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.dp-post-item:hover .dp-post-image {
    transform: scale(1.03);
}

/* 文章內容 */
.dp-post-content {
    flex: 1;
    padding: 58px 24px 26px 13px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow: hidden;
}

.dp-post-title-link {
    text-decoration: none;
}

.dp-post-title {
    margin: 0 0 80px 0;
    font-size: 25px;
    font-weight: 600;
    line-height: 1.4;
    color: #6a6b6e;
    transition: color 0.2s ease;
}

.dp-post-title-link:hover .dp-post-title {
    color: #1a1a1a;
}

.dp-post-subtitle {
    font-size: 14px;
    color: #8b7355;
    margin-bottom: 12px;
    font-weight: 500;
}

.dp-post-excerpt {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.8;
    color: #666;
    margin: 0;
}

/* 無文章提示 */
.dp-no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 12px;
}

/* 文章分頁 */
.dp-posts-pagination {
    margin-top: 32px;
}

.dp-posts-pagination .dp-pagination-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.dp-posts-pagination .dp-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dp-posts-pagination .dp-page-link:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f0f7fc;
}

.dp-posts-pagination .dp-page-link.dp-page-active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.dp-posts-pagination .dp-page-dots {
    color: #999;
    padding: 0 8px;
}

/* 載入狀態 */
.dp-posts-content.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.dp-posts-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: dp-posts-spin 1s linear infinite;
}

@keyframes dp-posts-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ====================================
   文章列表 RWD 響應式設計
   ==================================== */

@media (max-width: 1200px) {
    .dp-posts-grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    /* 平板：圖上字下，3欄 */
    .dp-posts-grid[data-columns="2"],
    .dp-posts-grid[data-columns="3"],
    .dp-posts-grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }

    .dp-post-item {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .dp-post-link {
        width: 100%;
        max-width: none;
        padding: 16px;
    }

    .dp-post-image-wrapper {
        width: 100%;
        height: 200px;
    }

    .dp-post-content {
        padding: 0 16px 16px 16px !important;
    }

    .dp-post-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
}

@media (max-width: 768px) {
    /* 手機：圖上字下，1欄 */
    .dp-posts-toolbar {
        padding: 12px 16px;
    }

    .dp-posts-sorting {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .dp-posts-orderby-select {
        width: 100%;
    }

    .dp-posts-grid[data-columns="2"],
    .dp-posts-grid[data-columns="3"],
    .dp-posts-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }

    .dp-post-item {
        flex-direction: column;
        min-height: auto;
    }

    .dp-post-link {
        width: 100%;
        max-width: none;
    }

    .dp-post-image-wrapper {
        width: 100%;
        height: 200px;
        min-height: 200px;
    }

    .dp-post-content {
        padding: 0 16px 16px 16px !important;
    }

    .dp-post-title {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .dp-post-subtitle {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .dp-post-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    /* 小螢幕手機 */
    .dp-post-content {
        padding: 16px;
        padding-top: 0;
    }

    .dp-posts-pagination .dp-page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
}

/* ====================================
   文章介紹區塊樣式 - [dp_intro]
   ==================================== */

.dp-intro-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.dp-intro-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 單個介紹項目 */
.dp-intro-item {
    display: flex;
    width: 100%;
    max-width: 1125px;
    height: 405px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin: 0 auto;
}

/* 左側文字區域 */
.dp-intro-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 50px;
    box-sizing: border-box;
}

.dp-intro-title {
    margin: 0 0 60px 0;
    font-size: 25px;
    font-weight: 600;
    line-height: 1.4;
    color: #6a6b6e;
}

.dp-intro-text {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
    color: #666;
    margin: 0;
}

.dp-intro-text br {
    display: block;
    content: "";
    margin-top: 0.8em;
}

/* 右側圖片區域 */
.dp-intro-image-wrapper {
    width: 50%;
    max-width: 562px;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 16px;
}

.dp-intro-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 無介紹項目 */
.dp-no-intro {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 12px;
}

/* ====================================
   文章介紹 RWD 響應式設計
   ==================================== */

@media (max-width: 1200px) {
    .dp-intro-item {
        max-width: 100%;
        height: auto;
        min-height: 350px;
    }

    .dp-intro-content {
        padding: 40px 35px;
    }

    .dp-intro-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
}

@media (max-width: 992px) {
    .dp-intro-item {
        min-height: 300px;
    }

    .dp-intro-content {
        padding: 30px 25px;
    }

    .dp-intro-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .dp-intro-text {
        font-size: 14px;
    }

    .dp-intro-image-wrapper {
        width: 45%;
    }
}

@media (max-width: 768px) {
    .dp-intro-item {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .dp-intro-content {
        padding: 25px 20px;
        order: 2;
    }

    .dp-intro-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .dp-intro-text {
        font-size: 14px;
        line-height: 1.8;
    }

    .dp-intro-image-wrapper {
        width: 100%;
        max-width: none;
        height: 250px;
        order: 1;
        border-radius: 16px 16px 0 0;
    }
}

@media (max-width: 480px) {
    .dp-intro-content {
        padding: 20px 15px;
    }

    .dp-intro-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .dp-intro-text {
        font-size: 13px;
    }

    .dp-intro-image-wrapper {
        height: 200px;
    }
}

/* ====================================
   單一產品頁面 [dp_single_product]
   ==================================== */

.dp-single-product-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 30px 0px;
    box-sizing: border-box;
}

.dp-single-product-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* 左側圖片區域 */
.dp-single-product-gallery {
    display: flex;
    gap: 15px;
    flex: 1 1 62%;
    max-width: 62%;
    min-width: 0;
    height: 748px;
}

/* 縮圖導覽 - 垂直排列 */
.dp-gallery-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 60px;
    flex-shrink: 0;
}

.dp-gallery-thumb {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.dp-gallery-thumb.active {
    border-color: #eede02;
}

.dp-gallery-thumb:hover {
    border-color: #eede02;
}

.dp-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 主圖 */
.dp-gallery-main-image {
    flex: 1;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    border: 1px solid #727272;
    background: #ffffff url('product-background.png') center center / 110% auto no-repeat;
}

.dp-gallery-main-image img.dp-main-product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* 單一商品頁面 - 左上角 Icon */
.dp-gallery-main-image .dp-product-icon {
    position: absolute;
    z-index: 10;
}

.dp-gallery-main-image .dp-product-icon img {
    display: block;
    max-width: 100%;
    height: auto;
}

.dp-gallery-main-image .dp-icon-top-left {
    top: -10px;
    left: -5px;
    width: 90px;
    height: auto;
}

.dp-gallery-main-image .dp-icon-top-left img {
    width: 100%;
}

/* 單一商品頁面 - 右下角 Icon */
.dp-gallery-main-image .dp-icon-bottom-right {
    bottom: 55px;
    right: 105px;
    width: 140px;
    height: auto;
}

.dp-gallery-main-image .dp-icon-bottom-right img {
    width: 100%;
}

/* 右側產品資訊 */
.dp-single-product-info {
    flex: 1 1 38%;
    max-width: 38%;
    min-width: 0;
    padding-left: 30px;
    padding-right: 24px;
    box-sizing: border-box;
}

/* 麵包屑 */
.dp-single-breadcrumb {
    margin-bottom: 15px;
    font-size: 12px;
    color: #888;
}

.dp-single-breadcrumb a {
    color: #888;
    text-decoration: none;
}

.dp-single-breadcrumb a:hover {
    color: #333;
    text-decoration: underline;
}

/* 產品標題 */
.dp-single-product-title {
    font-size: 20px;
    font-weight: 500;
    color: #6a6b6e;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

/* 顏色/規格文字 */
.dp-single-product-color {
    font-size: 18px;
    color: #999999;
    font-weight: 800;
    line-height: 0;
    margin-bottom: 35px;
}

/* 價格 */
.dp-single-product-price {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.dp-single-product-price del {
    color: #999;
    font-size: 16px;
    font-weight: 400;
    text-decoration: line-through;
}

.dp-single-product-price ins {
    text-decoration: none;
    color: #333;
    font-weight: 700;
}

.dp-single-product-price .woocommerce-Price-amount {
    font-size: inherit;
    color: #6a6b6e;
}

.dp-single-product-price del .woocommerce-Price-amount {
    font-size: 16px;
}

/* 產品介紹區 */
.dp-single-product-description {
    border: none;
    padding: 0;
    margin-bottom: 25px;
}

.dp-description-label {
    font-size: 18px;
    color: #888;
    margin-bottom: 10px;
}

.dp-description-content {
    font-size: 14px;
    color: #333;
    line-height: 1.8;
}

.dp-description-content p {
    margin: 0 0 8px 0;
}

.dp-description-content p:last-child {
    margin-bottom: 0;
}

.dp-description-content ul,
.dp-description-content ol {
    margin: 0;
    padding-left: 20px;
}

.dp-description-content li {
    margin-bottom: 5px;
}

.dp-description-content a {
    color: #333;
    text-decoration: underline;
}

/* 變體選項區 */
.dp-single-variations {
    margin-bottom: 25px;
    border: none;
    padding: 0;
}

.dp-variation-row {
    margin-bottom: 15px;
}

.dp-variation-row:last-of-type {
    margin-bottom: 0;
}

.dp-variation-label {
    display: block;
    font-size: 16px !important;
    color: #6a6b71;
    margin-bottom: 10px;
    font-weight: 400;
}

.dp-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dp-variation-option {
    width: 50px;
    height: 50px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    overflow: hidden;
    background: transparent;
}

.dp-variation-option:hover {
    opacity: 0.8;
}

.dp-variation-option.selected {
    border: 2px solid #eede02;
}

.dp-variation-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dp-variation-option span {
    display: none !important;
}

/* 數量與加入購物車 */
.dp-single-add-to-cart {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    width: 100%;
}

.dp-quantity-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #b1b2b3;
    border-radius: 5px;
    width: calc(50% - 5px);
    flex: 0 0 calc(50% - 5px);
    background: #fff;
    box-sizing: border-box;
    height: 40px;
    overflow: hidden;
}

.dp-qty-btn {
    width: 40px;
    min-width: 40px;
    height: 100%;
    background: #fff;
    border: none !important;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0;
    margin: 0;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    box-sizing: border-box;
}

.dp-qty-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.dp-qty-btn:active {
    background: #e8e8e8;
}

.dp-qty-btn:focus {
    outline: none;
}

.dp-quantity-input {
    flex: 1;
    width: auto;
    height: 100%;
    text-align: center;
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    font-size: 14px;
    -moz-appearance: textfield;
    background: #fff !important;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    color: #333;
    outline: none !important;
    box-shadow: none !important;
}

.dp-quantity-input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.dp-quantity-input::-webkit-outer-spin-button,
.dp-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dp-add-to-cart-button {
    width: calc(50% - 5px);
    flex: 0 0 calc(50% - 5px);
    height: 40px;
    background: #fff;
    border: 1px solid #b1b2b3;
    border-radius: 5px;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.dp-add-to-cart-button:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.dp-add-to-cart-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dp-add-to-cart-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 隱藏加入購物車後的查看購物車連結 */
.dp-single-add-to-cart .added_to_cart,
.dp-single-product-wrapper .added_to_cart {
    display: none !important;
}

/* 立即結帳按鈕 */
.dp-single-buy-now {
    width: 100%;
}

.dp-buy-now-button {
    width: 100%;
    height: 55px;
    background: #eede02;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dp-buy-now-button:hover {
    background: #d9c902;
}

.dp-buy-now-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dp-buy-now-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 錯誤訊息 */
.dp-single-product-error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 12px;
}

/* ====================================
   單一產品 RWD 響應式設計
   ==================================== */

@media (max-width: 992px) {
    .dp-single-product-container {
        flex-direction: column;
        gap: 30px;
    }

    .dp-single-product-gallery {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .dp-single-product-info {
        padding-left: 0;
        padding-right: 0;
    }

    .dp-gallery-thumbnails {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        order: 2;
        margin-top: 10px;
    }

    .dp-single-product-gallery {
        flex-direction: column;
    }

    .dp-gallery-main-image {
        order: 1;
    }
}

@media (max-width: 768px) {
    .dp-single-product-wrapper {
        padding: 15px;
    }

    .dp-single-product-title {
        font-size: 20px;
    }

    .dp-single-product-price {
        font-size: 20px;
    }

    .dp-gallery-thumb {
        width: 50px;
        height: 50px;
    }

    .dp-single-add-to-cart {
        flex-direction: column;
    }

    .dp-quantity-wrapper {
        width: 100%;
        justify-content: center;
    }

    .dp-add-to-cart-button {
        width: 100%;
    }

    /* 單一商品頁面 icon RWD */
    .dp-gallery-main-image .dp-icon-top-left {
        top: 10px;
        left: 10px;
        width: 55px;
    }

    .dp-gallery-main-image .dp-icon-bottom-right {
        bottom: 10px;
        right: 10px;
        width: 70px;
    }
}

@media (max-width: 480px) {
    .dp-single-product-title {
        font-size: 18px;
    }

    .dp-single-product-price {
        font-size: 18px;
    }

    .dp-single-product-description,
    .dp-single-variations {
        padding: 15px;
    }

    .dp-variation-option {
        width: 45px;
        height: 45px;
    }

    .dp-buy-now-button {
        height: 50px;
        font-size: 15px;
    }

    /* 單一商品頁面 icon RWD - 手機版 */
    .dp-gallery-main-image .dp-icon-top-left {
        top: 8px;
        left: 8px;
        width: 45px;
    }

    .dp-gallery-main-image .dp-icon-bottom-right {
        bottom: 8px;
        right: 8px;
        width: 55px;
    }
}

/* Line QR Code 樣式 */
.dp-line-qrcode {
    width: 100%;
    max-width: 80px;
}