/* ============================================
   SPITI 產品詳情頁 - 沉浸式佈局 V3
   整合：品牌色 + Poppins 字體 + 現有功能
   ============================================ */

:root {
    /* SPITI 品牌色 */
    --primary: #4CCAB8;;
    --primary-light: #FFE5DC;
    --primary-dim: rgba(255, 107, 53, 0.1);
    
    /* 輔助色 */
    --success: #00B894;
    --success-light: rgba(0, 184, 148, 0.1);
    
    /* 文字色 */
    --text-dark: #1A1A1A;
    --text-mid: #636E72;
    --text-light: #B2BEC3;
    
    /* 背景色 */
    --bg-white: #FFFFFF;
    --bg-soft: #FAFAFA;
    --bg-cream: #FFF9F5;
    
    /* 陰影 */
    --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 32px rgba(255, 107, 53, 0.2);
    
    /* 圓角 */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ══════════════════════════════════════════
   使用原有 Header（不需要額外導航）
   ══════════════════════════════════════════ */
/* 產品頁面使用網站原有的 Header，這裡不需要額外樣式 */

/* ══════════════════════════════════════════
   Hero 全螢幕圖片區
   ══════════════════════════════════════════ */
.hero-gallery {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    padding: 10px 0 10px 0; /* 增加頂部 padding 避開 Header */
    position: relative;
}

/* Hero 區的浮動操作按鈕（分享、收藏） */
.hero-actions {
    position: absolute;
    top: 200px;
    right: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.hero-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    cursor: pointer;
    font-size: 22px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-mid);
}

.hero-action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.1);
}

.hero-action-btn.active {
    background: var(--primary);
    color: var(--bg-white);
}

@media (max-width: 768px) {
    .hero-actions {
        top: 140px;
        right: 20px;
    }
    
    .hero-action-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

.hero-image-wrapper {
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    position: relative;
}

.hero-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-image-wrapper:hover .hero-main-image {
    transform: scale(1.02);
}

/* 360度旋轉提示 */
.rotate-360-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: floatAnimation 3s ease-in-out infinite;
}

@keyframes floatAnimation {
    0%, 100% { 
        transform: translateX(-50%) translateY(0); 
    }
    50% { 
        transform: translateX(-50%) translateY(-10px); 
    }
}

.rotate-360-hint ion-icon {
    font-size: 20px;
}

/* ══════════════════════════════════════════
   縮圖 Dock（底部浮動）
   ══════════════════════════════════════════ */
.thumbnail-dock {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    padding: 12px 16px;
    border-radius: 28px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    z-index: 900;
    max-width: 90vw;
    overflow-x: auto;
    scrollbar-width: none;
}

.thumbnail-dock::-webkit-scrollbar {
    display: none;
}

.thumb-item {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: var(--bg-soft);
}

.thumb-item:hover {
    transform: scale(1.15) translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.thumb-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-dim);
}

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

.thumb-item.video {
    position: relative;
}
.video-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    background: rgba(0,0,0,0.35);
    border-radius: 8px;
    pointer-events: none;
}

/* 影片縮圖標記 */
.thumb-item.video::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-item.video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 18px;
    pointer-events: none;
}

/* ══════════════════════════════════════════
   產品資訊區
   ══════════════════════════════════════════ */
.product-info-section {
    background: var(--bg-white);
    padding: 20px 0 20px 0;
}

.info-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    padding: 0 15px;
}

/* ──────────────────────────────────────────
   左側：產品詳情
   ────────────────────────────────────────── */
.product-details {
    padding-top: 40px;
}

/* 麵包屑 */
.breadcrumb-nav {
    font-size: 14px;
    color: var(--text-mid);
    margin-bottom: 24px;
    letter-spacing: 0.3px;
    display: flex;
}

.breadcrumb-nav a {
    color: var(--text-mid);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-nav a:hover {
    color: var(--primary);
}

/* 產品標題 */
.product-main-title {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    color: var(--text-dark);
}

/* 副標題/描述 */
.product-subtitle {
    font-size: 16px;
    color: var(--text-mid);
    margin-bottom: 32px;
    line-height: 1.7;
    font-weight: 400;
}

/* 評分行 */
.rating-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #EFEFEF;
}

.stars-display {
    color: #FFB800;
    font-size: 20px;
    letter-spacing: 3px;
}

.reviews-link {
    color: var(--text-mid);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.reviews-link:hover {
    color: var(--primary);
}

/* 產品特性列表 */
.features-list {
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 16px;
    align-items: flex-start;
}

.feature-icon {
    color: var(--success);
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ──────────────────────────────────────────
   右側：購買卡片（Sticky）
   ────────────────────────────────────────── */
.purchase-card {
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    padding: 48px;
    position: sticky;
    top: 100px;
    box-shadow: var(--shadow-soft);
}

/* 價格 */
.price-display {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    line-height: 1;
}

.original-price {
    font-size: 24px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 12px;
}

.price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.price-row .price-display {
    margin-bottom: 0;
}
.price-row .original-price {
    margin-left: 0;
}
.discount-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #e74c3c;
    border-radius: 4px;
    padding: 2px 8px;
    vertical-align: middle;
    letter-spacing: .02em;
}

/* 庫存狀態 */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--success-light);
    color: var(--success);
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 32px;
}

.stock-badge.low-stock {
    background: rgba(255,193,7,0.1);
    color: #FFC107;
}

.stock-badge.out-of-stock {
    background: rgba(244,67,54,0.1);
    color: #F44336;
}

.stock-badge ion-icon {
    font-size: 18px;
}

/* 選項組 */
.option-group {
    margin-bottom: 32px;
}

.option-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-value {
    color: var(--primary);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

/* 顏色選擇器 */
.color-swatches {
    display: flex;
    gap: 14px;
}

.color-swatch {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px var(--primary-dim);
}

/* 預設顏色 */
.color-wood { background: linear-gradient(135deg, #D4A574, #C09060); }
.color-grey { background: linear-gradient(135deg, #9E9E9E, #757575); }
.color-dark-grey { background: linear-gradient(135deg, #616161, #424242); }
.color-white { background: linear-gradient(135deg, #FFFFFF, #F5F5F5); }
.color-black { background: linear-gradient(135deg, #424242, #212121); }

/* 尺寸選擇器 */
.size-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.size-option {
    padding: 16px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-white);
}

.size-option:hover {
    border-color: var(--primary);
}

.size-option.active {
    background: var(--primary);
    color: var(--bg-white);
    border-color: var(--primary);
}

/* 數量控制 */
.quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    border: 2px solid #E0E0E0;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-soft);
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--primary);
    color: var(--bg-white);
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 17px;
    color: var(--text-dark);
}

.qty-input:focus {
    outline: none;
}

/* CTA 按鈕 */
.cta-buttons {
    display: flex;
    gap: 16px;
}

.btn-add-to-cart {
    flex: 1;
    padding: 20px 32px;
    background: linear-gradient(135deg, var(--primary), #F7931E);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(255,107,53,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
}

.btn-add-to-cart:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255,107,53,0.4);
}

.btn-add-to-cart:active {
    transform: translateY(-1px);
}

.btn-add-to-cart.success {
    background: var(--success);
}

.btn-add-to-cart ion-icon {
    font-size: 22px;
}

.btn-bookmark {
    width: 64px;
    height: 64px;
    border: 2px solid #E0E0E0;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 28px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-mid);
}

.btn-bookmark:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-bookmark.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-white);
}

/* 平台購買連結（可選） */
.platform-links {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #EFEFEF;
}

.platform-links-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.platform-buttons {
    display: flex;
    gap: 10px;
}

.platform-btn {
    flex: 1;
    padding: 10px;
    border: 1.5px solid #E0E0E0;
    border-radius: 10px;
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════
   全螢幕Lightbox
   ══════════════════════════════════════════ */
.fullscreen-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.98);
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.fullscreen-lightbox.open {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: var(--bg-white);
    font-size: 32px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

/* ══════════════════════════════════════════
   響應式設計
   ══════════════════════════════════════════ */
@media (max-width: 1200px) {
    .info-container {
        gap: 60px;
    }

    .product-main-title {
        font-size: 26px;
    }

    .price-display {
        font-size: 48px;
    }
}

@media (max-width: 1024px) {
    .info-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .purchase-card {
        position: relative;
        top: 0;
    }

    .product-nav {
        padding: 16px 20px;
    }

    .hero-gallery {
        min-height: 60vh;
        padding: 40px 12px 20px;
    }

    .product-info-section {
        padding: 60px 20px 100px;
    }
    .thumbnail-dock {
        bottom: 80px;
        padding: 10px 12px;
    }
}

@media (max-width: 768px) {
    .hero-gallery {
        min-height: unset; /* 手機版更緊湊 */
        padding: 8px 8px 10px;
    }
    
    .hero-image-wrapper {
        max-width: 100%;
        aspect-ratio: 1/1;
    }

    .product-main-title {
        font-size: 24px;
    }

    .product-subtitle {
        font-size: 14px;
    }

    .price-display {
        font-size: 42px;
    }

    .purchase-card {
        padding: 32px 24px;
    }

    .thumbnail-dock {
        bottom: 80px;
        padding: 10px 12px;
    }

    .thumb-item {
        width: 56px;
        height: 56px;
    }

    .size-options {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn-bookmark {
        width: 100%;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .product-nav {
        padding: 12px 16px;
    }

    .nav-back-btn,
    .nav-icon-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .hero-gallery {
        min-height: 90vw;
        padding: 8px 8px 5px;
    }

    .product-main-title {
        font-size: 22px;
    }

    .price-display {
        font-size: 36px;
    }

    .color-swatches {
        gap: 10px;
    }

    .color-swatch {
        width: 48px;
        height: 48px;
    }
}