/* =====================================================================
   Module AVIS (clients) - base CSS commune. Moderne, sobre, responsive.
   THEMING : surcharger --rev-* (ex .reviews { --rev-accent: #c0392b; }).
   ===================================================================== */
.reviews {
    --rev-accent: #16202e;
    --rev-ink: #14181f;
    --rev-body: #3a4150;
    --rev-muted: #828a99;
    --rev-soft: #f4f6fa;          /* fonds gris leger */
    --rev-card: #ffffff;          /* cartes */
    --rev-star: #f5b50a;          /* etoiles pleines */
    --rev-star-off: #d7dbe3;      /* etoiles vides */
    --rev-radius: 16px;
    --rev-shadow: 0 1px 2px rgba(20, 24, 31, .04), 0 12px 30px -18px rgba(20, 24, 31, .26);
    --rev-shadow-hover: 0 2px 4px rgba(20, 24, 31, .05), 0 20px 44px -20px rgba(20, 24, 31, .34);
    --rev-font: inherit;
    --rev-maxw: 1100px;

    font-family: var(--rev-font); color: var(--rev-body);
    max-width: var(--rev-maxw); margin-inline: auto;
}
.reviews *, .reviews *::before, .reviews *::after { box-sizing: border-box; }

/* Etoiles (affichage) */
.reviews-stars { display: inline-flex; gap: 2px; line-height: 1; white-space: nowrap; }
.reviews-stars .star { color: var(--rev-star-off); font-size: 1.05rem; }
.reviews-stars .star.is-on { color: var(--rev-star); }
.reviews-stars.stars-lg .star { font-size: 1.5rem; }

/* En-tete : note globale + repartition */
.reviews-head {
    display: flex; align-items: center; gap: clamp(24px, 5vw, 64px); flex-wrap: wrap;
    background: var(--rev-soft); border-radius: calc(var(--rev-radius) + 4px);
    padding: clamp(22px, 4vw, 38px); margin: 0 0 38px;
}
.reviews-score-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.reviews-score-big { font-size: clamp(3rem, 8vw, 4rem); font-weight: 800; color: var(--rev-ink); line-height: 1; letter-spacing: -.03em; }
.reviews-score-big small { font-size: 1.2rem; font-weight: 600; color: var(--rev-muted); }
.reviews-count { color: var(--rev-muted); font-size: .95rem; }
.reviews-bars { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.reviews-bar { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--rev-muted); }
.reviews-bar-label { width: 28px; color: var(--rev-ink); font-weight: 600; white-space: nowrap; }
.reviews-bar-track { flex: 1; height: 8px; border-radius: 999px; background: rgba(20, 24, 31, .08); overflow: hidden; }
.reviews-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--rev-star); }
.reviews-bar-count { width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

/* Message de confirmation */
.reviews-flash { background: #e8f5ec; color: #1b5e20; padding: 14px 18px; border-radius: var(--rev-radius); margin: 0 0 24px; font-weight: 600; }

/* Disposition : formulaire (gauche, accessible direct) + liste (droite) */
.reviews-layout { display: grid; grid-template-columns: 360px 1fr; gap: 32px; align-items: start; }

/* Formulaire */
.review-form-wrap {
    position: sticky; top: 24px;
    background: var(--rev-card); border-radius: calc(var(--rev-radius) + 2px);
    padding: 28px; box-shadow: var(--rev-shadow);
}
.review-form-title { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; color: var(--rev-ink); }
.review-form-sub { margin: 0 0 22px; color: var(--rev-muted); font-size: .92rem; }
.review-form .form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.review-form .form-label { font-weight: 600; color: var(--rev-ink); }
.review-form input[type="text"], .review-form textarea {
    width: 100%; padding: 12px 14px; font: inherit; font-size: 16px;
    border: 0; border-radius: 11px; background: var(--rev-soft); color: var(--rev-ink);
}
.review-form input[type="text"]:focus, .review-form textarea:focus {
    outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--rev-accent) 16%, transparent);
}
.review-form textarea { resize: vertical; min-height: 110px; }
.rv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Notation par etoiles (radios inverses) */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-input label { font-size: 2rem; line-height: 1; color: var(--rev-star-off); cursor: pointer; transition: color .12s ease; }
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: var(--rev-star); }
.star-input input:focus-visible + label { outline: 2px solid var(--rev-accent); outline-offset: 3px; border-radius: 4px; }

.rv-consent { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--rev-body); margin: 4px 0 18px; cursor: pointer; }
.rv-consent input { margin-top: 3px; flex: 0 0 auto; }
.review-submit {
    width: 100%; appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem;
    color: #fff; background: var(--rev-accent); padding: 14px 26px; border-radius: 999px; transition: filter .15s ease;
}
.review-submit:hover { filter: brightness(1.12); }
.form-error { color: #c0392b; font-size: .88rem; }

/* Liste des avis */
.reviews-main { min-width: 0; }
.reviews-main-title { margin: 0 0 18px; font-size: 1.15rem; font-weight: 700; color: var(--rev-ink); }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.review {
    background: var(--rev-card); border-radius: var(--rev-radius); padding: 24px 22px 20px;
    display: flex; flex-direction: column; gap: 13px; box-shadow: var(--rev-shadow);
    transition: box-shadow .2s ease;
}
.review:hover { box-shadow: var(--rev-shadow-hover); }
.review-text { margin: 0; color: var(--rev-body); line-height: 1.6; }
.review-meta { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.review-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
    font-weight: 700; font-size: .92rem; color: var(--rev-accent);
    background: color-mix(in srgb, var(--rev-accent) 12%, #fff);
}
.review-meta-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.review-author { font-weight: 700; color: var(--rev-ink); }
.review-meta time { color: var(--rev-muted); font-size: .82rem; }
.reviews-empty { grid-column: 1 / -1; color: var(--rev-muted); padding: 24px 0; }

/* Mode Google : bloc lateral d'en-tete (badge + CTA), liste en pleine largeur */
.reviews-head-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.reviews-google-badge { display: inline-flex; align-items: center; gap: 10px; color: var(--rev-muted); font-size: .92rem; font-weight: 600; }
.review-google-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; width: auto; }
.reviews-main-full { width: 100%; }
/* Disposition bento (masonry) : chaque carte garde sa hauteur naturelle */
.reviews-google .reviews-grid { display: block; column-count: 3; column-gap: 18px; }
.reviews-google .reviews-grid .review { break-inside: avoid; margin: 0 0 18px; }
@media (max-width: 980px) { .reviews-google .reviews-grid { column-count: 2; } }
@media (max-width: 600px) { .reviews-google .reviews-grid { column-count: 1; } }
.review-avatar-img { object-fit: cover; padding: 0; }
.reviews-google-all { margin: 20px 0 0; }
.reviews-google-all a { color: var(--rev-accent); font-weight: 600; text-decoration: none; }
.reviews-google-all a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 860px) {
    .reviews-layout { grid-template-columns: 1fr; gap: 28px; }
    .review-form-wrap { position: static; }
}
@media (max-width: 600px) {
    .reviews-grid { grid-template-columns: 1fr; }
    .reviews-head { gap: 22px; }
    .reviews-score-block { align-items: flex-start; }
    .review-form-wrap { padding: 22px; }
}
