/* ===== PORTADA KERMÉS 2026 ===== */
.gallery-cover-wrapper {
    max-width: 920px;
    margin: 0 auto 56px;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(196, 181, 253, 0.22);
    box-shadow: 
        0 0 0 1px rgba(196, 181, 253, 0.22),
        0 24px 80px rgba(0, 0, 0, 0.75),
        0 0 42px rgba(139, 92, 246, 0.18);
    transition: all var(--transition-smooth);
    aspect-ratio: 16 / 9;
    background: #000;
}

.gallery-cover-wrapper:hover {
    border-color: rgba(196, 181, 253, 0.5);
    box-shadow: 
        0 0 0 1px rgba(196, 181, 253, 0.35),
        0 24px 80px rgba(0, 0, 0, 0.75),
        0 0 42px rgba(139, 92, 246, 0.18);
    transform: translateY(-4px);
}

.gallery-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
    filter: brightness(0.45) saturate(1.05);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-cover-wrapper:hover .gallery-cover-image {
    transform: scale(1.05);
}

.gallery-cover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

.gallery-cover-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 9vw, 8rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 
        0 5px 0 #6d28d9,
        0 18px 40px rgba(0, 0, 0, 0.95);
    margin-bottom: 8px;
}

.gallery-cover-subtitle {
    font-family: var(--font-display);
    font-size: clamp(0.85rem, 1.5vw, 1.15rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Responsive Portada */
@media (max-width: 768px) {
    .gallery-cover-wrapper {
        border-radius: var(--radius-lg);
        margin-bottom: 32px;
    }
    .gallery-cover-title {
        font-size: clamp(2.8rem, 10vw, 4.5rem);
    }
}

/* ===== GALERÍA PREMIUM (A PANTALLA COMPLETA) ===== */
.gallery-section {
    width: 100%;
    background:
        radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.14), transparent 32%),
        linear-gradient(180deg, #07070b 0%, #0d0b12 52%, #07070b 100%);
    padding: 64px 0 90px;
    position: relative;
    overflow: hidden;
}

.gallery-section::before,
.gallery-section::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(196, 181, 253, 0.35), transparent);
}

.gallery-section::before { top: 0; }
.gallery-section::after { bottom: 0; }

.gallery-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 56px;
    padding: 0 20px;
}

.gallery-header .section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #c4b5fd;
    font-weight: 800;
    margin-bottom: 16px;
    padding: 7px 16px;
    background: rgba(139, 92, 246, 0.12);
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.32);
}

.gallery-header h2 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 16px;
    color: #f5f3ff !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    text-shadow: 0 0 34px rgba(124, 58, 237, 0.35);
}

.gallery-header p {
    color: #b8adc9;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ===== GALLERY HEADER COMPACT ===== */
.gallery-header.compact {
    margin-bottom: 26px;
}

.gallery-header.compact h2,
.gallery-header.compact p {
    display: none;
}

/* ===== VIDEOS DESTACADOS (EFECTO 3D STACK) ===== */
.gallery-videos-section {
    width: min(100%, 1120px);
    margin: 0 auto 70px;
    padding: 0 24px;
    border-top: none;
}

.gallery-videos-section h3 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    color: #f5f3ff !important;
    font-size: clamp(1.1rem, 2.2vw, 1.55rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: var(--font-display);
    font-weight: 900;
    margin-bottom: 28px;
    text-align: center;
}

.gallery-videos-section h3::before,
.gallery-videos-section h3::after {
    content: "";
    width: min(26vw, 220px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.7), transparent);
}

.gallery-photos-section h3 {
    color: #f5f3ff !important;
    font-size: clamp(1.1rem, 2.2vw, 1.55rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: var(--font-display);
    font-weight: 900;
    margin-bottom: 28px;
    text-align: center;
}

/* Contenedor del carrusel 3D */
.video-stack-carousel {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
}

.video-stack-item {
    position: absolute;
    width: 250px;
    height: 430px;
    border-radius: 20px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    background: #000;
    overflow: hidden;
}

.video-stack-item::after {
    display: none !important;
    content: none !important;
}

.video-stack-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #000;
    filter: none !important;
    cursor: pointer;
}

.video-stack-item:hover video {
    filter: none !important;
}

/* =========================================================
   REPRODUCTOR DE VIDEO ESTILIZADO
   ========================================================= */
.video-stack-item video::-webkit-media-controls-panel {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent) !important;
    border-radius: 0 0 20px 20px !important;
    padding: 8px 12px !important;
}

.video-stack-item video::-webkit-media-controls-play-button {
    filter: brightness(0) invert(1);
    transform: scale(1.2);
}

.video-stack-item video::-webkit-media-controls-timeline {
    height: 4px !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

.video-stack-item video::-webkit-media-controls-current-time-display,
.video-stack-item video::-webkit-media-controls-time-remaining-display {
    color: #fff !important;
    font-family: var(--font-sans);
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8) !important;
}

.video-stack-item video::-webkit-media-controls-volume-slider,
.video-stack-item video::-webkit-media-controls-mute-button {
    filter: brightness(0) invert(1);
}

/* OCULTAR EL BOTÓN DE PANTALLA COMPLETA NATIVO */
.video-stack-item video::-webkit-media-controls-fullscreen-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.video-stack-item video::-webkit-media-controls-download-button {
    display: none !important;
}

.video-stack-item video::-webkit-media-controls-rewind-button,
.video-stack-item video::-webkit-media-controls-return-to-real-screen-button {
    display: none !important;
}

/* =========================================================
   BOTÓN DE PANTALLA COMPLETA PERSONALIZADO (OCULTO POR DEFECTO)
   ========================================================= */
.video-custom-fullscreen-btn {
    position: absolute;
    right: 12px;
    bottom: 54px;
    z-index: 10;

    width: 38px;
    height: 38px;
    border-radius: 999px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(7, 7, 11, 0.72);
    border: 1px solid rgba(196, 181, 253, 0.45);
    color: #ffffff;

    font-size: 1rem;
    cursor: pointer;
    pointer-events: none;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
    transition: all 0.25s ease;
    
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.video-custom-fullscreen-btn:hover {
    background: #7c3aed;
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
}

.video-custom-fullscreen-btn i {
    pointer-events: none;
}

/* =========================================================
   MOSTRAR EL BOTÓN AL INTERACTUAR CON EL VIDEO
   ========================================================= */
.video-stack-item:hover .video-custom-fullscreen-btn,
.video-stack-item:has(video:hover) .video-custom-fullscreen-btn,
.video-stack-item:has(video:focus) .video-custom-fullscreen-btn {
    opacity: 1;
    pointer-events: auto;
}

/* ===== BADGE ===== */
.video-vertical-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(7, 7, 11, 0.78);
    border: 1px solid rgba(196, 181, 253, 0.28);
    color: #f5f3ff;
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    pointer-events: none;
    transition: all 0.6s ease;
}

.video-vertical-badge i { color: #c4b5fd; font-size: 0.6rem; }

/* ===== POSICIONES Y ESCALAS FIJAS ===== */
.video-stack-item[data-index="0"] {
    transform: translateX(-160px) scale(0.85) rotateY(15deg);
    z-index: 1;
}
.video-stack-item[data-index="1"] {
    transform: translateX(0px) scale(1.1) rotateY(0deg);
    z-index: 3;
    border-color: #c4b5fd;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.4), 0 20px 50px rgba(0, 0, 0, 0.8);
}
.video-stack-item[data-index="2"] {
    transform: translateX(160px) scale(0.85) rotateY(-15deg);
    z-index: 1;
}

.video-stack-item[data-index="1"] .video-vertical-badge {
    background: rgba(124, 58, 237, 0.9);
    border-color: #c4b5fd;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* ===== CONTROLES DEL CARRUSEL ===== */
.video-stack-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.video-stack-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(21, 17, 31, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.video-stack-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #c4b5fd;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* ===== MODAL FULLSCREEN VERTICAL ===== */
.video-fullscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
}

.video-fullscreen-modal.active {
    display: flex;
}

.video-fullscreen-frame {
    position: relative;
    height: min(92vh, 860px);
    aspect-ratio: 9 / 16;
    border-radius: 28px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(196, 181, 253, 0.4);
    box-shadow: 0 0 70px rgba(139, 92, 246, 0.35);
}

.video-fullscreen-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.video-fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(196, 181, 253, 0.35);
    background: rgba(7, 7, 11, 0.72);
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s ease;
}

.video-fullscreen-close:hover {
    background: #7c3aed;
}

/* ===== CARRUSEL DE FOTOS ===== */
.gallery-photos-section {
    width: 100%;
    margin: 0;
    padding: 36px 0 0;
    border-top: 1px solid rgba(139, 92, 246, 0.18);
}

.carousel-horizontal-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow: hidden;
}

.carousel-row {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 10px 0;
}

.carousel-row::before,
.carousel-row::after {
    content: '';
    position: absolute;
    top: 0;
    width: 120px;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.carousel-row::before { left: 0; background: linear-gradient(90deg, #07070b, transparent); }
.carousel-row::after { right: 0; background: linear-gradient(-90deg, #07070b, transparent); }

.carousel-track-horizontal {
    display: flex;
    width: max-content;
    gap: 20px;
    will-change: transform;
}

.carousel-track-horizontal img {
    width: 320px;
    height: 200px;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 18px;
    border: 1px solid rgba(196, 181, 253, 0.18);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    filter: brightness(0.9) saturate(0.95);
    transition: transform 0.35s ease, filter 0.35s ease, border-color 0.35s ease;
}

.carousel-track-horizontal img:hover {
    transform: scale(1.05);
    filter: brightness(1.1) saturate(1.1);
    border-color: #c4b5fd;
    z-index: 4;
}

.carousel-row.left .carousel-track-horizontal { animation: scrollLeft 34s linear infinite; }
.carousel-row.right .carousel-track-horizontal { animation: scrollRight 34s linear infinite; }
.carousel-row:hover .carousel-track-horizontal { animation-play-state: paused; }

@keyframes scrollLeft { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes scrollRight { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.86);
    padding: 24px;
}

.lightbox.active { display: flex; }

.lightbox-content {
    max-width: min(94vw, 1100px);
    max-height: 86vh;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 22px;
    border: 1px solid rgba(196, 181, 253, 0.25);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

.lightbox-caption { margin-top: 12px; color: #f5f3ff; font-size: 0.9rem; }

.lightbox-close,
.lightbox-nav {
    position: absolute;
    border: 1px solid rgba(196, 181, 253, 0.25);
    background: rgba(21, 17, 31, 0.82);
    color: #f5f3ff;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.3s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover { background: #7c3aed; }

.lightbox-close { top: 24px; right: 24px; }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }

/* ===== AJUSTE DE IMÁGENES VERTICALES ===== */
.carousel-track-horizontal img.photo-portrait {
    object-fit: cover;
    object-position: top center;
}

.carousel-track-horizontal img.photo-top {
    object-position: center 8%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .video-stack-carousel { height: 420px; }
    .video-stack-item {
        width: 180px;
        height: 310px;
    }
    .video-stack-item[data-index="0"] { transform: translateX(-110px) scale(0.85) rotateY(15deg); }
    .video-stack-item[data-index="1"] { transform: translateX(0px) scale(1.05); }
    .video-stack-item[data-index="2"] { transform: translateX(110px) scale(0.85) rotateY(-15deg); }
    
    .video-fullscreen-frame { height: min(90vh, 700px); }
}

@media (max-width: 768px) {
    .gallery-section { padding: 72px 0 70px; }
    .gallery-header { margin-bottom: 40px; }
    .gallery-videos-section { margin-bottom: 52px; padding: 0 18px; }
    
    .video-stack-carousel { height: 340px; perspective: 800px; }
    .video-stack-item {
        width: 150px;
        height: 260px;
        border-radius: 14px;
    }
    .video-stack-item[data-index="0"] { transform: translateX(-80px) scale(0.85) rotateY(15deg); }
    .video-stack-item[data-index="1"] { transform: translateX(0px) scale(1.05) rotateY(0deg); }
    .video-stack-item[data-index="2"] { transform: translateX(80px) scale(0.85) rotateY(-15deg); }
    
    .video-custom-fullscreen-btn {
        right: 10px;
        bottom: 46px;
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    
    .carousel-track-horizontal img {
        width: 200px;
        height: 130px;
        border-radius: 14px;
    }
    .carousel-row::before, .carousel-row::after { width: 40px; }
    .lightbox-nav { display: none; }
}

@media (max-width: 480px) {
    .video-stack-carousel { height: 280px; }
    .video-stack-item {
        width: 120px;
        height: 200px;
    }
    .video-stack-item[data-index="0"] { transform: translateX(-60px) scale(0.8) rotateY(15deg); }
    .video-stack-item[data-index="1"] { transform: translateX(0px) scale(1) rotateY(0deg); }
    .video-stack-item[data-index="2"] { transform: translateX(60px) scale(0.8) rotateY(-15deg); }
    
    .video-custom-fullscreen-btn {
        right: 8px;
        bottom: 40px;
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}