/* ==============================================
   CLUST3R GOOGLE REVIEWS - STYLES CSS
   ============================================== */

/* Variables CSS pour la cohérence */
:root {
    --cgr-primary: #0073aa;
    --cgr-secondary: #ffc107;
    --cgr-success: #28a745;
    --cgr-text: #333;
    --cgr-text-light: #666;
    --cgr-text-muted: #999;
    --cgr-border: #ddd;
    --cgr-bg-light: #f8f9fa;
    --cgr-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --cgr-radius: 8px;
}

/* ==============================================
   STYLE CARROUSEL CHRYSTALE - FINAL CORRIGÉ
   ============================================== */

.cgr-style-carousel .cgr-widget-reviews {
    position: relative;
    overflow: visible;
    max-height: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
    text-align: center;
    margin: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cgr-style-carousel .cgr-carousel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
    padding: 0 60px;
    box-sizing: border-box;
}

.cgr-style-carousel .cgr-widget-review {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
}

.cgr-style-carousel .cgr-widget-review.cgr-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.cgr-style-carousel .cgr-widget-review.cgr-prev {
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
}

.cgr-style-carousel .cgr-widget-review.cgr-next {
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
}

/* Avatar circulaire */
.cgr-style-carousel .cgr-reviewer-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #B8860B;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin: 0 auto 25px;
    text-transform: uppercase;
    flex-shrink: 0;
    border: 3px solid #ddd;
}

.cgr-style-carousel .cgr-reviewer-avatar:empty::after {
    content: "";
}

/* Texte de l'avis */
.cgr-style-carousel .cgr-widget-comment {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    font-style: normal;
    margin: 0 0 25px;
    max-width: 400px;
    text-align: center;
    font-weight: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Nom de l'auteur */
.cgr-style-carousel .cgr-widget-author {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0 0 8px;
}

/* Date */
.cgr-style-carousel .cgr-review-date {
    font-size: 14px;
    color: #999;
    margin: 0;
    font-weight: normal;
}

/* Masquer les étoiles */
.cgr-style-carousel .cgr-widget-rating {
    display: none;
}

/* Contrôles de navigation */
.cgr-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: all 0.3s ease;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cgr-carousel-nav:hover {
    background: white;
    color: #333;
    border-color: #999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cgr-carousel-nav:focus {
    outline: none;
}

/* Flèche gauche */
.cgr-carousel-prev {
    left: -75px; /* ← 20px plus loin */
}

/* Flèche droite */
.cgr-carousel-next {
    right: -75px; /* ← 20px plus loin */
}

/* Indicateurs de pagination - POINTS RONDS FORCÉS */
.cgr-carousel-dots {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    height: auto !important; /* ← CORRECTION : hauteur automatique */
    width: 100%;
    padding: 0;
}

.cgr-carousel-dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important; /* ← CORRECTION : largeur minimale */
    min-height: 8px !important; /* ← CORRECTION : hauteur minimale */
    max-width: 8px !important; /* ← CORRECTION : largeur maximale */
    max-height: 8px !important; /* ← CORRECTION : hauteur maximale */
    border-radius: 50% !important;
    background: #ccc !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important; /* ← CORRECTION : pas de croissance */
    box-sizing: border-box !important;
    display: block !important;
    line-height: 1 !important; /* ← CORRECTION : hauteur de ligne */
    font-size: 0 !important; /* ← CORRECTION : pas de texte */
}

.cgr-carousel-dot.cgr-active {
    background: #4CAF50 !important;
    transform: scale(1.2) !important;
    width: 8px !important; /* ← CORRECTION : garder la taille lors du scale */
    height: 8px !important;
}

.cgr-carousel-dot:hover {
    background: #999 !important;
}

/* Masquer le header généré par le plugin */
.cgr-style-carousel .cgr-carousel-header {
    display: none !important;
}

.cgr-style-carousel .cgr-widget-header {
    display: none !important;
}

.cgr-style-carousel .cgr-widget-average {
    display: none !important;
}

.cgr-style-carousel .clust3r-average {
    display: none !important;
}

/* Container global - CENTRAGE PARFAIT */
.clust3r-reviews-container {
    margin: 0;
    overflow: visible;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    justify-content: center;
}
/* Responsive - CORRIGÉ */
@media (max-width: 768px) {
    .cgr-style-carousel .cgr-carousel-container {
        max-width: 100%;
        height: 280px;
        padding: 0 60px;
    }
    
    .cgr-style-carousel .cgr-widget-comment {
        font-size: 14px;
        max-width: 300px;
    }
    
    .cgr-style-carousel .cgr-reviewer-avatar {
        width: 70px;
        height: 70px;
        margin: 0 auto 20px;
    }
    
    .cgr-carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .cgr-carousel-prev {
        left: -5px;
    }
    
    .cgr-carousel-next {
        right: -5px;
    }
}

@media (max-width: 480px) {
    .cgr-style-carousel .cgr-carousel-container {
        height: 250px;
        padding: 0 45px;
    }
    
    .cgr-style-carousel .cgr-widget-comment {
        font-size: 13px;
        max-width: 250px;
    }
    
    .cgr-style-carousel .cgr-reviewer-avatar {
        width: 60px;
        height: 60px;
        margin: 0 auto 15px;
    }
    
    .cgr-carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .cgr-carousel-prev {
        left: -2px;
    }
    
    .cgr-carousel-next {
        right: -2px;
    }
}

@media (max-width: 380px) {
    .cgr-style-carousel .cgr-carousel-container {
        height: 220px;
        padding: 0 35px;
    }
    
    .cgr-style-carousel .cgr-widget-comment {
        font-size: 12px;
        max-width: 200px;
    }
    
    .cgr-style-carousel .cgr-reviewer-avatar {
        width: 50px;
        height: 50px;
        margin: 0 auto 12px;
    }
    
    .cgr-carousel-nav {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .cgr-carousel-prev {
        left: 0;
    }
    
    .cgr-carousel-next {
        right: 0;
    }
}

@media (max-width: 320px) {
    .cgr-style-carousel .cgr-carousel-container {
        height: 200px;
        padding: 0 30px;
    }
    
    .cgr-style-carousel .cgr-widget-comment {
        font-size: 11px;
        max-width: 180px;
    }
    
    .cgr-style-carousel .cgr-widget-author {
        font-size: 14px;
    }
    
    .cgr-style-carousel .cgr-review-date {
        font-size: 12px;
    }
}

/* ==============================================
   NETTOYAGE DES CONFLITS - POINTS RONDS
   ============================================== */
.cgr-style-carousel .cgr-carousel-dots {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* Forcer les styles des points du carrousel */
.cgr-style-carousel .cgr-carousel-dots .cgr-carousel-dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    max-width: 8px !important;
    max-height: 8px !important;
    border-radius: 50% !important;
    background: #ccc !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    line-height: 1 !important;
    font-size: 0 !important;
    vertical-align: baseline !important;
}

.cgr-style-carousel .cgr-carousel-dots .cgr-carousel-dot.cgr-active {
    background: #4CAF50 !important;
    transform: scale(1.2) !important;
    width: 8px !important;
    height: 8px !important;
}

/* S'assurer qu'il n'y a qu'un avatar par avis */
.cgr-style-carousel .cgr-widget-review .cgr-reviewer-avatar {
    display: block !important;
}

.cgr-style-carousel .cgr-widget-review .cgr-reviewer-avatar + .cgr-reviewer-avatar {
    display: none !important;
}

/* Annuler tous les autres styles qui pourraient interférer */
.cgr-carousel-dots * {
    border-radius: 50% !important;
    width: 8px !important;
    height: 8px !important;
    background: #ccc !important;
    box-sizing: border-box !important;
}

.cgr-carousel-dots *.cgr-active {
    background: #4CAF50 !important;
    transform: scale(1.2) !important;
}

/* ==============================================
   WIDGET STYLES (autres styles existants)
   ============================================== */

/* Header du widget avec note moyenne */
.cgr-widget-header {
    background: var(--cgr-bg-light);
    padding: 15px;
    border-radius: var(--cgr-radius);
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid var(--cgr-border);
}

.cgr-widget-average {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cgr-stars-display {
    font-size: 20px;
    line-height: 1;
}

.cgr-average-text {
    font-weight: 600;
    color: var(--cgr-text);
}

.cgr-rating-number {
    font-size: 18px;
    font-weight: bold;
    color: var(--cgr-primary);
}

.cgr-total-reviews {
    font-size: 14px;
    color: var(--cgr-text-light);
}

/* Container des avis */
.cgr-widget-reviews {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--cgr-border) transparent;
}

.cgr-widget-reviews::-webkit-scrollbar {
    width: 6px;
}

.cgr-widget-reviews::-webkit-scrollbar-track {
    background: transparent;
}

.cgr-widget-reviews::-webkit-scrollbar-thumb {
    background: var(--cgr-border);
    border-radius: 3px;
}

/* Pour le carrousel, supprimer les scrollbars */
.cgr-style-carousel .cgr-widget-reviews {
    overflow: hidden !important;
}

.cgr-style-carousel .cgr-widget-reviews::-webkit-scrollbar {
    display: none;
}

/* ==============================================
   STYLES D'AVIS - MODERNE
   ============================================== */

.cgr-style-modern .cgr-widget-review {
    background: #fff;
    border: 1px solid var(--cgr-border);
    border-radius: var(--cgr-radius);
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--cgr-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cgr-style-modern .cgr-widget-review:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cgr-style-modern .cgr-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cgr-style-modern .cgr-widget-rating {
    font-size: 14px;
}

.cgr-style-modern .cgr-review-date {
    font-size: 11px;
    color: var(--cgr-text-muted);
}

.cgr-style-modern .cgr-widget-comment {
    font-style: italic;
    color: var(--cgr-text-light);
    line-height: 1.4;
    margin-bottom: 10px;
    font-size: 14px;
}

.cgr-style-modern .cgr-review-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

.cgr-style-modern .cgr-widget-author {
    font-weight: 600;
    color: var(--cgr-text);
    font-size: 13px;
}

.cgr-style-modern .cgr-widget-product {
    font-size: 11px;
    color: var(--cgr-text-muted);
    margin-top: 3px;
}

/* ==============================================
   STYLES D'AVIS - CARTES
   ============================================== */

.cgr-style-card .cgr-widget-reviews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    max-height: none;
}

.cgr-style-card .cgr-widget-review {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid var(--cgr-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cgr-style-card .cgr-widget-review::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cgr-primary), var(--cgr-secondary));
}

.cgr-style-card .cgr-widget-review:hover {
    transform: scale(1.02);
    border-color: var(--cgr-primary);
    box-shadow: 0 8px 25px rgba(0,115,170,0.15);
}

.cgr-style-card .cgr-widget-rating {
    font-size: 18px;
    margin-bottom: 10px;
}

.cgr-style-card .cgr-widget-comment {
    font-style: italic;
    color: var(--cgr-text);
    margin-bottom: 15px;
    min-height: 40px;
}

.cgr-style-card .cgr-widget-author {
    font-weight: bold;
    color: var(--cgr-primary);
}

/* ==============================================
   STYLES D'AVIS - CLASSIQUE
   ============================================== */

.cgr-style-classic .cgr-widget-review {
    border-bottom: 1px solid var(--cgr-border);
    padding: 12px 0;
    margin-bottom: 12px;
}

.cgr-style-classic .cgr-widget-review:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cgr-style-classic .cgr-widget-rating {
    font-size: 14px;
    margin-bottom: 5px;
}

.cgr-style-classic .cgr-widget-comment {
    font-style: italic;
    color: var(--cgr-text-light);
    margin-bottom: 5px;
    line-height: 1.4;
}

.cgr-style-classic .cgr-widget-author {
    font-size: 12px;
    font-weight: bold;
    color: var(--cgr-text);
}

/* ==============================================
   STYLES D'AVIS - MINIMAL
   ============================================== */

.cgr-style-minimal .cgr-widget-review {
    padding: 8px 0;
    margin-bottom: 8px;
}

.cgr-style-minimal .cgr-widget-rating {
    font-size: 12px;
    margin-bottom: 4px;
}

.cgr-style-minimal .cgr-widget-comment {
    font-size: 13px;
    color: var(--cgr-text-light);
    margin-bottom: 4px;
}

.cgr-style-minimal .cgr-widget-author {
    font-size: 11px;
    color: var(--cgr-text-muted);
    font-weight: normal;
}

/* ==============================================
   SHORTCODE STYLES
   ============================================== */

.clust3r-average {
    background: linear-gradient(135deg, var(--cgr-primary), #005a87);
    color: white;
    padding: 20px;
    border-radius: var(--cgr-radius);
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--cgr-shadow);
}

.clust3r-average .clust3r-stars {
    font-size: 24px;
    margin-bottom: 8px;
}

.clust3r-reviews-list .clust3r-review {
    background: #fff;
    border: 1px solid var(--cgr-border);
    border-radius: var(--cgr-radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--cgr-shadow);
    transition: transform 0.2s ease;
}

.clust3r-reviews-list .clust3r-review:hover {
    transform: translateY(-2px);
}

.clust3r-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.clust3r-reviews-grid .clust3r-review {
    background: #fff;
    border: 1px solid var(--cgr-border);
    border-radius: var(--cgr-radius);
    padding: 20px;
    box-shadow: var(--cgr-shadow);
    transition: all 0.3s ease;
}

.clust3r-reviews-grid .clust3r-review:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.clust3r-rating {
    font-size: 16px;
    margin-bottom: 10px;
}

.clust3r-content {
    font-style: italic;
    color: var(--cgr-text-light);
    margin-bottom: 10px;
    line-height: 1.5;
}

.clust3r-author {
    font-weight: bold;
    color: var(--cgr-text);
    text-align: right;
    margin-bottom: 5px;
}

.clust3r-product {
    font-size: 12px;
    color: var(--cgr-text-muted);
    text-align: right;
}

/* ==============================================
   ÉTOILES HTML/CSS
   ============================================== */

.cgr-stars-html {
    display: inline-block;
    font-size: inherit;
}

.cgr-star {
    color: var(--cgr-secondary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cgr-star-full {
    color: var(--cgr-secondary);
}

.cgr-star-half {
    background: linear-gradient(90deg, var(--cgr-secondary) 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cgr-star-empty {
    color: #ddd;
}

/* ==============================================
   FOOTER DU WIDGET
   ============================================== */

.cgr-widget-footer {
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--cgr-border);
}

.cgr-powered-by {
    color: var(--cgr-text-muted);
    font-size: 10px;
}

.cgr-powered-by strong {
    color: var(--cgr-primary);
}

/* ==============================================
   MESSAGE AUCUN AVIS
   ============================================== */

.cgr-no-reviews {
    text-align: center;
    padding: 30px 15px;
    color: var(--cgr-text-light);
    background: var(--cgr-bg-light);
    border-radius: var(--cgr-radius);
    border: 1px dashed var(--cgr-border);
}

.cgr-no-reviews p {
    margin: 0;
    font-style: italic;
}

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

@media (max-width: 768px) {
    .cgr-style-card .cgr-widget-reviews {
        grid-template-columns: 1fr;
    }
    
    .clust3r-reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .cgr-widget-review {
        padding: 12px !important;
    }
    
    .cgr-widget-comment {
        font-size: 13px !important;
    }
    
    .cgr-style-modern .cgr-review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ==============================================
   ANIMATIONS ET EFFETS
   ============================================== */

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

.cgr-widget-review {
    animation: cgr-fadeIn 0.5s ease-out;
}

.cgr-widget-review:nth-child(2) { animation-delay: 0.1s; }
.cgr-widget-review:nth-child(3) { animation-delay: 0.2s; }
.cgr-widget-review:nth-child(4) { animation-delay: 0.3s; }
.cgr-widget-review:nth-child(5) { animation-delay: 0.4s; }

/* Effet de pulsation pour les nouvelles étoiles */
@keyframes cgr-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.cgr-widget-rating:hover {
    animation: cgr-pulse 0.6s ease-in-out;
}

/* Masquer le texte "Chargement..." s'il apparaît */
.cgr-loader {
    display: none !important;
}

/* ==============================================
   CORRECTIONS FINALES
   ============================================== */

/* Empêcher tout débordement horizontal */
* {
    box-sizing: border-box;
}

.cgr-style-carousel * {
    box-sizing: border-box;
}

/* Container global sans débordement */
.cgr-style-carousel {
    width: 100%;
    overflow: visible;
}

@media (max-width: 1200px) {
    .cgr-style-carousel .cgr-widget-reviews {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}
/* Annuler TOUS les styles externes qui pourraient étirer */
.cgr-carousel-dots button,
.cgr-carousel-dots .cgr-carousel-dot,
.cgr-carousel-dots * {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    max-width: 8px !important;
    max-height: 8px !important;
    border-radius: 50% !important;
    background: #ccc !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    line-height: 1 !important;
    font-size: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    vertical-align: baseline !important;
}

.cgr-carousel-dots *.cgr-active,
.cgr-carousel-dots button.cgr-active {
    background: #4CAF50 !important;
    transform: scale(1.2) !important;
    width: 8px !important;
    height: 8px !important;
}