/* Reset et variables */
:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --secondary: #6B7280;
    --accent: #F59E0B;
    --success: #10B981;
    --danger: #EF4444;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
}

/* Conteneur principal */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Carte produit */
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
    overflow: hidden;
}

/* Galerie d'images */
.product-gallery {
    padding: 1.5rem;
    position: relative;
}

.gallery-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.gallery-nav {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    transition: transform 0.2s ease, background-color 0.2s ease;
    pointer-events: auto;
}

.gallery-nav:hover {
    background: var(--gray-50);
    transform: scale(1.1);
}

.gallery-main {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gray-50);
    aspect-ratio: 16/9;
    margin-bottom: 1rem;
}

.image-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.gallery-main:hover .main-image {
    transform: scale(1.05);
}

.favorite, .zoom-toggle {
    position: absolute;
    background: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.favorite {
    top: 1rem;
    right: 1rem;
    color: var(--danger);
}

.zoom-toggle {
    bottom: 1rem;
    right: 1rem;
    color: var(--gray-700);
}

.favorite:hover, .zoom-toggle:hover {
    transform: scale(1.1);
}

.favorite:hover {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.gallery-thumbs {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.thumb {
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.thumb.active {
    border-color: var(--primary);
    opacity: 1;
}

.thumb img {
    width: 4rem;
    height: 4rem;
    object-fit: cover;
}

/* Information produit */
.product-info {
    padding: 2rem;
}

.product-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.price-tag {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.original {
    font-size: 1.125rem;
    color: var(--gray-600);
    text-decoration: line-through;
}

.discount {
    background: var(--success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stars {
    color: var(--accent);
    font-size: 1.25rem;
}

.reviews-count {
    color: var(--gray-600);
    text-decoration: none;
}

.reviews-count:hover {
    text-decoration: underline;
}

.product-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.product-features {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.product-features h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.product-features h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-700);
    margin: 1.5rem 0 1rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.feature-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.feature-list li strong {
    color: var(--gray-900);
    font-weight: 500;
}

.technical-specs {
    margin: 2rem 0;
}

.technical-specs h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.spec-item {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius);
    transition: transform 0.2s ease;
}

.spec-item:hover {
    transform: translateY(-2px);
}

.spec-label {
    display: block;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.spec-value {
    font-weight: 500;
    color: var(--gray-900);
}

/* Options produit */
.product-options {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.color-options label,
.quantity-picker label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.color-picks {
    display: flex;
    gap: 0.75rem;
}

.color-pick {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    background: var(--color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-pick.active {
    border-color: var(--primary);
    transform: scale(1.1);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: var(--gray-50);
}

#quantity {
    width: 3rem;
    height: 2.5rem;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

/* Boutons d'action */
.product-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

/* Méta-informations */
.product-meta {
    display: flex;
    gap: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
}

.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;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-card {
        grid-template-columns: 1fr;
    }
    
    .product-gallery {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .container {
        margin: 0;
    }
    
    .product-card {
        border-radius: 0;
        box-shadow: none;
    }
    
    .product-gallery {
        padding: 1rem;
    }
    
    .product-info {
        padding: 1.5rem;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .gallery-thumbs {
        justify-content: center;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 1rem;
    }
}
