/* ============================================
   COMPONENTES REUTILIZABLES - VERSIÓN CORREGIDA
   ============================================ */

/* ===== NAVEGACIÓN PRINCIPAL ===== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    background: rgba(1, 1, 1, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(32, 32, 32, 0.5);
    z-index: 1000;
    transition: all 0.4s ease;
}

nav.scrolled {
    padding: 10px 50px;
    background: rgba(1, 1, 1, 0.98);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.logo-nav {
    cursor: pointer;
}

.logo-nav img {
    height: 45px;
    transition: all 0.4s ease;
}

.logo-nav:hover img {
    transform: scale(1.05);
}

nav > ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 20px;
}

nav > ul > li > a {
    text-decoration: none;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.4s ease;
    padding: 5px 0;
    white-space: nowrap;
    position: relative;
}

nav > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #D4AF37, #E63946);
    transition: width 0.3s ease;
}

nav > ul > li > a:hover::after,
nav > ul > li > a.active::after {
    width: 100%;
}

/* ===== SUBMENÚ ESCRITORIO ===== */
.has-submenu {
    position: relative;
}

.has-submenu > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.has-submenu > a::after {
    content: '▼';
    font-size: 0.55rem;
    margin-left: 0;
    background: none;
    width: auto;
    height: auto;
    position: relative;
    top: 1px;
    transition: transform 0.2s ease;
}

.has-submenu:hover > a::after {
    transform: translateY(2px);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(1, 1, 1, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(32, 32, 32, 0.5);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    list-style: none;
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li a {
    display: block;
    padding: 10px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.submenu li a:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.2), transparent);
    color: #D4AF37;
    padding-left: 25px;
}

/* ===== BOTÓN LOGIN ===== */
.btn-login {
    padding: 10px 25px;
    border: 2px solid #D4AF37;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
    background: transparent;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.4s ease;
}

.btn-login:hover {
    background-color: #D4AF37;
    color: #010101;
    transform: translateY(-2px);
}

/* ===== MENÚ MÓVIL ===== */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
}

.close-menu {
    display: none;
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1002;
}

/* ===== RESPONSIVE MÓVIL (CORREGIDO) ===== */
@media (max-width: 768px) {
    nav {
        padding: 15px 20px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    nav > ul {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(1, 1, 1, 0.98);
        backdrop-filter: blur(20px);
        padding: 100px 30px 50px;
        text-align: center;
        z-index: 999;
        transition: left 0.4s ease;
        overflow-y: auto;
        gap: 20px;
    }
    
    nav > ul.active {
        left: 0;
    }
    
    nav > ul > li {
        opacity: 0;
        transform: translateX(-20px);
        animation: slideIn 0.4s ease forwards;
    }
    
    nav > ul > li:nth-child(1) { animation-delay: 0.05s; }
    nav > ul > li:nth-child(2) { animation-delay: 0.1s; }
    nav > ul > li:nth-child(3) { animation-delay: 0.15s; }
    nav > ul > li:nth-child(4) { animation-delay: 0.2s; }
    nav > ul > li:nth-child(5) { animation-delay: 0.25s; }
    nav > ul > li:nth-child(6) { animation-delay: 0.3s; }
    nav > ul > li:nth-child(7) { animation-delay: 0.35s; }
    
    @keyframes slideIn {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    nav > ul > li > a {
        font-size: 1rem;
        letter-spacing: 2px;
        padding: 10px 0;
        display: inline-block;
    }
    
    /* ===== SUBMENÚ EN MÓVIL - VERSIÓN DESPLEGABLE HACIA ABAJO ===== */
    .has-submenu {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .has-submenu > a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }
    
    .has-submenu > a::after {
        content: '▼';
        font-size: 0.7rem;
        margin-left: 0;
        display: inline-block;
        transition: transform 0.3s ease;
        position: static;
    }
    
    .has-submenu.active > a::after {
        transform: rotate(180deg);
    }
    
    /* Submenú que se despliega hacia abajo (no flotante) */
    .submenu {
        position: static;
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid #D4AF37;
        border-radius: 8px;
        margin-top: 10px;
        padding: 8px;
        min-width: auto;
        width: 100%;
        max-width: 250px;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    
    .has-submenu.active .submenu {
        display: block;
        animation: fadeInDown 0.25s ease;
    }
    
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .submenu li {
        margin: 0;
    }
    
    .submenu li a {
        padding: 10px 15px;
        font-size: 0.85rem;
        text-align: center;
        white-space: nowrap;
        display: block;
        border-radius: 6px;
    }
    
    .submenu li a:hover {
        background: rgba(212, 175, 55, 0.2);
        padding-left: 15px;
    }
    
    .btn-login {
        padding: 12px 30px;
        font-size: 1rem;
        margin-top: 10px;
        display: inline-block;
    }
    
    .logo-nav img {
        height: 35px;
    }
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-40 {
    margin-top: 40px;
}

.mb-40 {
    margin-bottom: 40px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(32, 32, 32, 0.6);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #D4AF37, #E63946);
    border-radius: 4px;
}