/* Product Detail Page Styles */

.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Image du produit */
.product-detail-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.product-detail-image:hover {
    transform: scale(1.02);
}

/* Informations produit */
.product-info {
    padding: 0 20px;
}

.product-info h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.2;
}

/* Rating système - ÉTOILES FIXÉES DÉFINITIVEMENT */
.average-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

.star-rating-display {
    display: flex;
    gap: 2px;
    align-items: center;
}

/* RESET COMPLET pour toutes les étoiles du summary */
.average-rating *,
.star-rating-display * {
    transition: none !important;
    transform: none !important;
    text-shadow: none !important;
    animation: none !important;
    filter: none !important;
    box-shadow: none !important;
}

/* Ciblage ULTRA-SPÉCIFIQUE des étoiles */
.average-rating .star,
.average-rating span.star,
.average-rating .filled,
.average-rating .empty,
.star-rating-display .star,
.star-rating-display span.star,
.star-rating-display .filled,
.star-rating-display .empty,
.average-rating span:nth-child(2) span,
.star-rating-display span,
.average-rating span:nth-child(2) *,
.star-rating-display * {
    font-size: 18px !important;
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: baseline !important;
    transition: none !important;
    transform: none !important;
    text-shadow: none !important;
    animation: none !important;
    filter: none !important;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* FORCE ABSOLUE des couleurs étoiles pleines */
.average-rating .star.filled,
.average-rating .filled,
.star-rating-display .star.filled,
.star-rating-display .filled {
    color: #ffa500 !important;
}

/* FORCE ABSOLUE des couleurs étoiles vides */
.average-rating .star.empty,
.average-rating .empty,
.star-rating-display .star.empty,
.star-rating-display .empty {
    color: #ddd !important;
}

/* DESTRUCTION TOTALE de tous les effets possibles */
.average-rating *:hover,
.average-rating *:focus,
.average-rating *:active,
.average-rating *:visited,
.star-rating-display *:hover,
.star-rating-display *:focus,
.star-rating-display *:active,
.star-rating-display *:visited,
.average-rating .star:hover,
.average-rating .star:focus,
.star-rating-display .star:hover,
.star-rating-display .star:focus {
    color: inherit !important;
    transform: none !important;
    scale: 1 !important;
    transition: none !important;
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.average-rating span:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.average-rating span:last-child {
    color: #666;
    font-size: 0.9rem;
}

/* NOUVEAU : Styles pour le lien vers les avis */
.reviews-link {
    text-decoration: none;
    transition: color 0.3s ease;
}

.reviews-link:hover {
    color: #e74c3c;
    text-decoration: none;
}

.reviews-link span,
.reviews-link p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.reviews-link:hover span,
.reviews-link:hover p {
    color: #e74c3c;
}

/* NOUVEAU : Titre de la section avis */
.reviews-section {
    margin-top: 40px;
    scroll-margin-top: 20px; /* Pour le scroll lisse */
}

.reviews-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 15px;
}

/* Style pour les messages sans avis */
.no-reviews,
.already-reviewed,
.login-prompt {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
}

.no-reviews p,
.already-reviewed p,
.login-prompt p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

.login-prompt a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* Animation smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Prix */
.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: #e74c3c;
    margin: 20px 0;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-black {
    background-color: #1a1a1a;
    color: white;
    margin-bottom: 20px;
}

.btn-black:hover {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.btn-primary {
    background-color: #333; /* Vert au lieu du bleu */
    color: white;
}

.btn-primary:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Description */
.product-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin: 20px 0;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    border-left: 4px solid #333; /* Vert au lieu du bleu */
}

/* Site e-commerce */
.ecommerce-site {
    margin: 30px 0;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.site-description {
    flex: 1;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Onglets */
.product-tabs {
    grid-column: 1 / -1;
    margin-top: 40px;
}

.nav-tabs {
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 0;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: #666;
    padding: 15px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: #333; /* Vert au lieu du bleu */
    color: #333;
}

.nav-tabs .nav-link.active {
    border-bottom-color: #333; /* Vert au lieu du bleu */
    color: #333;
    background: none;
}

.tab-content {
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    min-height: 200px;
}

/* Reviews spécifiques à la page produit - Style moderne */
.prod-review-list {
    max-height: 700px;
    overflow-y: auto;
    padding-right: 10px;
}

.prod-review-list::-webkit-scrollbar {
    width: 6px;
}

.prod-review-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.prod-review-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.prod-review-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.prod-review-card {
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 16px;
    border: 1px solid #e8ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.prod-review-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.prod-review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.prod-review-card:hover::before {
    opacity: 1;
}

.prod-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.prod-reviewer-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 200px;
}

.prod-review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    background-color: #e74c3c;
}

.prod-review-avatar:hover {
    transform: scale(1.1);
}

.prod-reviewer-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}

.prod-review-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 165, 0, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 165, 0, 0.2);
}

.prod-review-star {
    font-size: 18px;
    margin-right: 2px;
    transition: none; /* Supprime les effets de transition */
    color: #ffa500; /* Orange fixe pour les étoiles */
}

.prod-review-star.filled {
    color: #ffa500;
    text-shadow: none; /* Supprime l'ombre */
}

/* Supprime tous les effets hover sur les étoiles des reviews */
.prod-review-star.filled:hover {
    transform: none; /* Pas d'effet de scale */
    color: #ffa500; /* Garde la couleur orange */
}

.prod-review-star.empty {
    color: #ddd;
}

.prod-review-content {
    color: #2c3e50;
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 1.05rem;
    padding: 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border-left: 3px solid #333; /* Vert au lieu du bleu */
    position: relative;
}

.prod-review-content::before {
    content: '"';
    position: absolute;
    top: -5px;
    left: 8px;
    font-size: 2rem;
    color: #333; /* Vert au lieu du bleu */
    font-weight: bold;
    opacity: 0.3;
}

.prod-review-image {
    max-width: 250px;
    height: auto;
    border-radius: 12px;
    border: 1px solid #e8ecef;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.prod-review-image:hover {
    transform: scale(1.05);
}

.prod-review-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #ecf0f1;
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Styles pour le formulaire d'avis */
.review-form-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
}

.review-form-container h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 2px solid #333; /* Vert au lieu du bleu */
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* Notation (stars) - FORMULAIRE */
.review-rating-input {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.review-rating-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.star-rating-options {
    display: flex;
    direction: rtl; /* Pour placer 5 étoiles à droite */
    justify-content: flex-end;
}

.star-rating-options input[type="radio"] {
    display: none;
}

.star-rating-options label {
    font-size: 2.5rem;
    color: #ddd;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.star-rating-options label:hover,
.star-rating-options label:hover ~ label {
    color: #ffa500; /* Orange pour le hover */
    transform: scale(1.1);
}

.star-rating-options input[type="radio"]:checked ~ label {
    color: #ffa500; /* Orange pour les étoiles sélectionnées */
}

/* Champs de texte et fichier */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #333; /* Vert au lieu du bleu */
    outline: none;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Bouton Soumettre */
.btn-submit-review {
    background-color: #333; /* Vert au lieu du bleu */
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    width: auto;
}

.btn-submit-review:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* Pour le champ de fichier */
.file-upload-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-upload-input label {
    background-color: #ecf0f1;
    color: #333;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: background-color 0.3s ease;
}

.file-upload-input label:hover {
    background-color: #e0e6e8;
}

.file-upload-input span {
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
}

/* Produits similaires */
#related-products {
    padding: 40px 0;
}

#related-products h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.product-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card .product-info {
    padding: 15px;
}

.product-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-card h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card h3 a:hover {
    color: #333; /* Vert au lieu du bleu */
}

.product-card .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e74c3c;
    display: block;
    margin-bottom: 10px;
}

.buy-btn {
    background-color: #333; /* Vert au lieu du bleu */
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.buy-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

/* RESPONSIVE DESIGN AMÉLIORÉ */
@media (max-width: 1200px) {
    .product-detail-container {
        max-width: 100%;
        padding: 15px;
        gap: 30px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 15px;
    }

    .product-info {
        padding: 0;
    }

    .product-info h1 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .product-price {
        font-size: 1.6rem;
        margin: 15px 0;
    }

    .product-description {
        font-size: 1rem;
        padding: 15px;
        margin: 15px 0;
    }

    .ecommerce-site {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 10px;
    }

    .site-logo {
        width: 50px;
        height: 50px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        padding: 0 10px;
    }

    .nav-tabs .nav-link {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .tab-content {
        padding: 15px;
    }

    /* Reviews responsive */
    .prod-review-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .prod-review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .prod-reviewer-info {
        min-width: auto;
        width: 100%;
    }

    .prod-review-rating {
        align-self: flex-end;
        padding: 6px 10px;
    }

    .prod-review-content {
        font-size: 1rem;
        padding: 12px;
    }

    .prod-review-image {
        max-width: 100%;
        height: auto;
    }

    .prod-review-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .prod-reviewer-name {
        font-size: 1rem;
    }

    .review-form-container {
        padding: 20px;
    }

    .review-form-container h3 {
        font-size: 1.5rem;
    }

    .average-rating {
        flex-wrap: wrap;
        gap: 8px;
    }

    .star-rating-display {
        order: -1;
    }
}

@media (max-width: 480px) {
    .product-detail-container {
        padding: 10px;
        gap: 20px;
    }

    .product-info h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .product-price {
        font-size: 1.4rem;
        margin: 12px 0;
    }

    .product-description {
        font-size: 0.95rem;
        padding: 12px;
    }

    .average-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 0;
    }

    .star-rating-display {
        order: -1;
    }

    .btn {
        width: 100%;
        margin-bottom: 12px;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 5px;
    }

    .product-card .product-info {
        padding: 12px;
    }

    .nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        display: inline-block;
        min-width: 120px;
    }

    .tab-content {
        padding: 12px;
    }

    /* Reviews mobile optimisé */
    .prod-review-list {
        max-height: 500px;
        padding-right: 5px;
    }

    .prod-review-card {
        padding: 12px;
        border-radius: 12px;
    }

    .prod-reviewer-info {
        gap: 10px;
    }

    .prod-review-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        background-color: #e74c3c;

    }

    .prod-reviewer-name {
        font-size: 0.95rem;
    }

    .prod-review-content {
        font-size: 0.9rem;
        padding: 10px;
    }

    .prod-review-rating {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .prod-review-star {
        font-size: 14px;
    }

    .prod-review-meta {
        font-size: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .review-form-container {
        padding: 15px;
    }

    .review-form-container h3 {
        font-size: 1.3rem;
    }

    .star-rating-options label {
        font-size: 2rem;
        padding: 0 2px;
    }
}

@media (max-width: 320px) {
    .product-detail-container {
        padding: 8px;
    }

    .product-info h1 {
        font-size: 1.3rem;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .prod-review-card {
        padding: 10px;
    }

    .prod-review-content {
        font-size: 0.85rem;
        padding: 8px;
    }

    .star-rating-options label {
        font-size: 1.8rem;
        padding: 0 1px;
    }

    .star,
    .prod-review-star {
        font-size: 14px;
    }
}

/* Animations et améliorations UX */
.product-detail-container {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Amélioration des focus states pour l'accessibilité */
.btn:focus,
.nav-link:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #333; /* Vert au lieu du bleu */
    outline-offset: 2px;
}

/* Loading états pour les images */
.product-detail-image,
.product-image {
    background-color: #f0f0f0;
    background-image: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.5) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}