/* ===== Product Page Theme System ===== */

/* Light Theme Variables */
:root {
    /* Primary Colors */
    --product-primary: #4CAF50;
    --product-primary-dark: #2E7D32;
    --product-primary-light: #66BB6A;
    --product-accent: #81C784;
    
    /* Background Colors */
    --product-bg-primary: #ffffff;
    --product-bg-secondary: #f8f9fa;
    --product-bg-tertiary: #e9ecef;
    --product-bg-quaternary: #dee2e6;
    
    /* Text Colors */
    --product-text-primary: #212121;
    --product-text-secondary: #424242;
    --product-text-muted: #9e9e9e;
    --product-text-light: #757575;
    --product-text-white: #ffffff;
    
    /* Border Colors */
    --product-border-light: #e0e0e0;
    --product-border-medium: #bdbdbd;
    --product-border-dark: #757575;
    
    /* Card Colors */
    --product-card-bg: #ffffff;
    --product-card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --product-card-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    
    /* Input Colors */
    --product-input-bg: #ffffff;
    --product-input-border: #e0e0e0;
    --product-input-focus: #4CAF50;
    
    /* Gradient Colors */
    --product-gradient-primary: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    --product-gradient-secondary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --product-gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    
    /* Special Colors */
    --product-success: #4CAF50;
    --product-warning: #ff9800;
    --product-error: #f44336;
    --product-info: #2196F3;
    
    /* Badge Colors */
    --product-badge-bg: rgba(76, 175, 80, 0.1);
    --product-badge-text: #4CAF50;
    --product-badge-border: rgba(76, 175, 80, 0.3);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    /* Primary Colors */
    --product-primary: #4CAF50;
    --product-primary-dark: #2E7D32;
    --product-primary-light: #66BB6A;
    --product-accent: #81C784;
    
    /* Background Colors */
    --product-bg-primary: #121212;
    --product-bg-secondary: #1e1e1e;
    --product-bg-tertiary: #2c2c2c;
    --product-bg-quaternary: #3a3a3a;
    
    /* Text Colors */
    --product-text-primary: #e0e0e0;
    --product-text-secondary: #bdbdbd;
    --product-text-muted: #757575;
    --product-text-light: #9e9e9e;
    --product-text-white: #ffffff;
    
    /* Border Colors */
    --product-border-light: #404040;
    --product-border-medium: #565656;
    --product-border-dark: #757575;
    
    /* Card Colors */
    --product-card-bg: #2c2c2c;
    --product-card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --product-card-hover: 0 8px 25px rgba(0, 0, 0, 0.4);
    
    /* Input Colors */
    --product-input-bg: #3a3a3a;
    --product-input-border: #565656;
    --product-input-focus: #4CAF50;
    
    /* Gradient Colors */
    --product-gradient-primary: linear-gradient(135deg, #2c2c2c 0%, #383838 100%);
    --product-gradient-secondary: linear-gradient(135deg, #1e1e1e 0%, #2c2c2c 100%);
    --product-gradient-card: linear-gradient(145deg, #2c2c2c 0%, #3a3a3a 100%);
    
    /* Special Colors */
    --product-success: #4CAF50;
    --product-warning: #ff9800;
    --product-error: #f44336;
    --product-info: #2196F3;
    
    /* Badge Colors */
    --product-badge-bg: rgba(76, 175, 80, 0.2);
    --product-badge-text: #66BB6A;
    --product-badge-border: rgba(76, 175, 80, 0.4);
}

/* ===== Base Styles ===== */
body {
    background-color: var(--product-bg-primary);
    color: var(--product-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.theme-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--product-card-bg);
    border: 2px solid var(--product-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--product-card-shadow);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.theme-toggle-btn i {
    font-size: 20px;
    color: var(--product-text-primary);
    transition: all 0.3s ease;
}

.theme-toggle-btn .fa-moon {
    opacity: 1;
    position: absolute;
}

.theme-toggle-btn .fa-sun {
    opacity: 0;
    position: absolute;
}

[data-theme="dark"] .theme-toggle-btn .fa-moon {
    opacity: 0;
}

[data-theme="dark"] .theme-toggle-btn .fa-sun {
    opacity: 1;
}

/* ===== Product Page Layout ===== */
.product-page {
    min-height: 100vh;
    background: var(--product-bg-primary);
    padding: 20px 0;
}

.product-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Product Header ===== */
.product-header {
    background: var(--product-card-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--product-card-shadow);
    border: 1px solid var(--product-border-light);
}

.product-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.product-breadcrumb a {
    color: var(--product-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-breadcrumb a:hover {
    color: var(--product-primary);
}

.product-breadcrumb .separator {
    color: var(--product-text-muted);
}

.product-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.product-main-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--product-text-primary);
    margin: 0;
}

/* ===== Product Badges ===== */
.product-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--product-badge-bg);
    color: var(--product-badge-text);
    border: 1px solid var(--product-badge-border);
}

.product-badge.bestseller {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border: none;
}

.product-badge.verified {
    background: linear-gradient(135deg, #4ecdc4, #6ee7dd);
    color: white;
    border: none;
}

.product-badge.discount {
    background: linear-gradient(135deg, #ffa726, #ffb74d);
    color: white;
    border: none;
}

/* ===== Main Content Grid ===== */
.product-main-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-bottom: 40px;
}

.product-content-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* ===== Product Gallery ===== */
.product-gallery {
    background: var(--product-card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--product-card-shadow);
    border: 1px solid var(--product-border-light);
    height: fit-content;
}

.main-image-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    aspect-ratio: 1;
}

.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.main-product-image:hover {
    transform: scale(1.05);
}

.gallery-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
}

.gallery-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gallery-control-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.gallery-thumb {
    min-width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-thumb:hover {
    border-color: var(--product-primary);
}

.gallery-thumb.active {
    border-color: var(--product-primary);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Product Info ===== */
.product-info {
    background: var(--product-card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--product-card-shadow);
    border: 1px solid var(--product-border-light);
    height: fit-content;
}

.product-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--product-border-light);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.brand-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--product-text-primary);
    text-decoration: none;
}

.brand-name:hover {
    color: var(--product-primary);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.rating-stars {
    color: #ffc107;
    font-size: 18px;
}

.rating-text {
    color: var(--product-text-muted);
    font-size: 14px;
}

.product-description {
    color: var(--product-text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
}

.view-full-description {
    color: var(--product-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.view-full-description:hover {
    color: var(--product-primary-dark);
}

/* ===== Desktop Intro Card ===== */
.desktop-product-intro {
    color: #000000;
}



.view-full-description {
    color: var(--product-primary);
    border: 1px solid var(--product-primary);
}

.view-full-description:hover {
    background: var(--product-primary);
    color: var(--product-text-white);
}

/* ===== Product Sidebar ===== */
.product-sidebar {
    background: var(--product-gradient-primary);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--product-card-shadow);
    border: 1px solid var(--product-border-light);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--product-border-light);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--product-text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-title i {
    color: var(--product-primary);
    font-size: 20px;
}

/* ===== Price Section ===== */
.price-section {
    text-align: center;
    background: var(--product-badge-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--product-badge-border);
}

.price-current {
    font-size: 32px;
    font-weight: 700;
    color: var(--product-primary);
    margin-bottom: 5px;
}

.price-original {
    font-size: 18px;
    color: var(--product-text-muted);
    text-decoration: line-through;
    margin-bottom: 10px;
}

.discount-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

/* ===== Stock Status ===== */
.stock-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 20px;
}

.stock-status.in-stock {
    background: rgba(76, 175, 80, 0.1);
    color: var(--product-success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.stock-status.out-of-stock {
    background: rgba(244, 67, 54, 0.1);
    color: var(--product-error);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.stock-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
}

/* ===== Variants Section ===== */
.variants-section {
    margin-bottom: 25px;
}

.variant-group {
    margin-bottom: 20px;
}

.variant-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--product-text-primary);
    margin-bottom: 10px;
    display: block;
}

.variant-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.variant-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 2px solid var(--product-border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--product-card-bg);
}

.variant-option:hover {
    border-color: var(--product-primary);
    background: var(--product-badge-bg);
}

.variant-option.active {
    border-color: var(--product-primary);
    background: var(--product-badge-bg);
    color: var(--product-primary);
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--product-border-light);
    transition: all 0.3s ease;
}

.variant-option:hover .color-swatch {
    border-color: var(--product-primary);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-button {
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.action-button.primary {
    background: linear-gradient(135deg, var(--product-primary), var(--product-primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.action-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.action-button.secondary {
    background: var(--product-card-bg);
    color: var(--product-text-primary);
    border: 2px solid var(--product-border-light);
}

.action-button.secondary:hover {
    border-color: var(--product-primary);
    color: var(--product-primary);
}

.action-button.outline {
    background: transparent;
    color: var(--product-primary);
    border: 2px solid var(--product-primary);
}

.action-button.outline:hover {
    background: var(--product-primary);
    color: white;
}

/* ===== Quantity Selector ===== */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.quantity-label {
    font-weight: 600;
    color: var(--product-text-primary);
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid var(--product-border-light);
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--product-card-bg);
    color: var(--product-text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--product-primary);
    color: white;
}

.quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-weight: 600;
    background: var(--product-input-bg);
    color: var(--product-text-primary);
    border-left: 1px solid var(--product-border-light);
    border-right: 1px solid var(--product-border-light);
}

.quantity-input:focus {
    outline: none;
    background: var(--product-badge-bg);
}

/* ===== Features Section ===== */
.features-section {
    background: var(--product-card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--product-card-shadow);
    border: 1px solid var(--product-border-light);
    margin-bottom: 30px;
}

.features-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--product-text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-title i {
    color: var(--product-primary);
    font-size: 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--product-badge-bg);
    border-radius: 10px;
    border: 1px solid var(--product-badge-border);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--product-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.feature-text {
    font-weight: 600;
    color: var(--product-text-primary);
}

/* ===== Tabs Section ===== */
.product-tabs {
    background: var(--product-card-bg);
    border-radius: 15px;
    box-shadow: var(--product-card-shadow);
    border: 1px solid var(--product-border-light);
    overflow: hidden;
}

.tab-header {
    display: flex;
    flex-wrap: wrap; /* allow pane to wrap to new line */
    background: var(--product-bg-secondary);
    border-bottom: 1px solid var(--product-border-light);
}

.tab-item {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--product-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-item:hover {
    color: var(--product-primary);
    background: var(--product-badge-bg);
}

.tab-item.active {
    color: var(--product-primary);
    background: var(--product-card-bg);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--product-primary);
}

.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    color: var(--product-text-primary);
    margin-bottom: 20px;
}

.tab-pane p {
    color: var(--product-text-secondary);
    line-height: 1.6;
}

/* ===== Hover Effects ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--product-card-hover);
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .product-main-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .product-sidebar {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .theme-toggle-container {
        top: 10px;
        left: 10px;
    }
    
    .theme-toggle-btn {
        width: 40px;
        height: 40px;
    }
    
    .theme-toggle-btn i {
        font-size: 16px;
    }
    
    .product-container {
        padding: 0 15px;
    }
    
    .product-content-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-main-title {
        font-size: 22px;
    }
    
    .product-title-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .price-current {
        font-size: 24px;
    }
    
    .sidebar-title {
        font-size: 16px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-header {
        flex-direction: column;
    }
    
    .tab-item {
        padding: 15px;
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-page > * {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--product-border-light);
    border-top: 4px solid var(--product-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== Additional Enhancements ===== */
.product-page {
    scroll-behavior: smooth;
}

/* Ensure proper contrast in dark mode */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--product-input-bg);
    color: var(--product-text-primary);
    border-color: var(--product-input-border);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--product-input-focus);
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

/* Enhanced accessibility */
.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;
}

/* Focus states */
.theme-toggle-btn:focus,
.action-button:focus,
.quantity-btn:focus,
.tab-item:focus {
    outline: 2px solid var(--product-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .theme-toggle-container,
    .gallery-controls,
    .action-buttons {
        display: none;
    }
    
    .product-page {
        background: white;
        color: black;
    }
} 