/* ============================================
   PRODUCT DETAIL PAGE UPGRADE CSS
   功能：顏色選擇、數量選擇、加入購物車、分享、評價
   ============================================ */

/* ── 1. 分享按鈕（浮動在標題右側）────────── */
/* ============================================
   Social Share Buttons CSS
   ============================================ */

.product-share {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 12px;
}

.share-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-right: 5px;
}

.share-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.share-btn:hover::before {
    width: 100%;
    height: 100%;
}

.share-btn ion-icon {
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========== 各平台專屬顏色 ========== */

/* WhatsApp */
.share-btn.whatsapp {
    color: #25D366;
}
.share-btn.whatsapp::before {
    background: #25D366;
}
.share-btn.whatsapp:hover {
    border-color: #25D366;
}
.share-btn.whatsapp:hover ion-icon {
    color: #fff;
}

/* Facebook */
.share-btn.facebook {
    color: #1877F2;
}
.share-btn.facebook::before {
    background: #1877F2;
}
.share-btn.facebook:hover {
    border-color: #1877F2;
}
.share-btn.facebook:hover ion-icon {
    color: #fff;
}

/* Instagram */
.share-btn.instagram {
    color: #E4405F;
}
.share-btn.instagram::before {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.share-btn.instagram:hover {
    border-color: #E4405F;
}
.share-btn.instagram:hover ion-icon {
    color: #fff;
}

/* TikTok */
.share-btn.tiktok {
    color: #000000;
}
.share-btn.tiktok::before {
    background: #000000;
}
.share-btn.tiktok:hover {
    border-color: #00f2ea;
}
.share-btn.tiktok:hover ion-icon {
    color: #fff;
}

/* Twitter/X */
.share-btn.twitter {
    color: #1DA1F2;
}
.share-btn.twitter::before {
    background: #1DA1F2;
}
.share-btn.twitter:hover {
    border-color: #1DA1F2;
}
.share-btn.twitter:hover ion-icon {
    color: #fff;
}

/* Telegram */
.share-btn.telegram {
    color: #0088cc;
}
.share-btn.telegram::before {
    background: #0088cc;
}
.share-btn.telegram:hover {
    border-color: #0088cc;
}
.share-btn.telegram:hover ion-icon {
    color: #fff;
}

/* Email */
.share-btn.email {
    color: #EA4335;
}
.share-btn.email::before {
    background: #EA4335;
}
.share-btn.email:hover {
    border-color: #EA4335;
}
.share-btn.email:hover ion-icon {
    color: #fff;
}

/* Copy Link */
.share-btn.copy {
    color: #666;
}
.share-btn.copy::before {
    background: #FF6B35;
}
.share-btn.copy:hover {
    border-color: #FF6B35;
}
.share-btn.copy:hover ion-icon {
    color: #fff;
}

/* ========== 響應式 ========== */
@media (max-width: 768px) {
    .product-share {
        justify-content: center;
        padding: 12px;
    }
    
    .share-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .share-label {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .share-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ========== Toast 通知樣式 ========== */
.product-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.product-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.product-toast ion-icon {
    font-size: 20px;
    color: #4CAF50;
}

/* ── 2. 產品選項區（顏色/尺寸）────────── */
.product-options {
    margin: 24px 0;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.option-group {
    margin-bottom: 20px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-label {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.option-label .selected-value {
    color: #FF6B35;
    font-weight: 700;
}

/* 顏色選擇器 */
.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: #FF6B35;
}

.color-option.active {
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.2);
}

.color-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 預定義顏色 */
.color-wood { background: linear-gradient(135deg, #D4A574, #C09060); }
.color-grey { background: linear-gradient(135deg, #9E9E9E, #757575); }
.color-white { background: linear-gradient(135deg, #FFFFFF, #F5F5F5); }
.color-black { background: linear-gradient(135deg, #424242, #212121); }
.color-darkgrey { background: linear-gradient(135deg, #616161, #424242); }
.color-blue { background: linear-gradient(135deg, #42A5F5, #1E88E5); }
.color-purple { background: linear-gradient(135deg, #AB47BC, #8E24AA); }
.color-pink { background: linear-gradient(135deg, #EC407A, #D81B60); }
.color-green { background: linear-gradient(135deg, #66BB6A, #43A047); }

/* 大地與自然系 Earth & Nature */
.color-beige { background: linear-gradient(135deg, #F5F5DC, #E6E6C3); }
.color-khaki { background: linear-gradient(135deg, #C3B091, #ADA08C); }
.color-olivegreen { background: linear-gradient(135deg, #949431, #6B6B1E); }
.color-brown { background: linear-gradient(135deg, #8D6E63, #5D4037); }
.color-brownorange { background: linear-gradient(135deg, #A0522D, #8B4513); }
.color-mintgreen { background: linear-gradient(135deg, #80CBC4, #4DB6AC); }
.color-lightgreen { background: linear-gradient(135deg, #9CCC65, #7CB342); }
.color-darkgreen { background: linear-gradient(135deg, #43A047, #2E7D32); }

/* 冷色與商務系 Cool & Professional */
.color-greyblue { background: linear-gradient(135deg, #78909C, #546E7A); }
.color-darkblue { background: linear-gradient(135deg, #1E88E5, #1565C0); }
.color-navyblue { background: linear-gradient(135deg, #303F9F, #1A237E); }
.color-skyblue { background: linear-gradient(135deg, #4FC3F7, #29B6F6); }
.color-peacockblue { background: linear-gradient(135deg, #0097A7, #006064); }

/* 金屬與特殊系 Metallic & Special */
.color-silver { background: linear-gradient(135deg, #CFD8DC, #B0BEC5); }
.color-gold { background: linear-gradient(135deg, #FFD54F, #FFB300); }
.color-rosegold { background: linear-gradient(135deg, #E5B7A8, #D18D80); }
.color-aromatherapypurple { background: linear-gradient(135deg, #CE93D8, #AB47BC); }

/* 亮色與鮮豔系 Vibrant */
.color-yellow { background: linear-gradient(135deg, #FDD835, #F9A825); }
.color-orange { background: linear-gradient(135deg, #FFA726, #FB8C00); }
.color-red { background: linear-gradient(135deg, #EF5350, #C62828); }
.color-lightgrey { background: linear-gradient(135deg, #EEEEEE, #E0E0E0); }

/* 尺寸/類型選擇器 */
.size-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.size-option {
    padding: 8px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.size-option:hover {
    border-color: #FF6B35;
    color: #FF6B35;
}

.size-option.active {
    background: #FF6B35;
    border-color: #FF6B35;
    color: #fff;
}

/* ── 3. 數量選擇器 ────────── */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.quantity-label {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #FF6B35;
    color: #fff;
}

.qty-btn:disabled {
    background: #f0f0f0;
    color: #ccc;
    cursor: not-allowed;
}

.qty-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

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

/* ── 4. 加入購物車按鈕 ────────── */
.product-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.btn-add-cart {
    flex: 1;
    min-width: 200px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,53,0.35);
}

.btn-add-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

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

/* 成功狀態 */
.btn-add-cart.success {
    background: #4CAF50;
}

.btn-bookmark {
    width: 50px;
    height: 50px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #666;
    transition: all 0.2s;
}

.btn-bookmark:hover {
    border-color: #FF6B35;
    color: #FF6B35;
    transform: translateY(-2px);
}

.btn-bookmark.active {
    background: #FF6B35;
    border-color: #FF6B35;
    color: #fff;
}

/* ── 5. 評價系統 ────────── */
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 12px;
    margin-bottom: 20px;
}

.rating-score {
    text-align: center;
}

.rating-number {
    font-size: 48px;
    font-weight: 700;
    color: #FF6B35;
    line-height: 1;
}

.rating-stars {
    font-size: 18px;
    color: #FFB800;
    margin: 8px 0;
}

.rating-count {
    font-size: 13px;
    color: #888;
}

.rating-breakdown {
    flex: 1;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.rating-bar:last-child {
    margin-bottom: 0;
}

.bar-label {
    font-size: 13px;
    color: #666;
    min-width: 50px;
}

.bar-track {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6B35, #F7931E);
    border-radius: 4px;
    transition: width 0.3s;
}

.bar-count {
    font-size: 13px;
    color: #888;
    min-width: 40px;
    text-align: right;
}

/* 評論項目 */
.review-item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.reviewer-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.review-date {
    font-size: 12px;
    color: #999;
}

.review-rating {
    font-size: 14px;
    color: #FFB800;
    margin-bottom: 8px;
}

.review-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.review-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.review-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.review-image:hover {
    transform: scale(1.05);
}

/* ── 6. 產品資訊標籤 ────────── */
.product-tabs {
    margin: 30px 0;
}

.tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--salmon-pink);
    background: #f9f9f9;
}

.tab-btn.active {
    color: var(--salmon-pink);
    border-bottom-color: var(--salmon-pink);
    font-weight: 600;
}

/* Tab 內容區 */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 響應式 */
@media (max-width: 768px) {
    .tab-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ── 7. 響應式設計 ────────── */
@media (max-width: 768px) {
    .product-share {
        justify-content: center;
    }

    .color-options,
    .size-options {
        justify-content: center;
    }

    .product-actions {
        flex-direction: column;
    }

    .btn-add-cart {
        min-width: 100%;
    }

    .reviews-summary {
        flex-direction: column;
        text-align: center;
    }

    .rating-breakdown {
        width: 100%;
    }
}

/* ── 8. Toast 通知（加入購物車成功）────────── */
.product-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.product-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.product-toast ion-icon {
    font-size: 20px;
    color: #4CAF50;
}

/* ── 9. 庫存狀態 ────────── */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin: 10px 0;
}

.stock-status.in-stock {
    background: #e8f5e9;
    color: #2E7D32;
}

.stock-status.low-stock {
    background: #FFF3E0;
    color: #F57C00;
}

.stock-status.out-of-stock {
    background: #FFEBEE;
    color: #C62828;
}

.stock-status ion-icon {
    font-size: 16px;
}

/* ── 10. 選中產品變體圖片預覽 ────────── */
.variant-image-preview {
    position: fixed;
    bottom: 100px;
    right: 40px;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.variant-image-preview.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.preview-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 16px;
    width: 280px;
    animation: slideInPreview 0.3s ease;
}

@keyframes slideInPreview {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
}

.preview-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--bg-soft);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.preview-close:hover {
    background: var(--primary);
    color: var(--bg-white);
}

.preview-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.preview-info {
    text-align: center;
    font-size: 14px;
    color: var(--text-dark);
}

.preview-info strong {
    color: var(--primary);
}

@media (max-width: 768px) {
    .variant-image-preview {
        right: 20px;
        bottom: 80px;
    }
    
    .preview-card {
        width: 240px;
        padding: 12px;
    }
}