.popup-slideshow {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-slideshow.activo {
    display: block;
    opacity: 1;
}

.popup-slideshow .overlay-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.popup-slideshow .contenedor-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.popup-slideshow .imagen-popup {
    max-width: 100%;
    height: 80vh;
    aspect-ratio: 4/5;
    object-fit: contain;
    display: block;
    user-select: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

.popup-slideshow .video-popup {
    max-width: 100%;
    height: 80vh;
    aspect-ratio: 4/5;
    object-fit: contain;
    display: none;
    background-color: #000;
    user-select: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

.popup-slideshow .boton-cerrar-popup {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 10010;
}

.popup-slideshow .boton-cerrar-popup:hover {
    background: white;
    transform: scale(1.1);
}

.popup-slideshow .icono-cerrar-popup {
    width: 20px;
    height: 20px;
}

.popup-slideshow .flecha-popup {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.popup-slideshow .flecha-popup:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.popup-slideshow .flecha-popup.oculta {
    display: none;
}

.template-detalle-producto .imagen-galeria[data-video-src] {
    position: relative;
    cursor: pointer;
}

.template-detalle-producto .icono-play-galeria {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25%;
    aspect-ratio: 1/1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.template-detalle-producto .imagen-galeria[data-video-src]:hover .icono-play-galeria {
    opacity: 1;
}

.template-detalle-producto .icono-play-galeria {
    opacity: 0.8;
}

@media (max-width: 975px) {
    .popup-slideshow .contenedor-popup {
        width: 90%;
        gap: 1rem;
    }

    .popup-slideshow .flecha-popup {
        width: 40px;
        height: 40px;
    }

    .popup-slideshow .boton-cerrar-popup {
        top: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
    }
}

.template-detalle-producto .galeria-movil {
    display: none;
}

@media (max-width: 975px) {
    .template-detalle-producto .galeria-movil {
        display: block;
        position: relative;
        overflow: hidden;
    }

    .template-detalle-producto .imagen-principal-movil {
        width: 100%;
        aspect-ratio: 4/5;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .template-detalle-producto .video-principal-movil {
        width: 100%;
        aspect-ratio: 4/5;
        object-fit: cover;
        display: none;
        background-color: #000;
    }

    .template-detalle-producto .navegacion-galeria-movil {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .template-detalle-producto .punto-galeria {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: #ddd;
        border: none;
        cursor: pointer;
        padding: 0;
        transition: background-color 0.3s ease;
    }

    .template-detalle-producto .punto-galeria.activo {
        background-color: #3A3A34;
    }

    .template-detalle-producto .flecha-galeria-movil {
        display: none;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.5);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s ease;
        z-index: 10;
    }

    .template-detalle-producto .flecha-galeria-movil:hover {
        background: rgba(0, 0, 0, 0.7);
    }

    .template-detalle-producto .flecha-izquierda-movil {
        left: 1rem;
    }

    .template-detalle-producto .flecha-derecha-movil {
        right: 1rem;
    }

    .template-detalle-producto .icono-play-movil {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 20%;
        aspect-ratio: 1/1;
        pointer-events: none;
        opacity: 0.8;
        transition: opacity 0.3s ease;
        display: none;
    }

    .template-detalle-producto .galeria-movil.video-disponible {
        cursor: pointer;
    }

    .template-detalle-producto .galeria-movil.video-disponible .icono-play-movil {
        display: block;
    }

    .template-detalle-producto .galeria-movil.video-reproduciendo .icono-play-movil {
        display: none;
    }

    .template-detalle-producto .galeria-movil.video-disponible:hover .icono-play-movil {
        opacity: 1;
    }
}

@media (max-width: 975px) and (hover: hover) and (pointer: fine) {
    .template-detalle-producto .flecha-galeria-movil {
        display: flex;
    }
}

@media (hover: none) {
    .popup-slideshow .boton-cerrar-popup:hover {
        background: rgba(255, 255, 255, 0.9);
        transform: scale(1);
    }
    
    .popup-slideshow .flecha-popup:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1);
    }
    
    .template-detalle-producto .imagen-galeria[data-video-src]:hover .icono-play-galeria {
        opacity: 0.8;
    }
    
    .template-detalle-producto .flecha-galeria-movil:hover {
        background: rgba(0, 0, 0, 0.5);
    }
    
    .template-detalle-producto .galeria-movil.video-disponible:hover .icono-play-movil {
        opacity: 0.8;
    }
}