* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    background-color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    color: #ffffff;
    overflow-x: hidden;
}

/* MENÚ SUPERIOR EN PÍLDORA Y TOOLTIP */
.menu-wrapper-fijo {
    position: fixed;
    top: 30px;
    left: 8%;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-pildora-container {
    position: relative;
    background-color: #000000;
    padding: 14px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle {
    width: 28px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.barrita {
    width: 100%;
    height: 2.5px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.activo .barrita:nth-child(1) {
    transform: translateY(7.75px) rotate(45deg);
}

.menu-toggle.activo .barrita:nth-child(2) {
    opacity: 0;
}

.menu-toggle.activo .barrita:nth-child(3) {
    transform: translateY(-7.75px) rotate(-45deg);
}

.tooltip-menu {
    background: rgba(255, 255, 255, 0.95);
    color: #000000;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    white-space: nowrap;
    animation: desvanecimientoBucle 25s infinite ease-in-out;
    transition: opacity 0.3s ease;
}

.menu-wrapper-fijo:has(.menu-toggle.activo) .tooltip-menu {
    animation: none;
    opacity: 0;
    pointer-events: none;
}

.tooltip-contenido {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: reboteHorizontal 1.2s infinite ease-in-out;
}

.tooltip-menu .flechita {
    font-size: 0.7rem;
    color: #000000;
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: #000000;
    padding: 20px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 180px;
}

.menu-dropdown.activo {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-navegacion {
    list-style: none;
    text-align: left;
}

.menu-navegacion li {
    margin: 12px 0;
}

.menu-navegacion a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.85;
    transition: opacity 0.2s ease, color 0.2s ease;
    display: block;
}

.menu-navegacion a:hover {
    opacity: 1;
    color: #0071e3;
}

/* ANIMACIÓN ENFOQUE EN SCROLL */
.efecto-enfoque-scroll {
    filter: blur(12px);
    opacity: 0;
    transform: translateY(20px);
    transition: filter 1.2s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.efecto-enfoque-scroll.enfocado {
    filter: blur(0px);
    opacity: 1;
    transform: translateY(0);
}

/* CABECERA GALERÍA */
.seccion-cabecera-galeria {
    width: 100%;
    padding: 140px 8% 30px 8%;
    background-color: #000000;
}

.contenedor-texto {
    max-width: 66vw;
    width: 100%;
}

.enlace-volver {
    display: inline-block;
    color: #0071e3;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.enlace-volver:hover {
    transform: translateX(-4px);
}

.titulo-galeria {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: -1px;
    color: #ffffff;
    margin-bottom: 20px;
}

.intro-galeria {
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.8;
    color: #d1d1d6;
    text-align: justify;
}

.intro-galeria em {
    color: #ffffff;
    font-style: normal;
}

/* GALERÍA HORIZONTAL CON BOTONES FLOTANTES */
.seccion-tira-galeria {
    width: 100%;
    padding: 20px 0 80px 0;
    background-color: #000000;
}

.mecanismo-scroll-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.tira-fotogramas {
    display: flex;
    align-items: center;
    gap: 35px;
    padding: 20px 8%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.tira-fotogramas::-webkit-scrollbar {
    display: none;
}

/* BOTONES DE NAVEGACIÓN CARRUSEL CON RAFAGA EN BUCLE */
.boton-carrusel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: rafagaGlowBucle 10.5s infinite ease-in-out;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.boton-carrusel.prev { left: 2%; }
.boton-carrusel.next { right: 2%; }

.boton-carrusel:hover {
    background: #0071e3;
    border-color: #0071e3;
    color: #ffffff;
    transform: translateY(-50%) scale(1.18);
    box-shadow: 0 0 25px rgba(0, 113, 227, 0.85), 0 0 50px rgba(0, 113, 227, 0.4);
    animation: none;
}

/* ESQUINAS MARCO VISOR HUD */
.esquina-visor {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    z-index: 10;
    pointer-events: none;
    transition: border-color 0.3s ease;
}

.esquina-visor.top-left     { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.esquina-visor.top-right    { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.esquina-visor.bottom-left  { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.esquina-visor.bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; }

/* FOTOGRAMAS */
.fotograma-item {
    flex-shrink: 0;
    cursor: pointer;
}

.formato-vertical   { width: 320px; height: 420px; }
.formato-horizontal { width: 500px; height: 350px; }
.formato-cuadrado   { width: 380px; height: 380px; }

.chasis-fotograma {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

/* CABECERA SUPERIOR (NÚMERO + TÍTULO DE LA FOTO) */
.cabecera-fotograma {
    position: absolute;
    top: 14px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
}

.numero-fotograma {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.titulo-fotograma-carrusel {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

/* TEXTO EXIF FLOTANTE EN ESQUINA INFERIOR DERECHA */
.texto-exif-flotante {
    position: absolute;
    bottom: 14px;
    right: 16px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    z-index: 20;
    pointer-events: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    transition: color 0.3s ease;
}

.imagen-autofocus {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(0px) brightness(0.9);
    transform: scale(1);
    transition: transform 0.4s ease, filter 0.4s ease;
}

/* HOVER EN FOTOGRAMA */
.fotograma-item:hover .chasis-fotograma {
    transform: translateY(-6px);
    border-color: rgba(0, 113, 227, 0.6);
    box-shadow: 0 15px 35px rgba(0, 113, 227, 0.2);
}

.fotograma-item:hover .esquina-visor {
    border-color: #0071e3;
}

.fotograma-item:hover .imagen-autofocus {
    animation: busquedaAutofocoHover 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.fotograma-item:hover .numero-fotograma,
.fotograma-item:hover .titulo-fotograma-carrusel,
.fotograma-item:hover .texto-exif-flotante {
    color: #0071e3;
}

.indicador-desplazamiento {
    padding: 0 8%;
    display: flex;
    justify-content: flex-end;
}

.leyenda-scroll {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: #a1a1a6;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* SECUENCIA DE AUTOFOCO */
@keyframes busquedaAutofocoHover {
    0% {
        filter: blur(0px) brightness(0.9);
        transform: scale(1);
    }
    35% {
        filter: blur(6px) brightness(0.8);
        transform: scale(1.02);
    }
    65% {
        filter: blur(1px) brightness(0.95);
        transform: scale(1.005);
    }
    100% {
        filter: blur(0px) brightness(1);
        transform: scale(1);
    }
}

/* LIGHTBOX / MODAL */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-modal.activo {
    opacity: 1;
    pointer-events: auto;
}

/* FLECHAS LIGHTBOX CON RAFAGA EN BUCLE */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100001;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: rafagaGlowBucle 10.5s infinite ease-in-out;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox-nav.prev { left: 4%; }
.lightbox-nav.next { right: 4%; }

.lightbox-nav:hover {
    background: #0071e3;
    border-color: #0071e3;
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 0 30px rgba(0, 113, 227, 0.85), 0 0 60px rgba(0, 113, 227, 0.4);
    animation: none;
}

.lightbox-contenido {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* CONTENEDOR FOTO + BOTONERA AL LADO Y ALINEADA ARRIBA */
.visor-lightbox-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.visor-lightbox-frame {
    position: relative;
    display: inline-block;
    padding: 10px;
    border-radius: 12px;
}

.visor-lightbox-frame .esquina-visor {
    border-color: rgba(0, 113, 227, 0.8);
    width: 20px;
    height: 20px;
}

.visor-lightbox-frame img {
    max-width: 82vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    display: block;
}

/* BOTONERA LATERAL DERECHA (CERRAR Y DESCARGAR) */
.lightbox-acciones-laterales {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* BOTÓN DE CERRAR (X) Y DESCARGAR (DESAPARECEN/APARECEN CON EL MISMO ESTILO Y ANIMACIÓN) */
.lightbox-cerrar,
.lightbox-btn-descargar {
    position: relative;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    z-index: 30;
    animation: rafagaGlowBucle 10.5s infinite ease-in-out;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox-cerrar:hover {
    background: #0071e3;
    border-color: #0071e3;
    color: #ffffff;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 0 25px rgba(0, 113, 227, 0.85), 0 0 50px rgba(0, 113, 227, 0.4);
    animation: none;
}

.lightbox-btn-descargar:hover {
    background: #0071e3;
    border-color: #0071e3;
    color: #ffffff;
    transform: scale(1.15) translateY(2px);
    box-shadow: 0 0 25px rgba(0, 113, 227, 0.85), 0 0 50px rgba(0, 113, 227, 0.4);
    animation: none;
}

.lightbox-info {
    margin-top: 12px;
    text-align: center;
}

.lightbox-info h3 {
    font-size: 1.1rem;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 3px;
}

.lightbox-info p {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: #0071e3;
}

/* RÁFAGA ESTILO HAMBURGUESA */
@keyframes rafagaGlowBucle {
    0% {
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 0px transparent;
    }
    12% {
        border-color: rgba(0, 113, 227, 0.85);
        box-shadow: 0 0 20px rgba(0, 113, 227, 0.65), 0 0 40px rgba(0, 113, 227, 0.25);
    }
    28% {
        border-color: rgba(0, 113, 227, 0.85);
        box-shadow: 0 0 20px rgba(0, 113, 227, 0.65), 0 0 40px rgba(0, 113, 227, 0.25);
    }
    40%, 100% {
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 0px transparent;
    }
}

/* KEYFRAMES TOOLTIP */
@keyframes desvanecimientoBucle {
    0% {
        opacity: 0;
        transform: scale(0.8) translateX(15px);
    }
    4% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
    20% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
    24% {
        opacity: 0;
        transform: scale(0.8) translateX(15px);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateX(15px);
    }
}

@keyframes reboteHorizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-6px); }
}

/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    .contenedor-texto {
        max-width: 100%;
    }
    .formato-vertical,
    .formato-horizontal,
    .formato-cuadrado {
        width: 280px;
        height: 360px;
    }
    .boton-carrusel {
        display: none;
    }
    .lightbox-nav {
        width: 46px;
        height: 46px;
        font-size: 1.8rem;
    }
    .visor-lightbox-layout {
        flex-direction: column;
        gap: 10px;
    }
    .lightbox-acciones-laterales {
        flex-direction: row;
        gap: 10px;
        align-self: flex-end;
    }
    .lightbox-cerrar,
    .lightbox-btn-descargar {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
}