/* --- CONFIGURATION DES VARIABLES (2025) --- */
:root {
    --primary: #2563eb;       /* Bleu moderne (Prix & Boutons) */
    --danger: #ef4444;        /* Rouge (Ancien prix) */
    --success: #10b981;       /* Vert (Stock) */
    --text-dark: #0f172a;     /* Titres */
    --text-muted: #64748b;    /* Descriptions */
    --bg-main: #ffffff;
    --bg-offset: #f8fafc;     /* Fonds de cartes */
    --border: #e2e8f0;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* --- MISE EN PAGE GÉNÉRALE --- */
.detail-container {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.product-view {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr; /* Ratio optimal image/infos */
    gap: 4rem;
    align-items: start;
}

/* --- GALERIE D'IMAGES RESPONSIVE --- */
.product-gallery {
    position: sticky;
    top: 2rem; /* Reste visible au scroll sur PC */
}

.main-image-container {
    background: var(--bg-offset);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnails-carousel {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Cache la scrollbar */
}

.thumbnails-carousel::-webkit-scrollbar { display: none; }

.thumb-item {
    width: 85px;
    height: 85px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    background: var(--bg-offset);
    overflow: hidden;
    transition: all 0.2s ease;
}

.thumb-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* --- INFORMATIONS PRODUIT & PRIX --- */
.brand-tag {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0.5rem 0 1.5rem 0;
    line-height: 1.2;
}

/* Couleurs demandées : Bleu pour nouveau, Rouge barré pour ancien */
.price-box {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2rem;
}

.current-price {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary); /* BLEU */
}

.old-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--danger); /* ROUGE */
    text-decoration: line-through;
    opacity: 0.8;
}

/* --- CARACTÉRISTIQUES (SPECS) --- */
.specs-carousel {
    display: flex;
    gap: 0.8rem;
    margin: 2rem 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.spec-card {
    min-width: 130px;
    background: var(--bg-offset);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    text-align: center;
}

.spec-card span { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.spec-card strong { display: block; font-size: 1rem; margin-top: 0.3rem; }

/* --- FORMULAIRE DE COMMANDE RAPIDE --- */
.customer-info-fields {
    background: var(--bg-offset);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.input-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.input-group input {
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* --- BOUTON D'ACHAT --- */
.btn-buy {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
}

.btn-buy:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.5);
}

.btn-buy:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* --- RESPONSIVE DESIGN (TABLETTES & MOBILES) --- */
@media (max-width: 1024px) {
    .product-view {
        grid-template-columns: 1fr; /* Une seule colonne */
        gap: 3rem;
    }

    .product-gallery {
        position: relative;
        top: 0;
    }

    .main-image-container {
        height: 400px;
    }
}

@media (max-width: 640px) {
    .detail-container {
        margin: 1rem auto;
    }

    h1 { font-size: 1.8rem; }

    .current-price { font-size: 2.2rem; }

    .main-image-container {
        height: 300px;
        padding: 1rem;
    }

    .customer-info-fields {
        padding: 1.5rem;
    }
}
