/* Academia Carousel System - Estilos IDÉNTICOS al original carousel-elotrolado-style.html */

/* Reset básico para evitar interferencias */
* {
    box-sizing: border-box;
}

.carousel-container {
    max-width: 1200px;
    margin: 0 auto 50px auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* CAROUSEL PRINCIPAL */
.carousel-main {
    position: relative;
    height: 400px;
    overflow: hidden;
    z-index: 2; /* Asegura que el contenido quede por encima de la banda de thumbnails */
}

.carousel-slides {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    height: 100%;
    will-change: transform;
    transform: translate3d(0, 0, 0); /* Forzar aceleración de hardware */
    backface-visibility: hidden; /* Optimización adicional */
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.slide-image {
    width: 50%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    width: 50%;
    padding: 40px;
    color: white;
}

.slide-title {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.2;
    color: white !important;
}

.slide-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0.95;
}

.slide-cta {
    background: white;
    color: #dc2626;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.slide-cta:hover {
    background: #fee2e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* NAVEGACIÓN CON FLECHAS - DISEÑO ACTUALIZADO PARA COINCIDIR CON VISTA PREVIA */
.carousel-nav {
    position: absolute !important;
    top: 75% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #dc2626 !important;
    border-radius: 8px !important;
    width: 45px !important;
    height: 45px !important;
    cursor: pointer !important;
    font-size: 20px !important;
    color: #dc2626 !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 0.9 !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2) !important;
    font-weight: 600 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.carousel-nav:hover {
    background: #dc2626 !important;
    color: white !important;
    border-color: #dc2626 !important;
    transform: translateY(-50%) scale(1.05) !important;
    opacity: 1 !important;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4) !important;
}

.carousel-nav.prev {
    left: 25px !important;
}

.carousel-nav.next {
    right: 25px !important;
}

/* Asegurar que las flechas tengan el estilo correcto - usando símbolos más modernos */
.carousel-nav.prev::before {
    content: '❮' !important;
    margin-left: -2px;
}

.carousel-nav.next::before {
    content: '❯' !important;
    margin-right: -2px;
}

/* Estilos adicionales para los botones de navegación */
.carousel-nav {
    line-height: 1 !important;
    outline: none !important;
}

/* Estados de foco para accesibilidad */
.carousel-nav:focus {
    outline: 2px solid #dc2626 !important;
    outline-offset: 2px !important;
}

/* THUMBNAILS/BOTONES INFERIORES - ESTILO ELOTROLADO EXACTO */
.carousel-thumbnails {
    display: flex;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    position: relative;
    z-index: 1;
}

.thumbnail-btn {
    flex: 1;
    padding: 20px 15px;
    border: none;
    background: white !important;
    color: #374151 !important;
    cursor: pointer;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-right: 1px solid #e5e7eb;
    position: relative;
    transform: translateY(0);
}

.thumbnail-btn:last-child {
    border-right: none;
}

.thumbnail-btn:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.thumbnail-btn.active {
    background: #dc2626 !important;
    color: white !important;
}

.thumbnail-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #dc2626;
}

.thumbnail-title {
    font-weight: bold;
    font-size: 0.95em;
    margin-bottom: 5px;
    line-height: 1.3;
}

.thumbnail-desc {
    font-size: 0.85em;
    opacity: 0.8;
    line-height: 1.4;
}

.thumbnail-btn.active .thumbnail-desc {
    opacity: 0.9;
}

/* INDICADOR DE PROGRESO */
.progress-bar {
    height: 4px;
    background: #e5e7eb;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #dc2626;
    width: 0;
    transition: none; /* Sin transición para el progreso automático */
    will-change: width;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .carousel-main {
        height: auto; /* Dejar crecer según contenido para no recortar CTA */
    }

    .carousel-slide {
        flex-direction: column;
        height: auto; /* Evita recortes verticales */
    }

    .slide-image {
        width: 100%;
        height: auto;
        max-height: 45vh; /* Limita altura de imagen */
        object-fit: contain; /* Recorta menos en móviles */
        order: 1;
    }

    .slide-content {
        width: 100%;
        height: auto; /* Contenido fluido */
        padding: 16px 20px 28px; /* Más espacio inferior para el botón */
        order: 2;
    }

    .slide-title {
        font-size: 1.5em;
        margin-bottom: 8px;
    }

    .slide-description {
        font-size: 0.9em;
        margin-bottom: 15px;
    }

    .thumbnail-btn {
        padding: 15px 10px;
    }

    .thumbnail-title {
        font-size: 0.85em;
    }

    .thumbnail-desc {
        font-size: 0.75em;
    }
}

/* Flechas centradas verticalmente en mobile */
@media (max-width: 768px) {
    .carousel-nav {
        top: 42% !important;
        transform: translateY(-50%) !important;
    }
    .carousel-nav.prev { left: 12px !important; }
    .carousel-nav.next { right: 12px !important; }
}

/* Replanteo del layout overlay en mobile: imagen arriba, texto debajo */
@media (max-width: 768px) {
    .carousel-slide[data-layout="overlay"] {
        display: block;
    }
    .carousel-slide[data-layout="overlay"] .slide-background {
        position: relative;
        height: 40vh;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
    .carousel-slide[data-layout="overlay"] .slide-overlay {
        position: relative;
        background: transparent;
        display: block;
    }
    .carousel-slide[data-layout="overlay"] .slide-content-center {
        max-width: 100%;
        padding: 16px 20px 28px;
    }
}

/* ANIMACIONES ADICIONALES */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carousel-slide.active .slide-content > * {
    animation: slideInRight 0.8s ease-out;
}

.carousel-slide.active .slide-title {
    animation-delay: 0.1s;
}

.carousel-slide.active .slide-description {
    animation-delay: 0.2s;
}

.carousel-slide.active .slide-cta {
    animation-delay: 0.3s;
}

/* ELIMINAR CUALQUIER ESTILO AZUL DE WORDPRESS Y FORZAR COLORES CORRECTOS */
.carousel-nav,
.carousel-nav:focus,
.carousel-nav:active,
.carousel-nav:visited {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Colores específicos para thumbnails - Estados por defecto */
.thumbnail-btn,
.thumbnail-btn:focus,
.thumbnail-btn:visited {
    outline: none !important;
    border: none !important;
    background: white !important;
    color: #374151 !important;
}

/* Estado hover */
.thumbnail-btn:hover:not(.active) {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* Estado activo */
.thumbnail-btn.active,
.thumbnail-btn.active:focus,
.thumbnail-btn.active:hover {
    background: #dc2626 !important;
    color: white !important;
}

/* Forzar colores específicos para los elementos internos */
.thumbnail-title {
    color: inherit !important;
    font-weight: bold !important;
}

.thumbnail-desc {
    color: inherit !important;
    opacity: 0.8 !important;
}

.thumbnail-btn.active .thumbnail-title,
.thumbnail-btn.active .thumbnail-desc {
    color: white !important;
}

/* LAYOUTS PARA COMPATIBILIDAD CON EL PLUGIN */
.carousel-slide[data-layout="split"] {
    display: flex;
    align-items: center;
}

.slide-image-left {
    order: 1;
}

.slide-image-right {
    order: 2;
}

.slide-content-left {
    order: 1;
}

.slide-content-right {
    order: 2;
}

/* Layout Overlay */
.carousel-slide[data-layout="overlay"] {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.slide-content-center {
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 40px;
    z-index: 3;
}

/* OCULTAR ELEMENTOS NO DESEADOS */
body.home .hero-section,
body.home .wp-block-cover.alignfull,
body.home .banner,
body.home [class*="potencia"],
body.home [class*="estadistica"],
body.home [class*="negocio"],
body.home [class*="biblioteca"]:not(.carousel-container),
body.home [class*="infosquad"]:not(.carousel-container),
body.home .promo-section,
body.home .stats-section,
body.home img[src*="FotoJet"]:not(.slide-image),
body.home img[src*="ceret-telefono"]:not(.slide-image) {
    display: none !important;
}

/* Asegurar que solo aparezca UN carrusel */
body.home .carousel-container:not(:first-of-type) {
    display: none !important;
}

/* FORZAR ESTILOS DEL CARRUSEL SOBRE WORDPRESS */
.carousel-container * {
    box-sizing: border-box !important;
}

.carousel-container button {
    font-family: inherit !important;
    cursor: pointer !important;
}

.carousel-container .thumbnail-btn {
    text-align: left !important;
    padding: 20px 15px !important;
    border: none !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

/* CORRECCIÓN FINAL: Asegurar colores correctos al cargar la página */
.carousel-thumbnails .thumbnail-btn:not(.active) {
    background: white !important;
    color: #374151 !important;
}

.carousel-thumbnails .thumbnail-btn.active {
    background: #dc2626 !important;
    color: white !important;
}

/* Extra especificidad para sobreescribir cualquier estilo de WordPress */
body .carousel-container .carousel-thumbnails .thumbnail-btn {
    background: white !important;
    color: #374151 !important;
}

body .carousel-container .carousel-thumbnails .thumbnail-btn.active {
    background: #dc2626 !important;
    color: white !important;
}

body .carousel-container .carousel-thumbnails .thumbnail-btn:hover:not(.active) {
    background: #fee2e2 !important;
    color: #dc2626 !important;
} 

/* Reducir recorte de imágenes en layout overlay en móviles */
@media (max-width: 768px) {
	.carousel-slide[data-layout="overlay"] .slide-background {
		background-size: contain;
		background-repeat: no-repeat;
		background-position: center;
	}
	.carousel-slide[data-layout="overlay"] .slide-content-center {
		padding: 24px;
	}
}