/* ===== MENÚ PRINCIPAL (DESKTOP) ===== */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
    align-items: center;
    height: 100%;
}

.nav-menu > li {
    position: relative;
    margin: 0;
}

/* ENLACES NIVEL 1 */
.nav-menu > li > a {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu > li > a:hover {
    background-color: #f0f2f5;
    color: var(--color-primario);
}

/* ===== FLECHA INDICADORA (NIVEL 1) ===== */
.dropdown > .dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: opacity 0.2s ease;
    opacity: 0.7;
    vertical-align: middle;
}

.dropdown:hover > .dropdown-toggle::after {
    opacity: 1;
}

/* ===== DROPDOWNS (NIVEL 2) ===== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 285px;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 3px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
    border: 1px solid transparent !important;
}

.dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    position: relative;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #4a5568;
/*    font-family: 'Roboto', sans-serif; */
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: normal;
    word-wrap: break-word;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--color-primario);
    border-left-color: var(--color-primario);
}

/* ===== SUBMENÚS (NIVEL 3) ===== */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: 5px;
    transform: translateX(-5px);
}

.dropdown-submenu:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* FLECHA PARA SUBMENÚS (NIVEL 2 CON HIJOS) */
.dropdown-submenu > a {
    position: relative;
    padding-right: 30px;
}

.dropdown-submenu > a::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-left-color: #a0aec0;
    transition: opacity 0.2s ease;
    opacity: 0.7;
}

.dropdown-submenu:hover > a::after {
    opacity: 1;
    border-left-color: var(--color-primario);
}

/* ===== DIVISOR ===== */
.dropdown-divider {
    height: 1px;
    background: #5a5a5a;
    margin: 4px 0;
}

/* ===== BOTÓN PORTAL CLIENTES ===== */
.acceso-clientes {
    margin-left: 10px;
}

.btn-acceso {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--color-primario) !important;
    padding: 6px 12px !important;
    border-radius: 30px !important;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease;
    border: 1px solid  var(--color-primario) !important;
    white-space: nowrap;
    text-decoration: none;
}

.btn-acceso:hover {
    background: var(--color-primario) !important;
    color: white !important;
}

.btn-acceso svg {
    width: 16px;
    height: 16px;
}

/* ===== FORMULARIO LOGIN EN HEADER ===== */
.form-login-header {
    display: flex;
    align-items: center;
    gap: 0rem;
    background: #f1f3f5;
    padding: 0.2rem 0.3rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.form-login-header:hover {
    background: white;
}

.login-campos {
    display: flex;
    gap: 0.3rem;
}

.login-input {
    background: white;
    border: none;
    border-radius: 4px;
    padding: 0rem 0rem;
    font-size: 0.7rem;
    width: 80px;
    text-align: center;
    outline: none;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-input:hover {
    border-color: var(--color-primario);
    background: #f1f3f5;
}

.login-input:focus {
    color: var(--color-primario);
    border: 1px solid var(--color-primario);
}

.login-boton {
    background: var(--color-primario);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s;
    white-space: nowrap;
}

.login-boton:hover {
    background: #3a80f2;
}


/* ===== MENÚ HAMBURGUESA (MÓVIL) ===== */
@media (max-width: 768px) {

    /* CONTENEDOR PRINCIPAL - 70% ANCHO */
    .main-nav {
        position: fixed;
        top: 70px;
        left: -70%;  /* Coincide con el ancho */
        width: 70% !important;
        height: calc(100vh - 70px);
        background: white;
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        margin: 0;
        padding: 0;
    }
    
    .main-nav.active {
        left: 0 !important;
    }

    /* LISTA PRINCIPAL */
    .nav-menu {
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0 3px;
        width: calc(100% - 6px);
        background: white;
        list-style: none;
    }

    /* ITEMS DE TODOS LOS NIVELES */
    .nav-menu li {
        width: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    /* ===== NIVEL 1 ===== */
    .nav-menu > li > a {
        display: block;
        padding: 0.5rem 0.75rem !important;
        background: var(--color-primario) !important;
        color: white !important;
        border-radius: 6px;
        font-weight: 500;
        width: 100%;
        text-decoration: none;
        transition: filter 0.2s ease;
        font-size: 0.9rem;
        line-height: 1.6;
        border: none;
        outline: none;
        box-shadow: none;
        margin: 0;
    }

    .nav-menu > li > a:hover {
        filter: brightness(1.1);
        background: var(--color-primario) !important;
        color: white !important;
    }
    
    .nav-menu > li > a:hover {
    background-color: transparent;  /* ← Cambiá esto */
    color: var(--color-primario);
    }
    

    /* ===== NIVEL 2 ===== */
    .dropdown-menu li > a {
        display: block;
        padding: 0.5rem 0.75rem !important;
        background: #3a80f2 !important;
        color: white !important;
        font-size: 1rem;
        font-weight: 500;
        width: 100%;
        text-decoration: none;
        border: none;
        outline: none;
        border-radius: 6px;
    }

    .dropdown-menu li > a:hover {
        background: #e8e8e8 !important;
        color: #111 !important;
    }

    /* ===== NIVEL 3 ===== */
    .dropdown-submenu .dropdown-menu li > a {
        display: block;
        padding: 0.5rem 0.75rem !important;
        background: #cde6ff !important;
        color: var(--color-primario) !important;
                font-size: 1rem;
        font-weight: 500;
        width: 100%;
        text-decoration: none;
        border: 1px solid var(--color-primario) !important;
        border-radius: 6px;
    }

    .dropdown-submenu .dropdown-menu li > a:hover {
        background: #e0e0e0 !important;
        color: #111 !important;
    }

    /* DROPDOWNS */
    .dropdown-menu,
    .dropdown-submenu .dropdown-menu {
        display: none;
        position: static;
        box-shadow: none;
        padding: 0;
        margin: 0;
        width: 100%;
        background: transparent;
    }

    .dropdown.active > .dropdown-menu,
    .dropdown-submenu.active > .dropdown-menu {
        display: block;
    }

    /* OCULTAR FLECHAS */
    .dropdown-submenu > a::after,
    .dropdown-toggle::after {
        display: none !important;
    }

    /* BOTÓN PORTAL */
    .acceso-clientes {
        padding: 0.75rem;
        background: white;
        width: 100%;
        box-sizing: border-box;
    }

    .btn-acceso {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.75rem;
        background: var(--color-primario);
        color: white !important;
        border-radius: 25px;
        font-weight: 500;
        text-decoration: none;
        transition: filter 0.2s ease;
    }

    .btn-acceso:hover {
        filter: brightness(1.1);
        background: var(--color-primario);
        color: white !important;
    }
    .form-login-header {
        flex-direction: column;
        align-items: stretch;
        background: transparent;
        border: none;
        padding: 0;
        gap: 0.5rem;
    }
    
    .login-campos {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .login-input {
        width: 100%;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.6rem;
    }
    
    .login-boton {
        width: 100%;
        text-align: center;
        padding: 0.6rem;
    }    
    
}