/*
Theme Name:   Elementra Child
Description:  Un tema hijo para Elementra
Author:       Ayoze
Template:     elementra
Version:      1.0.0
*/

/* =========================================================================
   0. INICIALIZACIÓN GLOBAL (PREVENCIÓN DE OVERFLOW)
   ========================================================================= */
html, body {
    overflow-x: clip !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================================================
   6. SECCIÓN GLASS (PANTALLA PRINCIPAL)
   ========================================================================= */
.glass-section-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    background: transparent;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.glass-main-container {
    position: relative;
    width: 80vw;
    /* Ajustado a petición del usuario */
    height: 80vh;
    max-width: 1600px;
    border-radius: 40px;
    z-index: 20;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
    border: none;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translate3d(0, 0, 0) scale(1);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Efecto hover sobre el contenedor principal cuando no está abierto */
.glass-main-container:not(.active-mode):hover {
    transform: translate3d(0, 0, 0) scale(1.02);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

/* Estado Expandido */
.glass-main-container.active-mode {
    width: 96vw !important;
    height: 92vh !important;
    background: transparent;
    /* Se elimina el backdrop-filter duplicado aquí para evitar el error de "huellas" al scrollear */
}

/* Video de fondo dentro del cristal */
.glass-bg-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.glass-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out;
    opacity: 0;

    /* Aceleración por Hardware (GPU) para evitar congelación de frames */
    transform: translate(-50%, -50%) translateZ(0) !important;
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
    /* Por defecto invisibles para el difuminado */
    /* Ocultar controles */
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Lógica de opacidades para difuminado cruzado (Crossfade) */
.glass-bg-video.default-video {
    opacity: 1;
    /* El de defecto se ve de base */
}

/* Al abrir el panel Izquierdo (Media) */
.glass-main-container.mode-left .glass-bg-video.default-video {
    opacity: 0;
}

.glass-main-container.mode-left .glass-bg-video.media-video {
    opacity: 1;
}

/* Al abrir el panel Derecho (Live) */
.glass-main-container.mode-right .glass-bg-video.default-video {
    opacity: 0;
}

.glass-main-container.mode-right .glass-bg-video.live-video {
    opacity: 1;
}

.glass-bg-video::-webkit-media-controls,
.glass-bg-video::-webkit-media-controls-enclosure,
.glass-bg-video::-webkit-media-controls-panel,
.glass-bg-video::-webkit-media-controls-play-button,
.glass-bg-video::-webkit-media-controls-start-playback-button {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Capa y Overlays de Color */
.glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    transition: background 0.8s ease, backdrop-filter 0.8s ease;
}

.glass-main-container.mode-left .glass-overlay {
    background: rgba(59, 80, 234, 0.65);
    backdrop-filter: blur(20px);
}

.glass-main-container.mode-right .glass-overlay {
    background: rgba(255, 109, 109, 0.65);
    backdrop-filter: blur(20px);
}

/* Pseudo-elementos para gradient hover (laterales) */
.glass-overlay::before,
.glass-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    width: 70%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease;
    pointer-events: none;
}

.glass-overlay::before {
    left: 0;
    background: linear-gradient(90deg, rgba(59, 80, 234, 0.5) 0%, transparent 100%);
    transform: translateX(-30%);
}

.glass-overlay::after {
    right: 0;
    background: linear-gradient(270deg, rgba(255, 109, 109, 0.5) 0%, transparent 100%);
    transform: translateX(30%);
}

.glass-main-container.preview-left .glass-overlay::before {
    transform: translateX(0);
    opacity: 1;
}

.glass-main-container.preview-right .glass-overlay::after {
    transform: translateX(0);
    opacity: 1;
}

.glass-main-container.preview-left .glass-overlay,
.glass-main-container.preview-right .glass-overlay {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
}

/* =========================================================================
   7. TÍTULOS INICIALES Y DISPARADORES
   ========================================================================= */
.initial-triggers-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10%;
    box-sizing: border-box;
    z-index: 30;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.initial-triggers-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.trigger-text-group {
    display: flex;
    flex-direction: column;
    color: #ffffff;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.4s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.trigger-text-group .text-top {
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 5px;
    margin-left: 5px;
    z-index: 2;
}

.trigger-text-group .text-bottom {
    font-size: 2.8rem;
    font-weight: 700;
    margin-left: 5px;
    z-index: 2;
    transition: all 0.3s ease;
}

/* Efecto hover en texto */
.trigger-text-group:hover .text-top,
.trigger-text-group:hover .text-bottom {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.trigger-text-group .text-bottom {
    transition: transform 0.4s ease, text-shadow 0.4s ease;
}

.trigger-text-group:hover .text-bottom {
    transform: scale(1.05);
}

/* Limpieza de pseudo-elementos antiguos */
.trigger-text-group::before,
.trigger-text-group.left::before,
.trigger-text-group.right::before,
.trigger-text-group.left::after,
.trigger-text-group.right::after {
    display: none;
}

/* =========================================================================
   8. PANELES DE CONTENIDO
   ========================================================================= */
.content-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 40;
    overflow: hidden;
}

.content-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.panel-scrollable {
    overflow-y: auto;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-y: auto;
}

.panel-scrollable::-webkit-scrollbar {
    display: none;
}

.panel-inner-content {
    max-width: 1200px;
    margin: 50px auto;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 60px;
    padding-bottom: 60px;
    
    /* Solución para huellas / ghosting de render al hacer scroll */
    transform: translateZ(0); 
    will-change: transform;
}

.panel-header-logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
}

.panel-main-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
}

.panel-text-area {
    flex: 1;
    min-width: 300px;
    text-align: left;
    color: white;
}

.panel-title {
    font-family: 'Nunito', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #000312;
}

.panel-description {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.9;
}

.discover-btn {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    border-radius: 30px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.discover-btn:hover {
    background: white;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.panel-video-area {
    flex: 1;
    min-width: 300px;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    background: transparent;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.loop-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0);
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 100% !important;
    min-height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Ocultar controles en videos de panel */
.loop-video::-webkit-media-controls,
.loop-video::-webkit-media-controls-start-playback-button {
    display: none !important;
    opacity: 0 !important;
    -webkit-appearance: none !important;
}

.panel-form-area {
    width: 100%;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px 40px;
    background: rgba(255, 255, 255, 0.1);
    /* En caso de que haya demasiado cristal que cause trails, podemos comentarlo o dejarlo,
       pero al quitar el de active-mode suele ser suficiente. Lo dejamos sutil. */
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: white;
    font-family: 'Nunito', sans-serif;
    margin-top: 20px;
    min-height: auto;
    transform: translateZ(0);
}

.panel-form-area h3 {
    font-size: 1.5rem;
    opacity: 0.8;
}

/* =========================================================================
   9. BOTÓN DE CIERRE (X)
   ========================================================================= */
.close-arrow-container {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 100;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.glass-main-container.active-mode .close-arrow-container {
    opacity: 1;
    pointer-events: all;
    transition-delay: 0.5s;
}

.close-arrow {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.close-arrow svg {
    width: 24px;
    height: 24px;
    stroke: white;
    transition: all 0.4s ease;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.2));
}

.close-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(255, 255, 255, 0.3);
}

.close-arrow:hover svg {
    stroke: #ffffff;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
    transform: scale(1.1);
}

.close-arrow span {
    display: none;
}

/* =========================================================================
   10. ANIMACIÓN DIAGONAL ALEATORIA (WALKERS)
   ========================================================================= */
.caja-logos-diagonal {
    position: relative;
    overflow: hidden;
    display: block;
    pointer-events: none;
}

.walker-img {
    position: absolute;
    width: 100px;
    left: 0;
    bottom: -200px;
    opacity: 0;
    z-index: 1;
    object-fit: contain;
    transform: rotate(-25deg);
    animation: diagonalTravel 16s linear infinite;
    will-change: transform, opacity;
}

@keyframes diagonalTravel {
    0% {
        transform: translate(0, 0) rotate(-25deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translate(-250px, -1500px) rotate(-25deg);
        opacity: 0;
    }
}

/* =========================================================================
   11. EFECTO CRISTAL UNIFICADO (CRISTAL GLASS)
   ========================================================================= */
.cristal-glass {
    /* EFECTO CRISTAL (FLUID GLASS LINKED)
       Solo definimos estructura básica. El efecto visual (fondos, filtros) 
       es inyectado por javascript.js mediante la clase FluidGlass.
    */
    position: relative;
    z-index: 10;
    overflow: hidden;
    /* Necesario para que el SVG no se salga */
    border-radius: 20px;
    transition: all 0.3s ease;

    /* Eliminamos fondos/filtros aquí para que no se superpongan con el SVG JS */
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border: none;
}



.glass-header.cristal-glass {
    display: flex;
    align-items: flex-start;
}

.glass-surface__filter {
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: -1;
    border-radius: inherit;
}

.glass-surface__content {
    width: 100%;
    height: auto;
    /* Antes 100% - Esto causaba colapso en contenedores de altura automática */
    min-height: 100%;
    /* Asegura que cubra al menos el padre si este tiene altura fija */
    border-radius: inherit;
    position: relative;
    z-index: 1;
}

.glass-surface--svg {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: var(--filter-id, url(#glass-filter)) saturate(var(--glass-saturation, 1));
    /* Box Shadow simplificado para evitar problemas de compatibilidad */
    box-shadow:
        inset 0 0 2px 1px rgba(255, 255, 255, 0.15),
        inset 0 0 10px 4px rgba(255, 255, 255, 0.05),
        0 4px 16px rgba(17, 17, 26, 0.05),
        0 8px 24px rgba(17, 17, 26, 0.05);
}

.glass-surface--fallback {
    background: rgba(0, 3, 18, 0.08);
    backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px 0 rgba(31, 38, 135, 0.2),
        0 2px 16px 0 rgba(31, 38, 135, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.2);
}

/* Efecto Whitish permanente en el header (Blanquecino en lugar de oscuro) */
.glass-header.glass-surface--svg,
.glass-header.glass-surface--fallback {
    background: rgba(0, 0, 0, 0.15);
    /* Tono blanco con 0.1 de transparencia fijo */
    box-shadow:
        inset 0 0 2px 1px rgba(255, 255, 255, 0.2),
        inset 0 0 15px 5px rgba(255, 255, 255, 0.1),
        0 4px 16px rgba(17, 17, 26, 0.1),
        0 15px 30px rgba(17, 17, 26, 0.1);
}

@media (prefers-color-scheme: dark) {
    .glass-surface--fallback {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(12px) saturate(1.8) brightness(1.2);
        -webkit-backdrop-filter: blur(12px) saturate(1.8) brightness(1.2);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow:
            inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
            inset 0 -1px 0 0 rgba(255, 255, 255, 0.1);
    }
}

@supports not (backdrop-filter: blur(10px)) {
    .glass-surface--fallback {
        background: rgba(255, 255, 255, 0.4);
        box-shadow:
            inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
            inset 0 -1px 0 0 rgba(255, 255, 255, 0.3);
    }

    .glass-surface--fallback::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0.15);
        border-radius: inherit;
        z-index: -1;
    }

    @media (prefers-color-scheme: dark) {
        .glass-surface--fallback {
            background: rgba(0, 0, 0, 0.4);
        }

        .glass-surface--fallback::before {
            background: rgba(255, 255, 255, 0.05);
        }
    }
}

.cristal-glass:focus-visible {
    outline: 2px solid light-dark(#007aff, #0a84ff);
    outline-offset: 2px;
}

/* =========================================================================
   13. CONSULTAS DE MEDIOS (RESPONSIVE GLOBALES)
   ========================================================================= */

/* Tablets / Portátiles Pequeños (max-width: 1024px) */
@media (max-width: 1024px) {
    .menu-logos-container {
        gap: 40px;
    }

    .menu-logo-img {
        width: 130px;
    }

    .menu-links-container {
        gap: 30px;
    }
}

/* Tablets / Móviles Grandes (max-width: 768px) */
@media (max-width: 768px) {

    /* Header */
    .glass-header {
        width: 90%;
        padding: 12px 20px;
        height: 70px;
        top: 5%;
    }

    .glass-header.expanded {
        padding: 12px 20px 25px;
    }

    .menu-content {
        padding: 15px 0 0;
        gap: 25px;
    }

    .menu-logos-container {
        gap: 30px;
    }

    .menu-logo-img {
        width: 100px;
    }

    .menu-links-container {
        gap: 25px;
    }

    .menu-link-item {
        font-size: 1rem;
    }

    /* Modificaciones Contenedor Principal Móvil */
    .glass-main-container {
        width: 90vw;
        height: 85vh;
    }
    
    .glass-main-container:not(.active-mode):hover {
        transform: translate3d(0, 0, 0) scale(1);
    }
    
    .glass-main-container.active-mode {
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0;
    }

    /* Paneles y Triggers */
    .initial-triggers-container {
        flex-direction: column;
        justify-content: center;
        gap: 60px;
        text-align: center;
    }

    .trigger-text-group .text-bottom {
        font-size: 2.2rem;
    }
    
    .trigger-text-group .text-top {
        font-size: 1.2rem;
    }

    .panel-inner-content {
        margin: 20px auto;
        gap: 20px;
        padding-bottom: 40px;
    }

    .panel-header-logo img {
        height: 45px;
    }

    .panel-title {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .panel-description {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .panel-main-body {
        flex-direction: column;
        gap: 25px;
    }

    .panel-video-area {
        width: 100%;
        height: 250px;
    }
    
    .panel-form-area {
        padding: 20px;
    }

    /* Animación Diagonal (Walkers) */
    .walker-img {
        width: 70px;
    }

    /* Footer */
    .evc-footer-wrapper {
        padding: 60px 20px;
        justify-content: center;
    }

    .evc-footer-main {
        padding: 40px 30px;
        max-width: 100%;
    }

    .evc-footer-city {
        font-size: 1.8rem;
    }
}

/* Móviles (max-width: 480px) */
@media (max-width: 480px) {
    .menu-content {
        padding: 10px 0 0;
        gap: 20px;
    }

    .menu-logos-container {
        gap: 20px;
    }

    .menu-logo-img {
        width: 80px;
    }

    .menu-links-container {
        gap: 20px;
    }

    .menu-link-item {
        font-size: 0.9rem;
    }
}
