/* ==========================================
   HEADER TECH - CYBER INDUSTRIAL STYLE
   ========================================== */

:root {
    --header-bg: #0b0c10;      /* Negro Profundo */
    --header-border: #1f2833;  /* Gris Azulado Oscuro */
    --tech-cyan: #66fcf1;      /* Cyan Neon */
    --tech-white: #ffffff;
    --header-height: 80px;     /* Altura fija del header */
}

/* 1. ESTRUCTURA BASE */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    background-color: rgba(11, 12, 16, 0.95); 
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%; /* Asegura que el contenedor interno ocupe toda la altura */
}

/* 2. LOGOTIPO TECH & CONTROL DE IMAGEN (FIX) */
.site-branding {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 250px; /* Límite de ancho para no empujar el menú */
}

.logo-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
}

/* --- REGLA DE ORO PARA EL LOGO --- */
.custom-logo-link {
    display: flex;
    align-items: center;
    height: 100%;
}

.custom-logo {
    max-height: 80px; /* Forzamos a que mida 50px de alto máximo (cabe en los 80px del header) */
    width: auto;      /* El ancho se ajusta solo */
    height: auto;     /* Mantiene proporción */
    object-fit: contain; /* Asegura que no se deforme */
    display: block;
}

/* Estilos para Texto Fallback (Si no hay imagen) */
.logo-text-tech {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.5px;
    text-transform: lowercase; 
}

.text-neon {
    color: var(--tech-cyan);
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.3); 
}

.text-white {
    color: var(--tech-white);
}

/* 3. NAVEGACIÓN DE ESCRITORIO */
.main-navigation {
    display: none; 
}

@media (min-width: 992px) {
    .main-navigation {
        display: block;
    }
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
    align-items: center; /* Centrado vertical */
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: #c5c6c7; 
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 0;
    transition: color 0.3s ease;
    font-family: monospace; 
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--tech-cyan);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--tech-cyan);
}

.nav-menu a:hover {
    color: var(--tech-white);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* 4. MENÚ MÓVIL (HAMBURGUESA) */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

@media (min-width: 992px) {
    .menu-toggle { display: none; }
}

.tech-bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--tech-cyan);
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(102, 252, 241, 0.5);
}

/* Estado Activo (X) */
.menu-open .tech-bar.top {
    transform: rotate(45deg) translate(5px, 6px);
}
.menu-open .tech-bar.mid {
    opacity: 0;
}
.menu-open .tech-bar.bot {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ==========================================
   FIX: 5. MENÚ MÓVIL DESPLEGABLE (Refactorizado)
   ========================================== */
@media (max-width: 991px) {
    .main-navigation {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: rgba(15, 17, 19, 0.98); /* Fondo casi sólido */
        backdrop-filter: blur(15px); /* Efecto cristal tech */
        border-bottom: 1px solid var(--header-border);
        padding: 20px 0;
        
        /* ESTADO INICIAL (OCULTO) */
        opacity: 0;
        visibility: hidden; /* Crucial: lo saca del flujo de clicks */
        transform: translateY(-20px); /* Desplazamiento sutil hacia arriba */
        
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        display: block;
        z-index: 900; /* Debajo del header (1000) pero encima del contenido */
        box-shadow: none;
    }

    /* ESTADO ACTIVO (VISIBLE) */
    .main-navigation.toggled {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
        width: 100%;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(102, 252, 241, 0.1); /* Separador sutil cyan */
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 15px 30px; /* Padding lateral para que no pegue al borde */
        font-size: 1.1rem;
        color: #c5c6c7;
    }
    
    .nav-menu a:hover {
        background-color: rgba(102, 252, 241, 0.05);
        color: var(--tech-cyan);
        padding-left: 40px; /* Pequeña animación de desplazamiento al hover */
    }
    
    .nav-menu a::after {
        display: none;
    }
}
/* Fin del media query y del archivo */