

:root{
    --header-height: 64px;
    /*--color-fondo: rgb(23, 23, 23);*/
    --bg: rgb(9, 9, 9);
    --bg-2: var(--bg);
    --text: #e8eaf0;
    --muted: #a7b0c0;
    --accent: #0ea5e9;
    --accent-2: #38bdf8;
    --shadow: 0 4px 14px rgba(0,0,0,.18);
    --radius: 4px;
    --submenu-gap: 0px;
  }

/* Menú principal */
.nav {
    justify-self: center;
}

.menu.level-1 {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 8px;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    border: 0;
    cursor: pointer;

    transition: transform 0.2s ease;  /* animación suave */
}

.menu-link:hover,
.menu-link:focus-visible {
    /*background: rgba(255, 255, 255, .08);*/
    transform: translateY(-8px); 
    
}

.menu-link.is-active {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Submenú */
.has-submenu>.submenu {
    position: absolute;
    left: 0;
    top: calc(100% + var(--submenu-gap));
    min-width: 220px;
    padding: 8px;
    margin: 0;
    list-style: none;
    background: var(--bg-2);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
    z-index: 1;
}

/* Desktop: hover/focus abre submenús + puente */
@media (min-width: 520px) {

    .has-submenu:hover>.submenu,
    .has-submenu:focus-within>.submenu {
        display: block;        
    }

    .has-submenu>.submenu::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        height: var(--submenu-gap);
        top: calc(-1 * var(--submenu-gap));
    }
}

.submenu.level-2 li a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.submenu.level-2 li a:hover,
.submenu.level-2 li a:focus-visible {
    background: rgba(255, 255, 255, .08);
}

.chev {
    font-size: .9em;
    opacity: .8;
    transform: translateY(1px);
}

/* Botón hamburguesa */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    background: rgba(255, 255, 255, .06);
}

.nav-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}




.menu-item button{
    color: var(--text);    
    font-weight: 600;
    font-size: 16px;
}

.logo a span{
    color: white;
    position: relative;
    top:-7px;
    left:-9px;
}


/* --------- MÓVIL / TABLET ---------- */
@media (max-width: 520px) {
    .nav-container {
        grid-template-columns: auto 1fr auto;
    }

    .nav-toggle {
        display: inline-block;
    }

    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        bottom: 0;
        width: 150px;
        background: var(--bg);
        border-right: 1px solid rgba(255, 255, 255, .06);
        transform: translateX(-100%);
        transition: transform .3s ease;
        z-index: 999;
    }

    .nav.open {
        transform: translateX(0);
    }

    .menu.level-1 {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 16px 12px;
    }

    .has-submenu>.submenu {
        position: static;
        display: none;
        padding: 6px;
        margin-top: 6px;
        background: var(--bg-2);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, .06);
    }

    .has-submenu.open>.submenu {
        display: block;
        min-width: unset;
    }

    .submenu-toggle .chev {
        transition: transform .2s ease;
    }

    .has-submenu.open .submenu-toggle .chev {
        transform: rotate(180deg);
    }

    .logo img {
        /*width: 150px;*/
    }
    .logo a span{
        font-size: 13px;
        top:-5px;
        left:-9px;
    }
}