:root {
    --bg-light: #f3f4f6;
    --text-light: #1f2937;
    --card-bg-light: #ffffff;
    --subtext-light: #6b7280;

    --bg-dark: #111827;
    --text-dark: #f9fafb;
    --card-bg-dark: #1f2937;
    --subtext-dark: #9ca3af;

    --brand-color: #4f46e5;
    --brand-color-hover: #4338ca;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-light);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

/* --- Mode Sombre --- */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--bg-dark);
        color: var(--text-dark);
    }
    .card {
        background-color: var(--card-bg-dark);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
    .product-title, .info-value, .image-detail-title {
        color: var(--text-dark);
    }
    .product-description, .info-label, .image-description-text, .thumbnail-title {
        color: var(--subtext-dark);
    }
    .info-color-swatch {
        border-color: #4b5563;
    }
    .thumbnail-scrollbar::-webkit-scrollbar-track {
        background: #2d3748;
    }
    .thumbnail-scrollbar::-webkit-scrollbar-thumb {
        background: #4a5568;
    }
    .thumbnail-scrollbar::-webkit-scrollbar-thumb:hover {
        background: #718096;
    }
}

/* --- Mise en Page Principale --- */
.container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
}

.product-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --- Composants --- */
.card {
    background-color: var(--card-bg-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /*height: 100%;*/
    box-sizing: border-box;
}

.product-info-column, .product-gallery-column {
    width: 100%;
}

/* --- Colonne d'Information (Gauche) --- */
.product-title {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: #111827;
}

.product-description {
    color: var(--subtext-light);
    margin-bottom: 2rem;
}

.info-fields > div:not(:last-child) {
    margin-bottom: 1.5rem;
}

.info-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--subtext-light);
}

.info-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: unset!important;
}

.info-color-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.info-color-swatch {
    height: 1.5rem;
    width: 1.5rem;
    border-radius: 9999px;
    background-color: black;
    border: 1px solid #d1d5db;
}

/* --- Colonne Galerie (Droite) --- */
.carousel-container {
    position: relative;
    background-color: var(--card-bg-light);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#mainImage {
    width: 100%;
    height: 24rem; /* 384px */
    /*object-fit: cover;*/
    object-fit: contain;
    transition: opacity 0.3s ease-in-out;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 0.5rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}
.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.6);
}
.carousel-btn svg {
    height: 1.5rem;
    width: 1.5rem;
}
#prevBtn { left: 1rem; }
#nextBtn { right: 1rem; }

.thumbnail-gallery {
    margin-top: 1rem;
}

.thumbnail-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--subtext-light);
    margin-bottom: 0.5rem;
}

#thumbnailContainer {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

#thumbnailContainer img {
    width: 5rem; /* 80px */
    height: 5rem; /* 80px */
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
#thumbnailContainer img:hover {
    opacity: 1;
}
#thumbnailContainer img.active {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--brand-color);
}

.image-details-box {
    margin-top: 1rem;
    padding: 1rem;
}

.image-detail-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.image-description-text {
    font-size: 0.875rem;
    color: var(--subtext-light);
}

/* --- Styles de Scrollbar --- */
.thumbnail-scrollbar::-webkit-scrollbar { height: 8px; }
.thumbnail-scrollbar::-webkit-scrollbar-track { background: #e5e7eb; }
.thumbnail-scrollbar::-webkit-scrollbar-thumb { background: #9ca3af; border-radius: 4px; }
.thumbnail-scrollbar::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* --- Styles Responsives --- */
@media (min-width: 640px) {
    .container { padding: 1.5rem; }
    .card { padding: 2rem; }
    .product-title { font-size: 2.25rem; }
}

@media (min-width: 1024px) {
    .container { padding: 2rem; }
    .product-grid {
        flex-direction: row;
        gap: 3rem;
    }
    .product-info-column, .product-gallery-column {
        width: 50%;
    }
}