/* --- ESTILOS PARA LA VENTANA DE AYUDA Y BARRA LATERAL --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* --- BARRA LATERAL (SIEMPRE A LA IZQUIERDA) --- */
#sidebar-menu {
    position: fixed;
    left: 0;
    /* Asegurado a la izquierda */
    right: auto;
    /* Asegura que no haya conflicto con right */
    top: 50%;
    transform: translateY(-50%);
    z-index: 9990;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Ajustes para bordes redondeados en el lado derecho */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}

/* Contenedor de cada icono */
.sidebar-icon {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon img {
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.sidebar-icon:hover img {
    transform: scale(1.15);
}

/* --- ESTILOS PARA LOS TOOLTIPS (APARECEN A LA DERECHA DEL ICONO) --- */
.sidebar-icon::before {
    content: attr(data-tooltip);
    position: absolute;
    left: 120%;
    /* Asegurado para aparecer a la derecha */
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(45, 45, 45, 0.85);
    color: #fff;
    padding: 8px 15px;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.sidebar-icon::after {
    content: '';
    position: absolute;
    left: 100%;
    /* Asegurado para aparecer a la derecha */
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    margin-left: -6px;
    /* Ajustado para la flecha a la derecha */
    margin-right: 0;
    border-width: 6px;
    border-style: solid;
    /* Invierte la dirección de la flecha */
    border-color: transparent rgba(45, 45, 45, 0.85) transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.sidebar-icon:hover::before,
.sidebar-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

/* --- CONTENEDORES DE POPUP (Sin cambios) --- */
.popup-contenedor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.contenido-ventana {
    width: 800px;
    height: 550px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    position: relative;
    padding: 30px;
    color: white;
    box-sizing: border-box;
    overflow: hidden;
}

.cerrar-ventana {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 1000;
}

.cerrar-ventana:hover {
    transform: scale(1.2);
}

/* --- TÍTULOS Y CONTENIDO ESTÁTICO DE LAS VENTANAS (Sin cambios) --- */
.contenido-ventana h3 {
    margin: 0;
    padding-bottom: 15px;
    font-size: 2em;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
}

.contenido-ventana .imagen-info {
    display: block;
    max-width: 95%;
    height: auto;
    margin: 20px auto;
    border-radius: 10px;
}

.contenido-ventana .video-iframe {
    width: 100%;
    height: calc(100% - 75px);
    border: none;
    border-radius: 10px;
    margin-top: 15px;
}

/* Lógica de visibilidad para las imágenes de ayuda (Sin cambios) */
#ventana-ayuda .imagen-ayuda-desktop {
    display: block !important;
}

#ventana-ayuda .imagen-ayuda-movil {
    display: none !important;
}

/* --- ESTILOS PARA LA GALERÍA SWIPER (Sin cambios relevantes) --- */
#ventana-galeria .swiper {
    width: 100%;
    height: calc(100% - 85px);
    padding-top: 0;
    margin-top: 20px;
    padding-bottom: 130px;
    box-sizing: border-box;
}

#ventana-galeria .swiper-slide {
    background-position: center;
    background-size: cover;
    width: 280px;
    height: 350px;
    border-radius: 20px;
    overflow: visible;
    position: relative;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    opacity: 0.5;
}

#ventana-galeria .swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    transition: background-color 0.4s;
    z-index: 5;
}

#ventana-galeria .swiper-slide.swiper-slide-active {
    opacity: 1;
}

#ventana-galeria .swiper-slide.swiper-slide-active::before {
    background-color: rgba(0, 0, 0, 0);
}

#ventana-galeria .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

#ventana-galeria .swiper-slide.swiper-slide-active {
    -webkit-box-reflect: below 5px linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.15));
}

#ventana-galeria .slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    color: white;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.9), rgba(10, 10, 10, 0));
    border-radius: 0 0 20px 20px;
    z-index: 10;
    text-align: center;
    box-sizing: border-box;
}

#ventana-galeria .slide-content h2,
#ventana-galeria .slide-content h3 {
    font-family: 'Roboto', sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#ventana-galeria .slide-content h2 {
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 0.2rem;
}

#ventana-galeria .slide-content h3 {
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.3;
}

#ventana-galeria .swiper-button-next,
#ventana-galeria .swiper-button-prev {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    transition: background-color 0.3s;
}

#ventana-galeria .swiper-button-next:hover,
#ventana-galeria .swiper-button-prev:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

#ventana-galeria .swiper-button-next::after,
#ventana-galeria .swiper-button-prev::after {
    font-size: 1.2rem;
}

/* ----- ESTILOS ESPECÍFICOS PARA EL VIEWCUBE (SÓLO ESCRITORIO, A LA IZQUIERDA) ----- */
#viewcube-wrapper {
    position: fixed;
    top: 100px;
    left: 100px;
    /* Posición a la izquierda para escritorio */
    right: auto;
    width: 100px;
    height: 100px;
    z-index: 100;
    overflow: visible;
    background-color: transparent;
    display: flex;
    /* Visible por defecto en escritorio */
    justify-content: center;
    align-items: center;
    touch-action: manipulation;

    /* === NUEVOS ESTILOS PARA OCULTAR INICIALMENTE Y TRANSICIÓN === */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    /* Transición suave para aparecer */
}

/* El contenedor de la escena, dentro del wrapper */
#viewcube-wrapper .scene {
    width: 100px;
    height: 100px;
    perspective: 600px;
    position: relative;
}

/* El cubo 3D interactivo */
#viewcube-wrapper .cube {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    transition: transform 0.7s ease-in-out;
    transform: rotateX(-30deg) rotateY(45deg);
}

/* Estilos para cada cara del cubo */
#viewcube-wrapper .cube-face {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    font-size: 1.5em;
    color: white;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    padding: 8px;
    box-sizing: border-box;
    cursor: pointer;
    border: 2px solid white;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s ease;
}

/* Cara activa - resaltada */
#viewcube-wrapper .cube-face.active {
    background: rgba(0, 0, 0, 0.7);
    border-color: #ffcc00;
    color: #ffcc00;
}

/* Transformaciones para posicionar cada cara */
#viewcube-wrapper .front {
    transform: translateZ(50px);
}

#viewcube-wrapper .back {
    transform: rotateY(180deg) translateZ(50px);
}

#viewcube-wrapper .right {
    transform: rotateY(90deg) translateZ(50px);
}

#viewcube-wrapper .left {
    transform: rotateY(-90deg) translateZ(50px);
}

#viewcube-wrapper .top {
    transform: rotateX(90deg) translateZ(50px);
}

#viewcube-wrapper .bottom {
    transform: rotateX(-90deg) translateZ(50px);
}

/* Efecto hover para escritorio */
@media (hover: hover) {
    #viewcube-wrapper .cube-face:hover {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* --- CAMBIOS PARA LA VERSIÓN MÓVIL (PANTALLAS DE HASTA 768px) --- */
@media (max-width: 768px) {

    /* Ajustes generales para móvil (sin cambios en barra lateral, ya que se maneja arriba) */
    .contenido-ventana {
        width: calc(100% - 20px);
        height: 90%;
        padding: 20px;
    }

    .contenido-ventana h3 {
        font-size: 1.5em;
    }

    /* Oculta imagen de ayuda de escritorio y muestra la de móvil */
    #ventana-ayuda .imagen-ayuda-desktop {
        display: none !important;
    }

    #ventana-ayuda .imagen-ayuda-movil {
        display: block !important;
    }

    /* --- AJUSTES DE GALERÍA PARA MÓVIL (Sin cambios) --- */
    /* Reduce el tamaño de los slides de la galería */
    #ventana-galeria .swiper-slide {
        width: 240px;
        height: 320px;
    }

    /* Oculta el texto de los slides que no están activos */
    #ventana-galeria .swiper-slide:not(.swiper-slide-active) .slide-content {
        display: none;
    }

    /* Mueve el texto del slide activo hacia abajo, fuera de la imagen */
    #ventana-galeria .swiper-slide.swiper-slide-active .slide-content {
        transform: translateY(calc(100% + 10px));
        background: transparent;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    }

    /* Oculta completamente el ViewCube en dispositivos móviles */
    #viewcube-wrapper {
        display: none;
        /* Esto asegura que el ViewCube no se muestre en móvil */
    }

    /* Previene el zoom accidental al tocar dos veces en móviles */
    body {
        touch-action: manipulation;
    }
}