/**
 * h2jreviews-product.css - Sprint 5 v1.0.27 page produit
 *
 * Scope : .h2jrp-* (h2j reviews product) -- isole des autres CSS h2jreviews.
 *
 * 2 zones :
 *   1. .cubx-pp__stars -- grosses etoiles sous titre produit (CUBX product.tpl)
 *   2. .h2jrp-block   -- bloc reviews bas de fiche (hookDisplayProductComments)
 *
 * Modele etoile (v1.0.27) :
 *   - 1 etoile plain SVG 5 branches, identique partout
 *   - Fond optionnel derriere l'etoile : circle / square / round / aucun
 *   - 2 couleurs configurables : etoile (--h2jrp-star-color) + fond (--h2jrp-star-bg-color)
 *   - Etat empty : fond preserve (en couleur normale) + etoile grisee
 *
 * Variables CSS (override inline depuis hookActionFrontControllerSetMedia) :
 *   --h2jrp-star-color    : couleur etoile pleine. Default #f5a623.
 *   --h2jrp-star-bg-color : couleur fond pleine. Default #fff8e7.
 *   --h2jrp-star-empty    : couleur etoile vide (grise). Default #d0d0d0.
 *   --h2jrp-star-bg-empty : couleur fond vide (gris doux). Default #f0f0f0.
 *   --h2jrp-star-size     : taille en px. Default 26px (impactant).
 *
 * @since v1.0.18 (Sprint 3), refonte v1.0.27 (Sprint 5)
 */

.h2jrp-block,
.cubx-pp__stars {
    --h2jrp-star-color: #f5a623;
    --h2jrp-star-bg-color: #fff8e7;
    --h2jrp-star-empty: #d0d0d0;
    --h2jrp-star-bg-empty: #f0f0f0;
    --h2jrp-star-size: 26px;
    --h2jrp-star-size-small: 18px;
}

/* ============================================================
   1. ETOILES SVG (v1.0.27)
   Modele unique : 1 SVG par etoile, contenant un fond optionnel
   (.h2jrp-bg) + l'etoile plain 5 branches (.h2jrp-fg).
   ============================================================ */

svg.h2jrp-star {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    overflow: visible;
}

/* Taille par contexte (heritage via font-size, classes parentes) */
.cubx-pp__stars,
.h2jrp-block__stars-wrap {
    font-size: var(--h2jrp-star-size);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}
.h2jrp-review__stars {
    font-size: var(--h2jrp-star-size-small);
    display: inline-flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
}

/* --- ETAT FULL : fond + etoile colores --- */
svg.h2jrp-star--full .h2jrp-bg {
    fill: var(--h2jrp-star-bg-color);
}
svg.h2jrp-star--full .h2jrp-fg {
    fill: var(--h2jrp-star-color);
}

/* --- ETAT EMPTY : fond grise + etoile grisee --- */
svg.h2jrp-star--empty .h2jrp-bg {
    fill: var(--h2jrp-star-bg-empty);
}
svg.h2jrp-star--empty .h2jrp-fg {
    fill: var(--h2jrp-star-empty);
}

/* --- ETAT HALF : fond plein + etoile = empty grise sous full coloree clipee gauche --- */
svg.h2jrp-star--half .h2jrp-bg {
    fill: var(--h2jrp-star-bg-color);
}
svg.h2jrp-star--half .h2jrp-fg--empty {
    fill: var(--h2jrp-star-empty);
}
svg.h2jrp-star--half .h2jrp-fg--full {
    fill: var(--h2jrp-star-color);
}

/* ============================================================
   2. BLOC REVIEWS BAS -- rendu par hookDisplayProductComments
   ============================================================ */

.h2jrp-block {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 8px;
}

.h2jrp-block__header {
    display: flex;
    align-items: stretch;
    gap: 24px;
    flex-wrap: nowrap;
    /* v1.0.78 -- Pas de border-bottom ici. Le trait est porte par .summary
       uniquement pour ne pas couper le logo Panther qui occupe les 2 lignes. */
    padding-bottom: 0;
    border-bottom: none;
    /* v1.0.78 update -- Le logo passe a gauche pour faire bloc avec stars+score
       (doctrine David 25/05/2026 : eviter le vide visuel au milieu). On utilise
       flex order : logo (order 1) puis summary (order 2), donc visuellement :
       [LOGO] [STARS / SCORE]. Le DOM reste inchange (logo apres summary), ce qui
       garde l'accessibilite logique (info principale d'abord pour les lecteurs
       d'ecran). */
}

/* v1.0.78 -- Wrapper du header gauche : stars (ligne 1) + score (ligne 2).
   Porte le border-bottom pour le trait separateur, qui s'arrete naturellement
   a la largeur du wrapper (donc ne traverse pas le logo). */
.h2jrp-block__summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    /* v1.0.78 update -- flex:0 1 auto au lieu de 1 1 auto. Le bloc summary
       ne prend QUE la largeur de son contenu (stars+score), pas tout l'espace
       restant. Resultat : logo et summary forment un bloc compact a gauche,
       le trait separateur s'arrete a la largeur du summary, et l'espace a
       droite reste vide (acceptable, plus harmonieux qu'un vide au milieu). */
    flex: 0 1 auto;
    min-width: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    order: 2;
}

.h2jrp-block__stars-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.h2jrp-block__score {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.h2jrp-block__avg {
    font-weight: 700;
}

.h2jrp-block__scale {
    color: #888;
    font-weight: 400;
    font-size: 18px;
}

/* v1.0.78 -- Logo Panther Reviews grand format A GAUCHE du header card.
   Doctrine David 25/05/2026 : forme un bloc visuel coherent avec stars+score
   au lieu de creer un vide au milieu. Sceau LISIBLE (on doit lire "Panther
   Reviews"), occupe la hauteur des 2 lignes (stars + score). Cliquable vers
   /avis-boutique. Pas de border-bottom : le trait separateur est porte
   uniquement par .summary (sibling) donc s'arrete avant le logo et ne le
   coupe pas. flex order: 1 => visuellement a gauche meme si dans le DOM apres. */
.h2jrp-block__provider {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0.92;
    transition: opacity 0.15s ease, transform 0.15s ease;
    text-decoration: none;
    line-height: 0;
    order: 1;
}
.h2jrp-block__provider:hover,
.h2jrp-block__provider:focus {
    opacity: 1;
    transform: scale(1.04);
    text-decoration: none;
}
.h2jrp-block__provider-logo {
    /* Hauteur generee dynamiquement pour matcher la double ligne stars+score.
       Sur desktop : env. 64-70px (stars ~26px + gap 6px + score ~30px line-height).
       max-width genereux pour permettre le ratio naturel d'un logo type
       Trustpilot (180x40 ou similaire). */
    height: 64px;
    width: auto;
    max-width: 220px;
    display: block;
    object-fit: contain;
}

/* ===== LISTE D'AVIS ===== */

.h2jrp-block__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.h2jrp-review {
    padding: 14px 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.h2jrp-review--hidden {
    display: none;
}

.h2jrp-review__header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.h2jrp-review__stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.h2jrp-review__author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
}

.h2jrp-review__name {
    font-weight: 600;
    color: #1a1a1a;
}

.h2jrp-review__verified {
    display: inline-flex;
    align-items: center;
    color: #4caf50;
}

.h2jrp-review__verified .material-icons {
    font-size: 16px;
}

.h2jrp-review__date {
    color: #888;
    font-size: 13px;
}

.h2jrp-review__title {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.h2jrp-review__content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* v1.0.78 -- Reponse marchand (.answer) en dessous de l'avis customer.
   Style retenu (doctrine David 25/05/2026) : tres discret, italique gris,
   indente avec une fleche curve, pas d'encadre, pas de date.
   Pattern Trustpilot-style epure mais sans la lourdeur visuelle du fond colore. */
.h2jrp-review__answer {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-left: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #666;
}
.h2jrp-review__answer-arrow {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.4;
    color: #aaa;
    font-style: normal;
    margin-top: 1px;
}
.h2jrp-review__answer-body {
    flex: 1;
    min-width: 0;
    font-style: italic;
    color: #666;
    word-wrap: break-word;
}
.h2jrp-review__answer-label {
    font-style: normal;
    font-weight: 600;
    color: #555;
    margin-right: 2px;
}

/* v1.0.32 -- Label "Acheteur vérifié suite expérience du JJ/MM/AAAA".
   Doctrine anonymisation H2J : tous les avis customer affichent ce label
   unifié en bas de la card. Coherent avec page boutique. */
.h2jrp-review__verified-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    color: #666;
    font-size: 12px;
    font-weight: 500;
}
.h2jrp-review__verified-label .material-icons {
    font-size: 14px;
    color: var(--h2jrp-star-color, #f5a623);
}

/* ===== BOUTON TOGGLE VOIR PLUS / VOIR MOINS (v1.0.28) ===== */
/* Style CUBX : square rounded (border-radius 6px), bordure discrete,
   icone Material + label. Toggle via data-state attribute. */

.h2jrp-block__toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.h2jrp-block__toggle-btn:hover {
    background: #fafafa;
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.h2jrp-block__toggle-btn:focus {
    outline: none;
    border-color: var(--h2jrp-star-color, #f5a623);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.h2jrp-block__toggle-btn .material-icons {
    font-size: 18px;
    margin-right: 6px;
}

.h2jrp-toggle__when-collapsed,
.h2jrp-toggle__when-expanded {
    display: inline-flex;
    align-items: center;
}

/* Etat collapsed : affiche 'Voir les X autres avis', cache 'Voir moins' */
.h2jrp-block__toggle-btn[data-state="collapsed"] .h2jrp-toggle__when-expanded {
    display: none;
}
.h2jrp-block__toggle-btn[data-state="expanded"] .h2jrp-toggle__when-collapsed {
    display: none;
}

/* ============================================================
   3. RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
    .h2jrp-block,
    .cubx-pp__stars {
        --h2jrp-star-size: 22px;
        --h2jrp-star-size-small: 16px;
    }
    /* v1.0.78 -- Mobile : header garde le layout row mais avec un logo
       proportionne (plus petit mais toujours lisible, ~48-52px de haut). */
    .h2jrp-block__header {
        gap: 12px;
    }
    .h2jrp-block__summary {
        gap: 4px;
        padding-bottom: 12px;
    }
    .h2jrp-block__provider-logo {
        height: 48px;
        max-width: 160px;
    }
}

@media (max-width: 380px) {
    /* Tres petit ecran : logo encore reduit pour rester confortable. */
    .h2jrp-block__provider-logo {
        height: 40px;
        max-width: 130px;
    }
}

/* ============================================================
   4. v1.0.62 -- BLOC EXPERT REVIEW SUR FICHE PRODUIT
   Rendu par hookDisplayProductComments AVANT le bloc client.
   Scope BEM : .h2jr-product-expert-* (distinct du .h2jrp-* customer)
   ============================================================ */

.h2jr-product-expert-block {
    margin: 8px 0 24px;
    padding: 0;
}
.h2jr-product-expert-block__head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cubx-border, #e9d5ff);
}
.h2jr-product-expert-block__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--cubx-text, #2d1b4e);
    letter-spacing: -0.01em;
}
.h2jr-product-expert-block__title .material-icons {
    color: #8e44ad;
    font-size: 26px;
}

/* CARD : layout 2 colonnes media + body */
.h2jr-product-expert-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 24px;
    align-items: flex-start;
    padding: 24px;
    background: linear-gradient(135deg, #fff 0%, #faf5ff 100%);
    border: 1px solid var(--cubx-border, #e9d5ff);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(91, 44, 131, 0.08);
}
.h2jr-product-expert-card--ai {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

/* MEDIA : photo + badge AI */
.h2jr-product-expert-card__media {
    flex-shrink: 0;
}
.h2jr-product-expert-card__photo-link {
    position: relative;
    display: block;
    width: 140px;
    height: 140px;
    text-decoration: none;
}
.h2jr-product-expert-card__photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(91, 44, 131, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.h2jr-product-expert-card__photo-link:hover .h2jr-product-expert-card__photo,
.h2jr-product-expert-card__photo-link:hover .h2jr-product-expert-card__avatar-fallback {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(91, 44, 131, 0.25);
}
.h2jr-product-expert-card__avatar-fallback {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #8e44ad 0%, #5b2c83 100%);
    box-shadow: 0 4px 16px rgba(91, 44, 131, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.h2jr-product-expert-card__ai-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #8e44ad 0%, #5b2c83 100%);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(91, 44, 131, 0.3);
}
.h2jr-product-expert-card__ai-badge .material-icons {
    font-size: 12px;
}

/* BODY : identite + extrait + cta */
.h2jr-product-expert-card__body {
    min-width: 0;
}
.h2jr-product-expert-card__identity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.h2jr-product-expert-card__name {
    font-size: 18px;
    font-weight: 700;
    color: var(--cubx-text, #2d1b4e);
    text-decoration: none;
    transition: color 0.15s ease;
}
.h2jr-product-expert-card__name:hover {
    color: #8e44ad;
    text-decoration: underline;
}
.h2jr-product-expert-card__job {
    font-size: 13px;
    color: var(--cubx-text-muted, #6b6779);
    font-weight: 500;
}
.h2jr-product-expert-card__job::before {
    content: "•";
    margin-right: 8px;
    color: #c4b5d4;
}
.h2jr-product-expert-card__rating {
    margin-left: auto;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 999px;
    color: #92400e;
    font-weight: 700;
}
.h2jr-product-expert-card__rating .material-icons {
    font-size: 16px;
    color: #f5a623;
    align-self: center;
}
.h2jr-product-expert-card__rating-value {
    font-size: 14px;
}
.h2jr-product-expert-card__rating-max {
    font-size: 11px;
    opacity: 0.7;
}

/* TITRE REVIEW */
.h2jr-product-expert-card__review-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--cubx-text, #2d1b4e);
    margin: 0 0 10px;
    line-height: 1.3;
}
.h2jr-product-expert-card__ai-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: linear-gradient(135deg, #8e44ad 0%, #5b2c83 100%);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.h2jr-product-expert-card__ai-label .material-icons {
    font-size: 12px;
}

/* EXCERPT */
.h2jr-product-expert-card__excerpt {
    font-size: 14px;
    line-height: 1.65;
    color: var(--cubx-text, #2d1b4e);
    margin-bottom: 16px;
}

/* CTA */
.h2jr-product-expert-card__cta-row {
    margin-top: auto;
}
.h2jr-product-expert-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8e44ad 0%, #5b2c83 100%);
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(91, 44, 131, 0.25);
}
.h2jr-product-expert-card__cta:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(91, 44, 131, 0.35);
}
.h2jr-product-expert-card__cta .material-icons {
    font-size: 18px;
    transition: transform 0.15s ease;
}
.h2jr-product-expert-card__cta:hover .material-icons {
    transform: translateX(3px);
}

/* RESPONSIVE bloc expert */
@media (max-width: 640px) {
    .h2jr-product-expert-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 20px;
        gap: 16px;
    }
    .h2jr-product-expert-card__photo-link,
    .h2jr-product-expert-card__photo,
    .h2jr-product-expert-card__avatar-fallback {
        width: 110px;
        height: 110px;
        font-size: 40px;
        margin: 0 auto;
    }
    .h2jr-product-expert-card__media {
        display: flex;
        justify-content: center;
    }
    .h2jr-product-expert-card__identity {
        justify-content: center;
    }
    .h2jr-product-expert-card__rating {
        margin-left: 0;
    }
    .h2jr-product-expert-card__review-title {
        justify-content: center;
    }
}

/* ============================================================ */
/* v1.0.85 Sprint Traductions Phase 1 -- Badge + toggle avis    */
/* Pattern : 2 versions DOM (translated + original), bascule    */
/* via classes .is-translated / .is-original sur le <li>.       */
/* Conformite EU 2019/2161 : original immutable accessible.     */
/* ============================================================ */

.h2jrp-review__trad-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 10px;
    margin: 6px 0 10px;
    background: rgba(201, 184, 138, 0.08);
    border-left: 3px solid #c9b88a;
    border-radius: 4px;
    font-size: 12px;
    color: #6b6354;
    font-style: italic;
    line-height: 1.4;
}
.h2jrp-review__trad-badge-icon {
    font-size: 13px;
    font-style: normal;
    line-height: 1;
}
.h2jrp-review__trad-badge-text {
    flex: 1;
    min-width: 0;
}
.h2jrp-review__trad-toggle {
    background: transparent;
    border: none;
    color: #8b572a;
    font-size: 12px;
    font-weight: 600;
    font-style: normal;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: background 0.15s ease;
}
.h2jrp-review__trad-toggle:hover {
    background: rgba(139, 87, 42, 0.1);
    text-decoration: none;
}
.h2jrp-review__trad-toggle:focus {
    outline: 2px solid #c9b88a;
    outline-offset: 1px;
}

/* Etat par defaut = .is-translated : afficher trans, cacher orig. */
.h2jrp-review.is-translated .h2jrp-review__title--orig,
.h2jrp-review.is-translated .h2jrp-review__content--orig,
.h2jrp-review.is-translated .h2jrp-review__answer--orig,
.h2jrp-review.is-translated .h2jrp-review__trad-badge-text--when-original,
.h2jrp-review.is-translated .h2jrp-review__trad-toggle-text--when-original {
    display: none;
}

/* Etat .is-original : afficher orig, cacher trans. */
.h2jrp-review.is-original .h2jrp-review__title--trans,
.h2jrp-review.is-original .h2jrp-review__content--trans,
.h2jrp-review.is-original .h2jrp-review__answer--trans,
.h2jrp-review.is-original .h2jrp-review__trad-badge-text--when-translated,
.h2jrp-review.is-original .h2jrp-review__trad-toggle-text--when-translated {
    display: none;
}

/* L'original a un style legerement different (italique) pour bien signaler */
.h2jrp-review.is-original .h2jrp-review__title--orig,
.h2jrp-review.is-original .h2jrp-review__content--orig {
    font-style: italic;
    opacity: 0.92;
}
.h2jrp-review.is-original .h2jrp-review__trad-badge {
    background: rgba(139, 87, 42, 0.08);
    border-left-color: #8b572a;
}
