/**
 * MW Testimonials Carousel Styles
 */

.mw-testimonials-carousel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 60px;
}

.mw-testimonials-carousel {
    overflow: hidden;
    border-radius: 12px;
    padding: 20px 3px;
}

.mw-testimonials-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.mw-testimonial-slide {
    width: 33.333%; /* 1/3 sur desktop */
    flex-shrink: 0;
    padding: 0 10px; /* Padding pour créer l'espace entre les slides */
    box-sizing: border-box;
}

.mw-testimonial-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Vidéo YouTube */
.mw-testimonial-video {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    background: #000;
}

.mw-video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.mw-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    padding: 0;
}

/* Image de couverture sans vidéo */
.mw-cover-image-only {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mw-cover-image-only img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mw-video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
}

.mw-video-thumbnail:hover .mw-video-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.mw-testimonial-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Modal vidéo */
.mw-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.mw-video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
    z-index: 1;
}

.mw-video-modal-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.mw-video-modal-content {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    line-height: 0;
    display: inline-block;
}

.mw-video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    z-index: 3;
}

.mw-video-modal-close:hover {
    transform: scale(1.2);
}

.mw-video-modal-content iframe {
    display: block;
    width: 90vw;
    height: calc(90vw * 9 / 16);
    max-width: 1200px;
    max-height: calc(1200px * 9 / 16);
    border: 0;
}

/* Ajuster si la hauteur dépasse */
@media (min-aspect-ratio: 16/9) {
    .mw-video-modal-content iframe {
        height: calc(90vh - 80px);
        width: calc((90vh - 80px) * 16 / 9);
    }
}

/* Modal de texte complet */
.mw-text-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.mw-text-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
    z-index: 1;
}

.mw-text-modal-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    max-height: 90vh;
    overflow-y: auto;
}

.mw-text-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 800px;
    width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.mw-text-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 3;
}

.mw-text-modal-close:hover {
    color: #333;
    transform: scale(1.2);
}

.mw-text-modal-body {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.mw-text-modal-body p {
    margin: 0 0 15px 0;
}

.mw-text-modal-body p:last-child {
    margin-bottom: 0;
}

/* Contenu du témoignage */
.mw-testimonial-content {
    padding: 30px;
}

.mw-testimonial-text {
    font-size: 18px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 30px;
    font-style: italic;
}

.mw-testimonial-text p {
    margin: 0 0 15px 0;
}

.mw-testimonial-text p:last-child {
    margin-bottom: 0;
}

/* Wrapper du texte avec l'icône */
.mw-testimonial-text-wrapper {
    position: relative;
}

/* Icône de citation flottante */
.mw-quote-icon {
    float: right;
    margin-left: 15px;
    margin-bottom: 10px;
    color: #ccc;
    width: 60px;
    height: auto;
}

/* Bouton "En lire plus" */
.mw-read-more-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    font-style: normal;
}

.mw-read-more-btn:hover {
    background: #555;
}

/* Auteur */
.mw-testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
}

.mw-testimonial-photo {
    flex-shrink: 0;
}

.mw-testimonial-photo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.mw-testimonial-info {
    flex-grow: 1;
}

.mw-testimonial-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.mw-testimonial-company {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Boutons de navigation */
.mw-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
}

.mw-carousel-nav:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mw-carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.mw-carousel-prev {
    left: 0;
}

.mw-carousel-next {
    right: 0;
}

/* Points de navigation */
.mw-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.mw-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d0d0d0;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mw-carousel-dot:hover {
    background: #999;
}

.mw-carousel-dot.active {
    background: #333;
    width: 30px;
    border-radius: 6px;
}

.mw-carousel-ellipsis {
    color: #999;
    font-size: 18px;
    line-height: 12px;
    display: flex;
    align-items: center;
    padding: 0 2px;
    user-select: none;
}

/* Message vide */
.mw-testimonials-empty {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1023px) {
    .mw-testimonial-slide {
        width: 50%; /* 1/2 sur tablette */
    }
}

@media (max-width: 767px) {
    .mw-testimonials-carousel-wrapper {
        padding: 30px 50px;
    }
    
    .mw-testimonial-slide {
        width: 100%; /* 1/1 sur mobile */
        padding: 0 10px; /* Garde le padding pour l'ombre */
    }
    
    .mw-testimonial-content {
        padding: 20px;
    }
    
    .mw-testimonial-text {
        font-size: 16px;
    }
    
    .mw-carousel-nav {
        width: 36px;
        height: 36px;
    }
    
    .mw-carousel-nav svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .mw-testimonials-carousel-wrapper {
        padding: 20px 40px;
    }
    
    .mw-testimonial-text {
        font-size: 15px;
    }
    
    .mw-testimonial-author {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mw-testimonial-photo img {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   GRILLE DE TÉMOIGNAGES
   ============================================ */

.mw-testimonials-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.mw-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.mw-testimonial-grid-item {
    display: flex;
    align-items: flex-start;
}

/* Les cartes utilisent les mêmes styles que le carrousel */
.mw-testimonial-grid-item .mw-testimonial-card {
    width: 100%;
}

/* Responsive grille */
@media (max-width: 1023px) {
    .mw-testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 767px) {
    .mw-testimonials-grid-wrapper {
        padding: 30px 15px;
    }
    
    .mw-testimonials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
