/**
 * ELI compatibility fixes for Shop Product Reviews 5.2.7 / PrestaShop 8.2
 * Correctifs stables :
 * - étoiles Material Icons
 * - moyenne décimale + nombre d'avis
 * - alignement fiche produit
 * - alignement pages listes
 *
 * Ce fichier est volontairement statique : contrairement à custom_stars.css,
 * il n'est pas régénéré lors de l'enregistrement de la configuration du module.
 */

/* =========================================================
   BASE : ETOILES STABLES
   ========================================================= */

#spr .gsr-fixed-stars,
#spr_list .gsr-fixed-stars {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;

    gap: 1px !important;

    float: none !important;
    clear: none !important;

    position: static !important;

    white-space: nowrap !important;
    line-height: 1 !important;

    overflow: visible !important;

    flex: 0 0 auto !important;
}

#spr .gsr-fixed-star,
#spr_list .gsr-fixed-star {
    display: inline-block !important;

    width: 1em !important;
    min-width: 1em !important;
    max-width: 1em !important;

    height: 1em !important;
    min-height: 1em !important;
    max-height: 1em !important;

    margin: 0 !important;
    padding: 0 !important;

    flex: 0 0 1em !important;

    position: static !important;
    inset: auto !important;

    transform: none !important;

    overflow: visible !important;

    font-family: "Material Icons" !important;
    font-size: 1em !important;
    font-style: normal !important;
    font-weight: normal !important;

    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-indent: 0 !important;

    vertical-align: middle !important;
}

#spr .gsr-fixed-star-full,
#spr .gsr-fixed-star-half,
#spr_list .gsr-fixed-star-full,
#spr_list .gsr-fixed-star-half {
    color: #FFD000 !important;
}

#spr .gsr-fixed-star-empty,
#spr_list .gsr-fixed-star-empty {
    color: #c4c4c4 !important;
}

/* Les icônes sont déjà présentes directement dans le HTML. */
#spr .gsr-fixed-star::before,
#spr_list .gsr-fixed-star::before {
    content: none !important;
    display: none !important;
}


/* =========================================================
   PAGES LISTES PRODUITS
   Compatible avec le wrapper personnalisé du thème :
   .product-brand-reviews = marque à gauche / avis à droite
   ========================================================= */

/* La marque reste à gauche, le résumé des avis occupe le reste de la ligne. */
.product-miniature .product-brand-reviews {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    width: 100% !important;
    gap: 6px !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
}

.product-miniature .product-brand-reviews .product-brand {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

.product-miniature .product-brand-reviews .product-list-reviews {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* IMPORTANT : ne surtout pas mettre width/min-width:100% ici.
   Le bloc est dans la 2e colonne de la grille marque/avis. */
.product-miniature .product-list-reviews #spr_list.gsr-list-review-summary,
.product-miniature #spr_list.gsr-list-review-summary {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;
    gap: 3px !important;

    float: none !important;
    clear: none !important;
    position: static !important;

    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.product-miniature #spr_list .gsr-list-review-stars {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;

    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;

    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 1px !important;

    flex: 0 0 auto !important;
    float: none !important;
    clear: none !important;
    position: static !important;

    white-space: nowrap !important;
    overflow: visible !important;
}

.product-miniature #spr_list .gsr-list-review-meta,
.product-miniature #spr_list .average_text_container {
    display: inline-flex !important;
    align-items: center !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;

    flex: 0 1 auto !important;
    float: none !important;
    clear: none !important;
    position: static !important;

    white-space: nowrap !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.product-miniature #spr_list .average_text {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;

    /* La taille reste celle définie dans le BO du module. */
    line-height: 1 !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #666 !important;
    font-weight: 400 !important;
}

/* Le thème avait historiquement une hauteur fixe de 110 px.
   On ne la modifie plus ici : cela évite de déplacer les éléments de la carte. */

/* =========================================================
   FICHE PRODUIT
   étoiles | 4,6/5 | 57 notes | Lire les avis
   ========================================================= */

#spr.gsr-product-summary {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    flex-direction: row !important;
    flex-wrap: nowrap !important;

    gap: 0 !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    margin: 10px 0 !important;
    padding: 0 !important;

    float: none !important;
    clear: both !important;

    position: relative !important;

    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;

    overflow: visible !important;
}

#spr.gsr-product-summary .gsr-product-summary-stars {
    display: inline-flex !important;

    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;

    height: auto !important;

    margin: 0 10px 0 0 !important;
    padding: 0 !important;

    flex: 0 0 auto !important;

    position: static !important;

    overflow: visible !important;
}

#spr.gsr-product-summary .gsr-product-summary-info {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    flex-direction: row !important;
    flex-wrap: wrap !important;

    gap: 4px 7px !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;

    flex: 1 1 auto !important;

    position: static !important;

    overflow: visible !important;
}

#spr.gsr-product-summary .gsr-product-summary-score {
    display: inline-block !important;

    margin: 0 !important;
    padding: 0 !important;

    position: static !important;

    font-size: 14px !important;
    font-weight: 700 !important;

    color: #333 !important;

    line-height: 1.2 !important;

    white-space: nowrap !important;
}

#spr.gsr-product-summary .gsr-product-summary-count {
    display: inline-block !important;

    margin: 0 !important;
    padding: 0 !important;

    position: static !important;

    font-size: 13px !important;
    font-weight: 400 !important;

    color: #777 !important;

    line-height: 1.2 !important;

    white-space: nowrap !important;
}

#spr.gsr-product-summary .gsr-product-summary-link {
    display: inline-block !important;

    margin: 0 !important;
    padding: 0 !important;

    position: static !important;

    font-size: 13px !important;
    font-weight: 600 !important;

    color: inherit !important;

    line-height: 1.2 !important;

    text-decoration: underline !important;
    text-underline-offset: 2px !important;

    white-space: nowrap !important;
}


/* =========================================================
   ENTETE DE LA LISTE D'AVIS
   ========================================================= */

#spr .gsr-reviews-heading {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    gap: 12px !important;

    padding: 12px 0 !important;
}

#spr .gsr-reviews-heading > * {
    flex: initial !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
}

#spr .gsr-reviews-heading h4 {
    margin: 0 !important;
}

#spr .gsr-reviews-heading-stars {
    flex: 0 0 auto !important;
}

#spr .gsr-reviews-moderation {
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #777 !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 767px) {
    #spr.gsr-product-summary {
        flex-wrap: wrap !important;
        row-gap: 6px !important;
    }

    #spr.gsr-product-summary .gsr-product-summary-stars {
        margin-right: 8px !important;
    }
}

@media (max-width: 575px) {
    #spr_list.gsr-list-review-summary {
        flex-wrap: wrap !important;
        gap: 3px 5px !important;
    }

    #spr.gsr-product-summary {
        align-items: flex-start !important;
    }

    #spr .gsr-reviews-heading {
        align-items: flex-start !important;
        flex-direction: column !important;
    }
}

/* =========================================================
   ELI V4 - AJUSTEMENT LISTES ACCUEIL
   - avis légèrement plus grands
   - réserve 4 lignes au titre pour éviter le chevauchement prix
   ========================================================= */

/* Un peu plus lisible que les 9 px du réglage actuel, sans grossir la carte. */
body#index .product-miniature #spr_list .gsr-fixed-star {
    font-size: 10px !important;
}

body#index .product-miniature #spr_list .average_text {
    font-size: 10px !important;
    line-height: 1.1 !important;
}

/* Sur l'accueil, le thème réserve trop peu de hauteur au titre.
   On garde toutes les cartes alignées et on empêche le titre de descendre sur le prix. */
body#index .product-miniature .product-title {
    display: block !important;
    height: 5.2em !important;
    min-height: 5.2em !important;
    max-height: 5.2em !important;
    margin: 4px 0 6px !important;
    overflow: hidden !important;
}

body#index .product-miniature .product-title > a {
    display: -webkit-box !important;
    line-height: 1.3em !important;
    max-height: 5.2em !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 4 !important;
}

/* Le conteneur description doit pouvoir suivre la hauteur réelle du contenu. */
body#index .product-miniature .product-description {
    height: auto !important;
    min-height: 150px !important;
    max-height: none !important;
    overflow: visible !important;
}


/* =========================================================
   ELI V5 - LISTES PRODUITS : VERSION STABLE
   Marque sur une ligne, avis sur la ligne suivante.
   Evite tout chevauchement marque/avis/titre/prix.
   ========================================================= */

body#index .product-miniature .product-brand-reviews,
body#category .product-miniature .product-brand-reviews {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;

    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px !important;

    gap: 3px !important;
    margin: 0 0 5px !important;
    padding: 0 !important;

    overflow: visible !important;
}

body#index .product-miniature .product-brand-reviews .product-brand,
body#category .product-miniature .product-brand-reviews .product-brand {
    display: block !important;

    width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    text-align: left !important;
    white-space: nowrap !important;

    line-height: 1.15 !important;
}

body#index .product-miniature .product-brand-reviews .product-list-reviews,
body#category .product-miniature .product-brand-reviews .product-list-reviews {
    display: block !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: visible !important;
}

body#index .product-miniature #spr_list.gsr-list-review-summary,
body#category .product-miniature #spr_list.gsr-list-review-summary {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;

    align-items: center !important;
    justify-content: flex-start !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    height: 14px !important;
    min-height: 14px !important;
    max-height: 14px !important;

    margin: 0 !important;
    padding: 0 !important;

    gap: 4px !important;

    position: static !important;
    float: none !important;
    clear: both !important;

    overflow: visible !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

body#index .product-miniature #spr_list .gsr-list-review-stars,
body#category .product-miniature #spr_list .gsr-list-review-stars {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    flex: 0 0 auto !important;

    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    gap: 1px !important;

    overflow: visible !important;
}

body#index .product-miniature #spr_list .gsr-fixed-star,
body#category .product-miniature #spr_list .gsr-fixed-star {
    font-size: 11px !important;
    line-height: 1 !important;
}

body#index .product-miniature #spr_list .gsr-list-review-meta,
body#index .product-miniature #spr_list .average_text_container,
body#category .product-miniature #spr_list .gsr-list-review-meta,
body#category .product-miniature #spr_list .average_text_container {
    display: inline-flex !important;
    align-items: center !important;

    flex: 0 0 auto !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: visible !important;
}

body#index .product-miniature #spr_list .average_text,
body#category .product-miniature #spr_list .average_text {
    display: inline !important;

    font-size: 11px !important;
    line-height: 1 !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #666 !important;

    white-space: nowrap !important;
    overflow: visible !important;
}

/* Le titre garde une place stable, sans jamais tomber sur le prix. */
body#index .product-miniature .product-title,
body#category .product-miniature .product-title {
    display: block !important;

    height: 3.9em !important;
    min-height: 3.9em !important;
    max-height: 3.9em !important;

    margin: 4px 0 7px !important;

    overflow: hidden !important;
}

body#index .product-miniature .product-title > a,
body#category .product-miniature .product-title > a {
    display: -webkit-box !important;

    line-height: 1.3em !important;
    max-height: 3.9em !important;

    overflow: hidden !important;

    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
}

/* Annule la réserve excessive de la V4.
   Le prix suit désormais naturellement le contenu réel. */
body#index .product-miniature .product-description,
body#category .product-miniature .product-description {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    overflow: visible !important;
}

/* Petit espace propre avant le bloc prix/bouton. */
body#index .product-miniature .product-bottom,
body#category .product-miniature .product-bottom {
    clear: both !important;
    margin-top: 2px !important;
}
