/* ==================== RESET Y VARIABLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --dark: #1a1a2e;
    --light: #f7f7f7;
    --gray: #e2e8f0;
    --dark-gray: #4a5568;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light);
    color: var(--dark);
    overflow-x: hidden;
}

/* ==================== HEADER Y NAVEGACIÓN ==================== */
.main-header {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Logo */
.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    transition: var(--transition-fast);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ==================== BOTÓN HAMBURGUESA ==================== */
.hamburger-menu {
    display: none;  /* Oculto por defecto en desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.hamburger-menu:hover {
    background: var(--gray);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    margin: 5px 0;
    transition: var(--transition-normal);
    border-radius: 2px;
}

/* Animación del botón cuando está activo */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==================== NAVEGACIÓN PRINCIPAL ==================== */
.main-nav {
    transition: var(--transition-normal);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--gray);
    color: var(--primary);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    list-style: none;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-normal);
    z-index: 1000;
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.2rem;
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition-fast);
    border-radius: 4px;
}

.dropdown-menu li a:hover {
    background: var(--gray);
    color: var(--primary);
    padding-left: 1.5rem;
}

/* Overlay del menú móvil */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== RESPONSIVE - MÓVIL ==================== */
@media (max-width: 768px) {
    .header-container {
        padding: 0.75rem 1rem;
    }
    
    /* Mostrar botón hamburguesa en móvil */
    .hamburger-menu {
        display: block;
    }
    
    /* Navegación móvil (inicialmente oculta) */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: white;
        box-shadow: var(--shadow-xl);
        z-index: 999;
        padding: 80px 20px 20px;
        transition: right var(--transition-normal);
        overflow-y: auto;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: 1rem;
        font-size: 1.1rem;
        white-space: normal;
        text-align: left;
    }
    
    /* Dropdown en móvil */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--gray);
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height var(--transition-normal);
        border-radius: 8px;
        margin-top: 0.5rem;
    }
    
    .nav-item.dropdown.active .dropdown-menu {
        max-height: 300px;
    }
    
    .dropdown-menu li a {
        padding: 0.75rem 1rem 0.75rem 2rem;
    }
    
    /* Indicador de dropdown en móvil */
    .dropdown > .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .dropdown > .nav-link::after {
        content: '▼';
        font-size: 0.7rem;
        transition: transform var(--transition-fast);
    }
    
    .nav-item.dropdown.active > .nav-link::after {
        transform: rotate(180deg);
    }
}

/* ==================== TABLETS (opcional) ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* ==================== ANIMACIONES ==================== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.main-nav.active {
    animation: slideIn var(--transition-normal) ease;
}

/* Evitar scroll cuando el menú está abierto */
body.menu-open {
    overflow: hidden;
}