/* ============================================================
   商品詳情頁 — 精緻雙欄佈局 (Dark Mode 優化)
   左：圖片（sticky） / 右：資訊 + 操作 + 商品說明
   ============================================================ */

/* ── 容器 ── */
.pdp-container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 40px 24px 64px;
}

/* ── 雙欄佈局 ── */
.pdp-hero {
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 40px;
    align-items: start;
}

/* 左欄 sticky — 捲動時圖片跟隨 */
.pdp-hero-left {
    position: sticky;
    top: 90px;
    align-self: start;
}

/* 單張圖 */
.pdp-hero-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.18);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* 圖庫輪播 */
.pdp-gallery { width: 100%; }
.pdp-gallery-main {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.pdp-gallery-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.18);
    transition: background-image 250ms ease;
}
.pdp-gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 14px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    letter-spacing: 0.5px;
}
.pdp-gallery-main .gallery-arrow {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
}

/* ── 右欄 ── */
.pdp-hero-right {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 右欄內嵌的說明/規格區塊 — 與操作卡片之間拉開間距 */
.pdp-hero-right > .pdp-section {
    margin-top: 20px;
}

/* 分類 badge — 在標題上方，只出現一次 */
.pdp-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.pdp-category-badge i {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* 標題 — 放大強化視覺焦點 */
.pdp-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #ecf0f1;
    line-height: 1.25;
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
}

/* 價格區 — 單行排列，簡潔明瞭 */
.pdp-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}
.pdp-price {
    font-size: 1.55rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.pdp-price-divider {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.15);
    font-weight: 300;
}
.pdp-price-points {
    font-size: 0.88rem;
    font-weight: 600;
    color: #FBBF24;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pdp-price-points i {
    font-size: 0.75rem;
}

/* Meta 資訊條 — 庫存 + 配送方式，群組化在價格下方 */
.pdp-meta-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.pdp-type-hint {
    font-size: 0.78rem;
    color: #58d68d;
}
.pdp-type-hint i { margin-right: 5px; }

.pdp-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 500;
}
.pdp-stock-badge i { font-size: 0.72rem; }
.pdp-stock-badge.meta-available { color: #2ecc71; }
.pdp-stock-badge.meta-warning   { color: #f39c12; }
.pdp-stock-badge.meta-unavailable { color: #e74c3c; }

/* 銷售時間警告 — 間距微調 */
.sale-time-warning {
    margin-bottom: 16px;
}

/* ── 購買操作卡片 ── */
.pdp-purchase-inline {
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Segmented Control（現代輕量版） ── */
.pdp-segmented-control {
    display: flex;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 20px;
}
.pdp-segmented-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}
.pdp-segment {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #7f8c8d;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}
.pdp-segment.active {
    color: #ecf0f1;
}
.pdp-segment:hover:not(.active) {
    color: #bdc3c7;
}
.pdp-segment i {
    font-size: 0.78rem;
}

/* ── 數量選擇器 — 對齊俐落 ── */
.pdp-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.pdp-qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}
.pdp-qty-control .qty-btn {
    width: 38px;
    height: 38px;
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: #bdc3c7;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
}
.pdp-qty-control .qty-btn:last-child {
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.pdp-qty-control .qty-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #ecf0f1;
}
.pdp-qty-control .qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #4a4a4a;
}
.pdp-qty-control input[type="number"] {
    width: 50px;
    text-align: center;
    background: transparent;
    border: none;
    color: #ecf0f1;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 0;
    -moz-appearance: textfield;
}
.pdp-qty-control input::-webkit-outer-spin-button,
.pdp-qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pdp-qty-control input:focus {
    outline: none;
}

.unit-price-label {
    font-size: 0.82rem;
    color: #7f8c8d;
    margin-left: 0;
}

/* ── 數量列旁的庫存顯示 ── */
.pdp-stock-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 500;
    transition: color 200ms ease;
}
.pdp-stock-inline i { font-size: 0.72rem; }
.pdp-stock-inline.stock-ok  { color: #95a5a6; }
.pdp-stock-inline.stock-out { color: #e74c3c; }

/* ── 小計行 ── */
.pdp-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    margin-bottom: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pdp-subtotal-label {
    font-size: 0.88rem;
    color: #7f8c8d;
}
.pdp-subtotal-value {
    font-weight: 700;
    color: #ecf0f1;
    font-size: 1.15rem;
}

/* ── 操作按鈕 ── */
.pdp-action-buttons {
    display: flex;
    gap: 12px;
}
.pdp-action-buttons .btn-add-to-cart {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #ecf0f1;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 200ms ease;
}
.pdp-action-buttons .btn-add-to-cart:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.pdp-action-buttons .btn-buy-now {
    flex: 1.2;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 200ms ease;
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.25);
}
.pdp-action-buttons .btn-buy-now:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(243, 156, 18, 0.35);
    filter: brightness(1.05);
}
.pdp-action-buttons .btn-add-to-cart:disabled,
.pdp-action-buttons .btn-buy-now:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: none;
}

/* ── 說明/規格區塊 ── */
.pdp-section {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 28px 30px;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pdp-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ecf0f1;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pdp-section-title i {
    color: #f39c12;
    font-size: 0.9rem;
}

.pdp-description {
    font-size: 0.9rem;
    color: #b0b8c0;
    line-height: 1.85;
}
.pdp-description p { margin-bottom: 10px; }
.pdp-description p:last-child { margin-bottom: 0; }

.pdp-landing-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 0.82rem;
    color: #f39c12;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 150ms ease;
}
.pdp-landing-link:hover { opacity: 0.8; color: #f39c12; }

/* ── 規格表（新版） ── */
.pdp-specs-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.pdp-spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.pdp-spec-item:last-child { border-bottom: none; }
.pdp-spec-label { color: #7f8c8d; font-size: 0.85rem; }
.pdp-spec-value { color: #bdc3c7; font-size: 0.85rem; font-weight: 500; }

/* ── 圖片下方 meta（實體商品頁面相容） ── */
.pdp-hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: #95a5a6;
    flex-wrap: wrap;
}
.pdp-hero-meta span { display: inline-flex; align-items: center; gap: 4px; }
.pdp-hero-meta > span { display: inline-flex; align-items: center; gap: 4px; }
#stockInfoMeta { display: contents; }
#stockInfoMeta span { display: inline-flex; align-items: center; gap: 4px; }
.pdp-hero-meta .meta-available, #stockInfoMeta .meta-available { color: #2ecc71; }
.pdp-hero-meta .meta-warning, #stockInfoMeta .meta-warning { color: #f39c12; }
.pdp-hero-meta .meta-unavailable, #stockInfoMeta .meta-unavailable { color: #e74c3c; }

/* ── pdp-shipping-note (實體商品) ── */
.pdp-shipping-note {
    font-size: 0.78rem;
    color: #5dade2;
    margin: 0;
}
.pdp-shipping-note i { margin-right: 5px; }

/* ── pdp-card-section-title ── */
.pdp-card-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ecf0f1;
    margin: 0 0 10px 0;
}

/* ── 舊版 specs 相容 ── */
.pdp-specs {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
}
.pdp-spec {
    display: flex;
    justify-content: space-between;
    padding: 12px 24px;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.pdp-spec:last-child { border-bottom: none; }
.pdp-spec span:first-child { color: #7f8c8d; }
.pdp-spec span:last-child { color: #bdc3c7; font-weight: 500; }
.pdp-spec .available { color: #2ecc71; }
.pdp-spec .warning { color: #f39c12; }
.pdp-spec .unavailable { color: #e74c3c; }
.pdp-spec .pending { color: #f39c12; }
.pdp-spec .ended { color: #e74c3c; }

/* ── 響應式 ── */
@media (max-width: 768px) {
    .pdp-container {
        padding: 16px 16px 48px;
    }
    .pdp-hero {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .pdp-hero-left {
        position: static;
    }
    .pdp-hero-right {
        padding: 0 6px;
    }
    .pdp-hero-image,
    .pdp-gallery-image {
        aspect-ratio: 4 / 3;
    }
    .pdp-title { font-size: 1.45rem; }
    .pdp-price { font-size: 1.3rem; }
    .pdp-section { padding: 20px; }
    .pdp-purchase-inline { padding: 20px; }
    .pdp-action-buttons {
        flex-direction: column;
    }
    .pdp-action-buttons .btn-buy-now {
        flex: 1;
        order: -1;
    }
}

@media (max-width: 480px) {
    .pdp-container { padding: 12px 12px 40px; }
    .pdp-title { font-size: 1.25rem; }
    .pdp-price { font-size: 1.15rem; }
    .pdp-section { padding: 16px; }
    .pdp-purchase-inline { padding: 16px; }
    .pdp-qty-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .pdp-qty-control {
        justify-content: center;
    }
    .unit-price-label {
        text-align: center;
    }
}

/* ============================================================
   Lightbox — 商品圖片全螢幕瀏覽
   ============================================================ */
.pdp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 280ms ease, visibility 280ms ease;
}
.pdp-lightbox.open {
    opacity: 1;
    visibility: visible;
}

/* 背景遮罩 */
.pdp-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 關閉按鈕 */
.pdp-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #bdc3c7;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 180ms ease;
}
.pdp-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.08);
}

/* 前後箭頭 */
.pdp-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #bdc3c7;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 180ms ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.pdp-lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateY(-50%) scale(1.06);
}
.pdp-lightbox-prev { left: 20px; }
.pdp-lightbox-next { right: 20px; }

/* 圖片區域 */
.pdp-lightbox-stage {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 72px 80px 100px;
    box-sizing: border-box;
}
.pdp-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 220ms ease, transform 220ms ease;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
}
.pdp-lightbox.open .pdp-lightbox-img {
    opacity: 1;
    transform: scale(1);
}

/* 計數器 */
.pdp-lightbox-counter {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

/* 縮圖列 */
.pdp-lightbox-thumbs {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 8px;
    max-width: 90vw;
    overflow-x: auto;
    padding: 6px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.pdp-lightbox-thumbs::-webkit-scrollbar { height: 0; }
.pdp-lightbox-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.45;
    transition: all 200ms ease;
}
.pdp-lightbox-thumb:hover {
    opacity: 0.75;
}
.pdp-lightbox-thumb.active {
    border-color: rgba(243, 156, 18, 0.7);
    opacity: 1;
}

/* ── Lightbox 響應式 ── */
@media (max-width: 768px) {
    .pdp-lightbox-stage {
        padding: 64px 16px 90px;
    }
    .pdp-lightbox-arrow {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    .pdp-lightbox-prev { left: 10px; }
    .pdp-lightbox-next { right: 10px; }
    .pdp-lightbox-close {
        top: 14px;
        right: 14px;
    }
    .pdp-lightbox-thumb {
        width: 44px;
        height: 44px;
    }
    .pdp-lightbox-thumbs {
        bottom: 18px;
    }
}

/* 圖庫主圖點擊提示 */
.pdp-gallery-image,
.pdp-hero-image {
    cursor: zoom-in;
}
.pdp-gallery-image:hover,
.pdp-hero-image:hover {
    filter: brightness(1.05);
    transition: filter 200ms ease;
}
