/* ==========================================================================
   CARRUSEL DE TESTIMONIOS (RÉPLICA EXACTA: CONTINUO Y BUTTERY SMOOTH)
   ========================================================================== */

.section-testimonios-videos {
    /* CORRECCIÓN FUNDAMENTAL (BREAKOUT): Fuerza a la sección a romper cualquier contenedor del tema */
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    
    background-color: #2C2825;
    padding: 0; 
    overflow: hidden;
}

.testimonios-carousel-wrapper {
    width: 100%; 
    height: 480px; 
    margin: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Pista de Diapositivas (Alineadas en una sola fila contigua) */
.testimonios-carousel-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
    height: 100%;
    will-change: transform;
    /* Transición de altísimo rendimiento procesada por GPU (Súper Sedosa) */
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Diapositiva Individual */
.testimonio-slide {
    width: 66.666vw; /* Exactamente 2/3 de la pantalla */
    height: 100%; 
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* Imagen de fondo */
.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
}

/* Capa de oscurecimiento (Overlay) */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* Totalmente transparente para las laterales */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.85s ease;
}

/* CORRECCIÓN: Únicamente la central (activa) recibe la capa semitransparente oscura */
.testimonio-slide.active .slide-overlay {
    background-color: rgba(0, 0, 0, 0.45); 
}

/* Solo las laterales van en escala de grises al natural (sin capa negra) */
.testimonio-slide.slide-left,
.testimonio-slide.slide-right {
    filter: grayscale(100%);
}

/* Banderín decorativo */
.slide-banderin {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: auto;
    display: flex;
    justify-content: center;
    pointer-events: none;
    opacity: 0; 
    transition: opacity 0.4s ease;
}

.testimonio-slide.active .slide-banderin {
    opacity: 1;
}

.slide-banderin img {
    width: 100%;
    height: auto;
}

.slide-banderin span {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    color: #ffffff;
    font-family: 'Exo', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Contenido Interno */
.slide-content {
    width: 80%;
    max-width: 600px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
}

/* Título (Se desvanece por completo si el slide va a un lateral) */
.testimonio-title {
    font-family: 'Exo', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 15px;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.testimonio-slide.active .testimonio-title {
    opacity: 1;
    transform: translateY(0);
}

/* Botón de Play */
.testimonio-play-btn {
    background: none;
    border: none;
    width: 65px;
    height: 65px;
    padding: 0;
    cursor: pointer;
    margin-bottom: 25px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

.testimonio-slide.active .testimonio-play-btn {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.testimonio-play-btn:hover {
    transform: scale(1.1);
}

.testimonio-play-btn img {
    width: 100%;
    height: auto;
}

/* Texto descriptivo */
.testimonio-text {
    font-family: 'Exo', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    color: #ffffff;
    line-height: 1.6;
    margin: 0;
    opacity: 0; 
    transition: opacity 0.4s ease;
}

.testimonio-slide.active .testimonio-text {
    opacity: 1;
}

/* ==========================================================================
   BOTONES DE NAVEGACIÓN FLOTANTES EXACTAMENTE EN LA UNIÓN DE SLIDES
   ========================================================================== */

.testimonio-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    width: 32px;
    height: auto;
    padding: 0;
    cursor: pointer;
    z-index: 25; 
    transition: transform 0.3s ease;
}

.testimonio-nav-btn img {
    width: 100%;
    height: auto;
}

/* Centradas matemáticamente sobre las uniones (márgenes de 16.66% a los lados) */
.nav-prev {
    left: 15vw; 
}

.nav-next {
    right: 15vw; 
}

.testimonio-nav-btn:hover {
    transform: translateY(-50%) scale(1.15);
}

/* ==========================================================================
   MODAL LIGHTBOX DE VIDEO
   ========================================================================== */

.testimonio-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.testimonio-video-modal.modal-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal-body {
    position: relative;
    width: 90%;
    max-width: 800px;
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
    z-index: 10;
}

.video-iframe-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; 
}

.video-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 15;
    transition: color 0.3s ease;
}

.modal-close-btn:hover {
    color: #8C1527;
}

/* ==========================================================================
   RESPONSIVE MÓVIL Y TABLET (TESTIMONIOS PERFECTAMENTE CENTRADOS)
   ========================================================================== */
@media screen and (max-width: 992px) {
    .testimonio-slide {
        width: 80vw !important;
    }
    .nav-prev {
        left: 2vw;
    }
    .nav-next {
        right: 2vw;
    }
}

@media screen and (max-width: 768px) {
    .testimonios-carousel-wrapper {
        height: 440px;
    }
    .testimonio-slide {
        width: 100vw !important; 
    }
    .slide-content {
        width: 90%;
        padding: 0 15px;
        box-sizing: border-box;
    }
    .testimonio-nav-btn {
        width: 28px;
    }
    .nav-prev {
        left: 10px;
    }
    .nav-next {
        right: 10px;
    }
    .testimonio-title {
        font-size: 1.7rem;
        margin-bottom: 10px;
    }
    .testimonio-play-btn {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }
    .testimonio-text {
        font-size: 0.85rem;
        line-height: 1.45;
    }
    .slide-banderin {
        width: 160px;
    }
    .slide-banderin span {
        font-size: 0.7rem;
    }
}