/* Estilos del Carousel Popup - Frontend */

/* Botón Trigger */
.carousel-trigger-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.carousel-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.carousel-trigger-btn:active {
    transform: translateY(0);
}

/* Overlay del Popup */
.carousel-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.carousel-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenido del Popup */
.carousel-popup-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.7);
    transition: transform 0.4s ease;
}

.carousel-popup-overlay.active .carousel-popup-content {
    transform: scale(1);
}

/* Botón Cerrar */
.carousel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-close:hover {
    background: rgba(220, 50, 50, 0.9);
    transform: rotate(90deg);
}

/* Contador de Imágenes */
.carousel-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
}

/* Contenedor de Imágenes */
.carousel-images {
    position: relative;
    width: 100%;
    height: 70vh;
    max-height: 700px;
    overflow: hidden;
}

/* Slides */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Efecto Fade */
.carousel-popup-content[data-effect="fade"] .carousel-slide {
    transform: none;
}

/* Efecto Slide */
.carousel-popup-content[data-effect="slide"] .carousel-slide {
    transform: translateX(100%);
    transition: transform 0.5s ease, opacity 0.5s ease, visibility 0.5s ease;
}

.carousel-popup-content[data-effect="slide"] .carousel-slide.active {
    transform: translateX(0);
}

.carousel-popup-content[data-effect="slide"] .carousel-slide.prev {
    transform: translateX(-100%);
}

/* Efecto Zoom */
.carousel-popup-content[data-effect="zoom"] .carousel-slide {
    transform: scale(0.8);
    transition: transform 0.5s ease, opacity 0.5s ease, visibility 0.5s ease;
}

.carousel-popup-content[data-effect="zoom"] .carousel-slide.active {
    transform: scale(1);
}

/* Imágenes */
.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

/* Caption */
.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    padding: 30px 20px 20px;
    font-size: 16px;
    text-align: center;
}

/* Flechas de Navegación */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.carousel-prev:active,
.carousel-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* Puntos Indicadores */
.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: #fff;
    width: 30px;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-popup-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .carousel-images {
        height: 60vh;
    }
    
    .carousel-prev,
    .carousel-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
    
    .carousel-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .carousel-counter {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .carousel-caption {
        font-size: 14px;
        padding: 20px 15px 15px;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
    
    .carousel-dot.active {
        width: 24px;
    }
}

/* Animaciones de Carga */
@keyframes carouselFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.carousel-popup-overlay.loading .carousel-popup-content {
    animation: carouselFadeIn 0.5s ease;
}

/* Loading Spinner (opcional) */
.carousel-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Prevenir scroll del body cuando el popup está abierto */
body.carousel-popup-open {
    overflow: hidden;
}