header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #333;
    color: white;
}

.header-elegante {
    background: #1a2236;
    box-shadow: 0 2px 16px rgba(0,0,0,0.18);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    padding: 0 0 18px 0;
    margin-bottom: 32px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 32px 0 32px;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
    position: relative;
}

.menu {
    list-style: none;
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0;
    background: none;
}

.menu li {
    display: inline;
}

.menu a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    transition: 0.3s;
}

.menu li a {
    color: #e9ecef;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 8px 18px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}
.menu li a:hover,
.menu li a:focus {
    background: #0ef6cc;
    color: #101624;
}

.menu-toggle {
    display: none;
}

@media (max-width: 900px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        padding: 18px 8px 0 8px;
    }
    .avatar {
        margin: 0 0 12px 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #333;
        text-align: center;
    }

    .menu.show {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

@media (max-width: 1244px) {
    .menu-toggle {
        display: block;
    }
    .menu {
        flex-direction: column;
        gap: 0;
        background: var(--color-primario);
        position: fixed;
        top: 0;
        left: -260px;
        width: 240px;
        height: 100vh;
        display: flex;
        z-index: 9999;
        border-top-right-radius: var(--radio);
        border-bottom-right-radius: var(--radio);
        box-shadow: 4px 0 16px rgba(0,0,0,0.18);
        padding-top: 80px;
        transition: left 0.3s cubic-bezier(.4,2,.6,1);
    }
    .menu.show {
        left: 0;
    }
}

@media (min-width: 1245px) {
    .menu-toggle {
        display: none !important;
    }
    .menu {
        display: flex !important;
        flex-direction: row;
        position: static;
        background: none;
        box-shadow: none;
        border-radius: 0;
        gap: 32px;
        width: auto;
        height: auto;
        padding-top: 0;
        left: 0;
        transition: none;
    }
}

/* Oculta el botón del menú hamburguesa en escritorio y lo muestra solo en dispositivos pequeños */
.menu-toggle {
    display: none;
}

@media (max-width: 991.98px) {
    .menu-toggle {
        display: block !important;
    }
    .menu {
        flex-direction: column;
        gap: 0;
        background: #232b43;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        z-index: 9999;
        border-radius: 0 0 14px 14px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.18);
        padding-top: 90px;
        padding-left: 0;
        padding-right: 0;
        align-items: center;
        justify-content: flex-start;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(.4,2,.6,1);
    }
    .navbar-collapse.collapse:not(.show) .menu {
        left: -100vw;
    }
    .navbar-collapse.show .menu {
        left: 0;
    }
    .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #232b43;
        z-index: 9998;
        border-radius: 0 0 14px 14px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.18);
        padding-top: 0;
        transition: left 0.3s cubic-bezier(.4,2,.6,1);
    }
    .navbar-collapse.collapse:not(.show) {
        left: -100vw;
    }
    .navbar-collapse.show {
        left: 0;
    }
    .menu li {
        width: 100%;
        text-align: center;
        margin: 0;
    }
    .menu li a {
        display: block;
        width: 100%;
        padding: 18px 0;
        font-size: 1.2rem;
        border-radius: 0;
        color: #e9ecef;
        background: none;
    }
    .menu li a:hover,
    .menu li a:focus {
        background: #0ef6cc;
        color: #101624;
    }
}
