/**
 * Video Carousel for Elementor - Estilos Principales
 * 
 * FASE 3: Estilos completos con navegación, dots, overlay y multi-slide
 * 
 * @package Video_Carousel_Elementor
 * @version 3.0.0
 */

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */

.vce-carousel-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.vce-carousel-wrapper * {
    box-sizing: border-box;
}

/* ============================================
   CONTENEDOR DEL CARRUSEL
   ============================================ */

.vce-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* ============================================
   TRACK DEL CARRUSEL
   ============================================ */

.vce-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.vce-carousel-track.vce-no-transition {
    transition: none !important;
}

/* ============================================
   SLIDES INDIVIDUALES
   ============================================ */

.vce-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    position: relative;
    padding: 0 10px;
}

/* Multi-slide: cuando hay múltiples slides visibles */
.vce-carousel-wrapper[data-slides-to-show="2"] .vce-carousel-slide {
    flex: 0 0 50%;
    min-width: 50%;
}

.vce-carousel-wrapper[data-slides-to-show="3"] .vce-carousel-slide {
    flex: 0 0 33.333%;
    min-width: 33.333%;
}

.vce-carousel-wrapper[data-slides-to-show="4"] .vce-carousel-slide {
    flex: 0 0 25%;
    min-width: 25%;
}

.vce-carousel-wrapper[data-slides-to-show="5"] .vce-carousel-slide {
    flex: 0 0 20%;
    min-width: 20%;
}

.vce-carousel-wrapper[data-slides-to-show="6"] .vce-carousel-slide {
    flex: 0 0 16.666%;
    min-width: 16.666%;
}

.vce-carousel-slide.vce-clone {
    /* Los clones son copias exactas para el loop infinito */
}

/* ============================================
   CONTENEDOR DE VIDEO
   ============================================ */

.vce-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.vce-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: inherit;
}

.vce-video-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(255, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* ============================================
   OVERLAY DE VIDEO
   ============================================ */

.vce-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.vce-video-overlay:hover {
    opacity: 0.9;
}

.vce-play-icon {
    color: #ffffff;
    font-size: 60px;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.vce-video-overlay:hover .vce-play-icon {
    transform: scale(1.1);
}

/* ============================================
   CONTROLES DE NAVEGACIÓN (FLECHAS)
   ============================================ */

.vce-carousel-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.vce-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10;
}

.vce-nav-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.vce-nav-button.vce-prev {
    left: 10px;
}

.vce-nav-button.vce-next {
    right: 10px;
}

.vce-nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   DOTS DE NAVEGACIÓN
   ============================================ */

.vce-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 0;
}

.vce-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.vce-dot:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

.vce-dot.vce-active {
    background-color: #ffffff;
    transform: scale(1.3);
}

/* ============================================
   ESTADOS DEL CARRUSEL
   ============================================ */

.vce-carousel-wrapper.vce-paused .vce-carousel-track {
    /* Mantener la posición cuando está pausado */
}

.vce-carousel-wrapper.vce-initialized {
    /* Carrusel inicializado correctamente */
}

.vce-carousel-wrapper.vce-dragging {
    cursor: grabbing;
}

.vce-carousel-wrapper.vce-dragging .vce-carousel-slide {
    pointer-events: none;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1024px) {
    .vce-carousel-slide {
        padding: 0 8px;
    }
    
    .vce-nav-button {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* ============================================
   RESPONSIVE - MÓVIL
   ============================================ */

@media (max-width: 768px) {
    .vce-carousel-slide {
        padding: 0 5px;
    }
    
    .vce-video-container {
        border-radius: 6px;
    }
    
    .vce-nav-button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .vce-nav-button.vce-prev {
        left: 5px;
    }
    
    .vce-nav-button.vce-next {
        right: 5px;
    }
    
    .vce-play-icon {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .vce-carousel-slide {
        padding: 0 3px;
    }
    
    .vce-video-container {
        border-radius: 4px;
    }
    
    .vce-carousel-dots {
        gap: 6px;
    }
    
    .vce-dot {
        width: 8px;
        height: 8px;
    }
}

/* ============================================
   ANIMACIONES Y TRANSICIONES
   ============================================ */

@keyframes vce-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.vce-carousel-wrapper {
    animation: vce-fade-in 0.3s ease-in;
}

/* ============================================
   MEJORAS DE RENDIMIENTO
   ============================================ */

.vce-carousel-track {
    backface-visibility: hidden;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.vce-video-container {
    backface-visibility: hidden;
}

/* Optimización para touch devices */
.vce-carousel-wrapper {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
