/**
 * Styles des widgets Elementor (Note globale + Section avis / carousel).
 * S'appuie sur widget.css (classes .grw-*) et se limite aux ajouts Elementor.
 */

/* ------------------------------------------------------------------ */
/* Widget « Note globale »                                            */
/* ------------------------------------------------------------------ */
.grw-el-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
}

.grw-el-rating .grw-aggregate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grw-el-rating .grw-rating-suffix {
    font-size: 0.6em;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 0.1em;
}

/* ------------------------------------------------------------------ */
/* Widget « Section avis » : carousel                                 */
/* ------------------------------------------------------------------ */
.grw-el-reviews {
    margin: 0;
}

.grw-carousel {
    --grw-slides: 3;
    --grw-gap: 16px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.grw-carousel-track {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: var(--grw-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;         /* Firefox */
    padding-bottom: 2px;           /* évite un clipping des ombres */
}

.grw-carousel-track::-webkit-scrollbar {
    display: none;                  /* WebKit */
}

.grw-carousel-slide {
    scroll-snap-align: start;
    flex: 0 0 calc((100% - (var(--grw-slides) - 1) * var(--grw-gap)) / var(--grw-slides));
    box-sizing: border-box;
    /* Réinitialise la marge héritée de .grw-review si besoin */
    margin: 0;
}

/* La carte remplit toute la hauteur de la slide pour un rendu homogène */
.grw-carousel-slide {
    display: flex;
    flex-direction: column;
}

/* Flèches */
.grw-carousel-arrow {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--grw-border-color, #e5e7eb);
    border-radius: 50%;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.grw-carousel-arrow:hover {
    background: #f9fafb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.grw-carousel-arrow:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.grw-carousel-arrow[disabled] {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

.grw-carousel-arrow svg {
    width: 24px;
    height: 24px;
}

/* Piste focus visible pour l'accessibilité clavier */
.grw-carousel-track:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
    border-radius: 4px;
}

/* En-tête : léger espacement avant le carousel */
.grw-el-reviews .grw-header {
    margin-bottom: 1rem;
}

.grw-el-reviews .grw-footer {
    justify-content: flex-end;
}

/* Sur mobile, on masque les flèches si la place manque (le swipe reste dispo) */
@media (max-width: 480px) {
    .grw-carousel {
        gap: 0.25rem;
    }
    .grw-carousel-arrow {
        width: 34px;
        height: 34px;
    }
}

/* Respect de prefers-reduced-motion : pas de scroll animé */
@media (prefers-reduced-motion: reduce) {
    .grw-carousel-track {
        scroll-behavior: auto;
    }
}

/* ------------------------------------------------------------------ */
/* Effets & transitions (v1.5.0)                                      */
/* ------------------------------------------------------------------ */

/* Survol des cartes : élévation + ombre */
.grw-fx-hover .grw-review {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
}
.grw-fx-hover .grw-review:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* Apparition des cartes (fondu + léger glissement) */
.grw-fx-reveal .grw-carousel-slide {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.grw-fx-reveal .grw-carousel-slide.grw-in {
    opacity: 1;
    transform: none;
}

/* Mise en avant de la carte active (zoom léger, type coverflow) */
.grw-fx-zoom .grw-carousel-slide {
    transform: scale(0.9);
    opacity: 0.6;
    transition: transform 0.35s ease, opacity 0.35s ease;
}
.grw-fx-zoom .grw-carousel-slide.grw-active {
    transform: scale(1);
    opacity: 1;
}
/* Le zoom et le fondu peuvent se cumuler : la carte visible ET active */
.grw-fx-zoom.grw-fx-reveal .grw-carousel-slide.grw-in {
    opacity: 0.6;
}
.grw-fx-zoom.grw-fx-reveal .grw-carousel-slide.grw-in.grw-active {
    opacity: 1;
}

/* Respect de prefers-reduced-motion : pas d'animation d'effet */
@media (prefers-reduced-motion: reduce) {
    .grw-fx-hover .grw-review,
    .grw-fx-reveal .grw-carousel-slide,
    .grw-fx-zoom .grw-carousel-slide {
        transition: none;
    }
    .grw-fx-reveal .grw-carousel-slide {
        opacity: 1;
        transform: none;
    }
    .grw-fx-zoom .grw-carousel-slide {
        transform: none;
        opacity: 1;
    }
}
