/* Estilos generales del menú */
.navbar {
    padding: 0.5rem 1rem;
}
.menu-desktop{
    width: 600px;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

/* Menú desktop */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}
.sticky-mobile {
    position: sticky;
    top: 0;
    z-index: 1030; /* igual que fixed-top */
}
/* Fuerza el caret de dropstart a seguir apuntando hacia abajo */
.dropstart .dropdown-toggle::after {
    display: inline-block;
    margin-left: .255em;
    vertical-align: .255em;
    content: "";
    border-top: .3em solid;      /* triangulito hacia abajo */
    border-right: .3em solid transparent;
    border-bottom: 0;
    border-left: .3em solid transparent;
}

/* Anula el pseudo que Bootstrap pone en dropstart (::before con flecha izquierda) */
.dropstart .dropdown-toggle::before {
    display: none !important;
}




/* Estilos para mobile */
@media (max-width: 992px) {

    
    .navbar-collapse {
        background: #f8f9fa;
        padding: 0.5rem;
        margin-top: 0.5rem;
        border-radius: 0.25rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    }

    .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin: 0;
        border: none;
        box-shadow: none;
        display: none;
        padding-left: 1rem;
        background-color: transparent !important;
    }

    .dropdown-submenu .dropdown-menu {
        margin-left: 1rem;
    }
    .dropstart .dropdown-toggle::after {
        content: "+";
        border: none;
        font-size: 20px;
        line-height: 1;
        margin-left: 0;
        margin-right: 0;
    }
    .dropdown-toggle::after {
        display: inline-block;
        margin-left: 0.5em;
        content: "+";
        line-height: 1;
        font-size: 35px;
        border: none;
        font-weight: bold;
        float: right;
    }

    .dropdown-toggle[aria-expanded="true"]::after {
        content: "-";
        border: none;
        font-size: 35px;
        line-height: 1;
    }
	
	.dropdown-toggle.show::after {
        content: "-";
        border: none;
        font-size: 35px;
        line-height: 1;
		margin-top: -8px;
    }

    .dropdown-item {
        padding: 0.5rem 1rem;
        white-space: normal;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .navbar-nav .nav-item {
        border-bottom: 1px solid #e9ecef;
    }

    .dropdown-menu.show {
        display: block !important;
    }
    /* Asegurar que el contenedor del menú pueda hacer scroll en móviles */
    .navbar-collapse {
        max-height: 110vh;   /* evita que el menú ocupe toda la pantalla */
        overflow-y: auto;   /* permite hacer scroll en submenús */
        overflow-x: hidden;      /* oculta horizontal */
        -webkit-overflow-scrolling: touch; /* suaviza el scroll en iOS */
    }
    /* Submenús anidados */
    .dropdown-menu {
        max-height: 110vh;   /* limita altura */
        overflow-y: auto;   /* scroll dentro de submenús largos */
        overflow-x: hidden;      /* oculta horizontal */
    }
    .dropdown-menu {
        width: 100%;   /* asegura que no se desborde */
        box-sizing: border-box;
    }


}