﻿@media (min-width: 992px) {
    .navbar-expand-lg .navbar-collapse {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        /* allow dropdowns to escape the flex container */
        overflow: visible;
    }

    /* Left navigation group: can grow but must not force the right group off-screen */
    .navbar-expand-lg .navbar-nav.mr-auto {
        display: flex;
        flex: 1 1 auto;
        min-width: 0; /* allows children to shrink without forcing parent width */
        /* DON'T set overflow:hidden here — it clipped absolute-positioned dropdowns */
        overflow: visible;
        align-items: center;
    }

        /* Individual left items: no wrapping; keep relative positioning so absolute dropdowns position correctly */
        .navbar-expand-lg .navbar-nav.mr-auto .nav-item {
            flex: 0 0 auto;
            position: relative;
        }

    .navbar-expand-lg .navbar-nav .nav-link {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Right navigation (login) stays fixed size and visible */
    .navbar-expand-lg .navbar-nav.ml-auto {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
    }

    /* Ensure dropdown menus remain visible and on top */
    .navbar .dropdown-menu {
        white-space: normal;
        position: absolute; /* ensure it is removed from normal flow */
        z-index: 2000;
        will-change: transform;
    }
}
