/* ========================================= */
/* --- Variables globales (si non déjà définies dans un CSS commun) --- */
/* Si ces variables sont déjà dans un fichier CSS que tu lies partout, tu peux les retirer d'ici */
:root {
    --primary-color: #53e4b1; /* Vert clair / principal de la boutique */
    --secondary-color: #18faaf; /* Vert plus clair */
    --accent-color: #f4ff77; /* Jaune/vert accent */
    --text-color-dark: #333333; /* Texte foncé */
    --text-color-light: #ffffff; /* Texte clair */
    --bg-light: #f8f8f8; /* Fond clair */
    --bg-dark: #2F4F4F; /* Fond foncé */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --border-radius-soft: 8px;
    --spacing-xl: 100px;
    --spacing-large: 60px;
    --spacing-medium: 40px;
    --spacing-small: 20px;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* --- Styles spécifiques aux Pages Produits (Thème Principal) --- */

/* Assure-toi que box-sizing est bien appliqué, soit ici soit via un CSS global que tu lies */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light); /* Fond clair de la page produit */
    color: var(--text-color-dark);
    font-family: var(--font-body); /* Applique la police par défaut */
    line-height: 1.6;
}

.container {
    max-width: 1200px; /* Largeur maximale pour le contenu */
    margin: 0 auto; /* Centre le conteneur */
    padding: 0 var(--spacing-small); /* Padding sur les côtés */
}


/* Section de Détail Produit (Héro) */
.product-detail-hero {
    padding: var(--spacing-large) 0;
    background-color: var(--bg-light);
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Deux colonnes: image et infos */
    gap: var(--spacing-large);
    align-items: flex-start; /* Aligne le contenu en haut des colonnes */
}

/* Images du Produit */
.product-images {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-small);
}

.main-product-image {
    width: 50%;
    height: min-content;
    border-radius: var(--border-radius-soft);
    box-shadow: 0 10px 25px var(--shadow-medium);
}

.thumbnail-gallery {
    display: flex;
    gap: 10px;
    justify-content: center; /* Centre les vignettes */
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-soft);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumbnail.active,
.thumbnail:hover {
    border-color: var(--primary-color); /* Bordure colorée pour l'active ou le survol */
    box-shadow: 0 0 0 3px rgba(83, 228, 177, 0.4); /* Ombre légère autour de la bordure */
}

/* Informations du Produit */
.product-info {
    padding: var(--spacing-medium); /* 40px de padding */
    border-radius: var(--border-radius-soft);
    background-color: #fff; /* Fond blanc pour le bloc d'info */
    box-shadow: 0 5px 15px var(--shadow-light);
}

.product-title {
    font-family: var(--font-heading);
    font-size: 3.5em; /* Grand titre */
    color: var(--text-color-dark);
    margin-bottom: 10px;
    line-height: 1.1;
    font-weight: 800;
}

.product-price {
    font-family: var(--font-heading);
    font-size: 2.5em; /* Grand prix */
    color: var(--primary-color); /* Couleur primaire pour le prix */
    font-weight: 700;
    margin-bottom: 20px;
}

.product-rating {
    color: #FFD700; /* Or pour les étoiles */
    font-size: 1.2em;
    margin-bottom: 20px;
}

.product-rating .review-count {
    font-size: 0.8em;
    color: #666;
    margin-left: 5px;
}

.product-description {
    font-family: var(--font-body);
    font-size: 1.1em;
    color: var(--text-color-dark);
    line-height: 1.7;
    margin-bottom: var(--spacing-medium);
}

.product-options {
    display: flex;
    align-items: center;
    gap: var(--spacing-small);
    margin-bottom: var(--spacing-medium);
    flex-wrap: wrap; /* Permet le retour à la ligne sur petits écrans */
}

.quantity-selector label {
    font-family: var(--font-body);
    font-weight: 600;
    margin-right: 10px;
    color: var(--text-color-dark);
}

.quantity-selector input[type="number"] {
    width: 70px;
    padding: 10px;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius-soft);
    font-size: 1.1em;
    text-align: center;
    -moz-appearance: textfield; /* Cache les flèches sur Firefox */
}
/* Cache les flèches pour les navigateurs basés sur Webkit (Chrome, Safari) */
.quantity-selector input[type="number"]::-webkit-outer-spin-button,
.quantity-selector input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.add-to-cart-btn {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: 15px 30px;
    border: none;
    border-radius: 50px; /* Bouton arrondi */
    font-family: var(--font-heading);
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-to-cart-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.product-meta p {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 5px;
    line-height: 1.4;
}

/* Sections "En savoir plus" et "Produits Similaires" */
.product-features-section,
.related-products-section,
.product-comments-section { /* Ajout de la section commentaires ici */
    padding: var(--spacing-large) 0;
    background-color: var(--bg-light); /* Fond clair pour les sections */
    text-align: center; /* Centre les titres de section */
}

/* Styles pour les titres h2 des sections (peut être réutilisé si déjà dans un CSS global) */
.product-features-section h2,
.related-products-section h2,
.product-comments-section h2 { /* Ajout de la section commentaires ici */
    font-family: var(--font-heading);
    color: var(--text-color-dark);
    font-size: 2.8em;
    margin-bottom: var(--spacing-medium);
    position: relative;
    padding-bottom: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.product-features-section h2::after,
.related-products-section h2::after,
.product-comments-section h2::after { /* Ajout de la section commentaires ici */
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto 0 auto;
    border-radius: 2px;
}


.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-medium);
    margin-top: var(--spacing-medium);
}

.feature-item {
    background-color: #fff;
    border-radius: var(--border-radius-soft);
    padding: var(--spacing-medium);
    box-shadow: 0 5px 15px var(--shadow-light);
    text-align: center;
}

.feature-item h3 {
    font-family: var(--font-heading);
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.feature-item p {
    font-family: var(--font-body);
    font-size: 1em;
    color: var(--text-color-dark);
    line-height: 1.6;
}

/* Produits Similaires */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-medium);
    margin-top: var(--spacing-medium);
}

.related-product-card {
    background-color: #fff;
    border-radius: var(--border-radius-soft);
    box-shadow: 0 5px 15px var(--shadow-light);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-medium);
}

.related-product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 10px;
}

.related-product-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3em;
    color: var(--text-color-dark);
    margin-bottom: 5px;
    padding: 0 15px; /* Pour éviter que le texte ne colle aux bords */
}

.related-product-card .price {
    font-family: var(--font-body);
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.related-product-card .btn-view-product {
    display: inline-block;
    background-color: var(--accent-color); /* Bouton en couleur accent (jaune clair) */
    color: var(--text-color-dark);
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 20px; /* Espace sous le bouton dans la carte */
    transition: all 0.3s ease;
}

.related-product-card .btn-view-product:hover {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    transform: translateY(-2px);
}

/* ========================================= */
/* --- Styles pour la Vidéo placée sous les images --- */
/* ========================================= */
.product-video-inline {
    margin-top: var(--spacing-medium); /* Espace au-dessus de la vidéo */
    padding: var(--spacing-small); /* Un peu de padding interne */
    background-color: #fff; /* Fond blanc comme les images */
    border-radius: var(--border-radius-soft);
    box-shadow: 0 5px 15px var(--shadow-light);
    text-align: left; /* Le texte du titre est aligné à gauche par défaut */
}

.product-video-inline h3 {
    font-family: var(--font-heading);
    font-size: 1.5em;
    color: var(--text-color-dark);
    margin-bottom: 15px; /* Espace sous le titre de la vidéo */
    text-align: center; /* On recentre le titre spécifiquement */
}

/* ==== VIDÉO QUI PREND TOUTE LA LARGEUR DISPONIBLE DANS LA COLONNE ==== */
.product-images .video-wrapper {
    position: relative;
    width: 100% !important;        /* ← prend toute la largeur possible */
    max-width: none !important;    /* ← enlève toute limitation */
    margin: 40px 0 0 0 !important; /* ← espace au-dessus, pas de marge auto qui centre */
    padding-bottom: 56.25% !important; /* ratio 16:9 parfait */
    height: 0 !important;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.product-images .video-wrapper iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* ========================================= */
/* --- Nouvelle section Commentaires (Améliorée) --- */
/* ========================================= */
.comment-form-wrapper,
.comments-list {
    max-width: 800px; /* Largeur max pour les formulaires et listes */
    margin: var(--spacing-medium) auto; /* Centre et espace */
    background-color: #fff;
    padding: var(--spacing-medium);
    border-radius: var(--border-radius-soft);
    box-shadow: 0 5px 15px var(--shadow-light);
    text-align: left; /* Texte du formulaire et commentaires aligné à gauche */
}

.comment-form-wrapper h3,
.comments-list h3 {
    font-family: var(--font-heading);
    font-size: 1.8em;
    color: var(--text-color-dark);
    margin-bottom: var(--spacing-small);
    text-align: center; /* Centre les sous-titres */
}

.comment-form .form-group {
    margin-bottom: var(--spacing-small);
}

.comment-form label {
    display: block;
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color-dark);
}

.comment-form input[type="text"],
.comment-form select,
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius-soft);
    font-family: var(--font-body);
    font-size: 1em;
    color: var(--text-color-dark);
    background-color: #fcfcfc;
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Ajout box-shadow transition */
}

.comment-form input[type="text"]:focus,
.comment-form select:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 228, 177, 0.4); /* Ombre plus visible au focus */
}

.comment-form textarea {
    resize: vertical; /* Permet de redimensionner verticalement */
}

.submit-comment-btn {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: var(--spacing-small); /* Espace au-dessus du bouton */
    display: block; /* Pour prendre toute la largeur du conteneur du formulaire */
    width: 100%;
    max-width: 300px; /* Limite la largeur du bouton */
    margin-left: auto;
    margin-right: auto; /* Centre le bouton */
}

.submit-comment-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Styles pour la liste des commentaires */
.comments-list {
    margin-top: var(--spacing-large); /* Plus d'espace entre le formulaire et la liste */
}

.comment-item {
    border-bottom: 1px dashed #e0e0e0; /* Ligne de séparation plus claire */
    padding: var(--spacing-small) 0;
    margin-bottom: var(--spacing-small); /* Espacement entre les commentaires */
    transition: background-color 0.3s ease;
}

.comment-item:last-child {
    border-bottom: none; /* Pas de bordure pour le dernier commentaire */
    margin-bottom: 0;
}

.comment-item:hover {
    background-color: #f9f9f9; /* Léger fond au survol pour les commentaires */
}

.comment-meta {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 5px;
    display: flex; /* Utilise flexbox pour aligner les éléments */
    align-items: center;
    gap: 10px; /* Espace entre les éléments de la méta */
}

.comment-meta strong {
    color: var(--text-color-dark);
    font-size: 1.1em;
}

.comment-meta .comment-rating-stars { /* Renommé pour éviter conflit avec .product-rating */
    color: #FFD700; /* Jaune or pour les étoiles */
    font-size: 1.2em; /* Rend les étoiles plus grandes */
}

.comment-text {
    font-size: 1em;
    color: var(--text-color-dark);
    line-height: 1.6;
    margin-left: 0; /* Assure que le texte ne soit pas décalé */
    padding-left: 0;
}

/* --- Responsive Design pour les Pages Produits --- */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: 1fr; /* Une seule colonne sur les écrans plus petits */
        gap: var(--spacing-medium);
    }
    .product-info {
        padding: var(--spacing-medium);
    }
    .product-title {
        font-size: 2.8em;
    }
    .product-price {
        font-size: 2em;
    }
    .add-to-cart-btn {
        padding: 12px 25px;
        font-size: 1.1em;
    }
    .features-grid,
    .related-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .product-detail-hero,
    .product-features-section,
    .related-products-section,
    .product-comments-section { /* Ajout ici pour le responsive général */
        padding: var(--spacing-medium) 0;
    }
    .product-title {
        font-size: 2.2em;
    }
    .product-price {
        font-size: 1.8em;
    }
    .product-options {
        flex-direction: column;
        gap: var(--spacing-small);
    }
    .quantity-selector {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .add-to-cart-btn {
        width: 90%;
        max-width: 300px;
    }
    .thumbnail-gallery {
        flex-wrap: wrap;
        gap: 8px;
    }
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    .product-video-inline h3,
    .comment-form-wrapper h3,
    .comments-list h3 {
        font-size: 1.5em;
    }
    .comment-form-wrapper,
    .comments-list {
        padding: var(--spacing-small);
    }
}

@media (max-width: 480px) {
    .product-info {
        padding: var(--spacing-small);
    }
    .product-title {
        font-size: 1.8em;
    }
    .product-price {
        font-size: 1.5em;
    }
    .product-description {
        font-size: 1em;
    }
    .feature-item {
        padding: var(--spacing-small);
    }
    .feature-item h3 {
        font-size: 1.4em;
    }
    .related-product-card h3 {
        font-size: 1.1em;
    }
    .related-product-card .price {
        font-size: 1.1em;
    }
    .submit-comment-btn {
        font-size: 1em;
        padding: 10px 20px;
    }
}