/* ===== HEADER PRINCIPAL ===== */
header {
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: relative;
    transition: height 0.3s ease;
}

/* ===== LOGO ===== */
.logo {
    flex-shrink: 0;
}

.logo img {
    max-height: 45px;
    width: auto;
    transition: max-height 0.3s ease;
}

/* ===== ACTIONS (HAMBURGUESA) ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Botón hamburguesa */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===== ESTADO STICKY (SCROLLED) ===== */
header.scrolled {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

header.scrolled .header-content {
    height: 60px;
}

header.scrolled .logo img {
    max-height: 40px;
}

/* ===== MENÚ EN STICKY - CORRECCIÓN FORZADA ===== */
header.scrolled .nav-menu > li > a {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
}

header.scrolled .btn-acceso {
    padding: 3px 16px !important;
    font-size: 0.8rem !important;
    line-height: 1 !important;
}

header.scrolled .dropdown-menu {
    top: 42px !important;  /* Altura aproximada del header scrolled */
}

header.scrolled .dropdown-submenu .dropdown-menu {
    top: 0 !important;
    left: 100% !important;
}

header.scrolled .dropdown-menu a {
    padding: 8px 16px !important;
}

header.scrolled .dropdown-submenu > a::after {
    display: block !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: white;
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
    }
    
    .main-nav.active {
        left: 0;
    }
    
    /* Sticky en móvil */
    header.scrolled .main-nav {
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    /* En móvil los dropdowns son estáticos */
    header.scrolled .dropdown-menu {
        position: static !important;
        top: auto !important;
    }
}