﻿/* ================================================================
   HEADER / NAVBAR
   ================================================================ */

.header {
    top: 0;
    left: 0;
    width: 100vw;
    height: 40px;
    background-color: black;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.2);
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
    overflow: visible;
}

.nav-container {
    height: inherit;
    margin: auto;
    padding: 0 15px;
}

.header .nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    height: 40px;
    overflow: visible;
}

/* ----------------------------------------------------------------
   LOGO
   ---------------------------------------------------------------- */

.header .logo {
    flex-shrink: 0;
}

    .header .logo img {
        vertical-align: middle;
    }

/* ----------------------------------------------------------------
   MENU
   overflow:visible everywhere so dropdowns are never clipped.
   Scrolling is handled via JS (wheel + drag on the ul).
   ---------------------------------------------------------------- */

.header .menu {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    overflow: visible;
    margin-left: 15px;
}

    .header .menu .head {
        display: none;
    }

    .header .menu > ul {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        list-style: none;
        margin: 0;
        padding-left: .33rem;
        height: 40px;
        overflow: visible; /* NO overflow clipping — JS handles scroll */
        position: relative;
    }

    .header .menu ul {
        list-style: none;
    }

    .header .menu > ul {
        pointer-events: none; /* ul overflows visually into icon area — block nothing there */
    }

        .header .menu > ul > li {
            display: inline-block;
            flex-shrink: 0;
            pointer-events: auto; /* restore clicks on actual menu items */
        }

            .header .menu > ul > li:not(:last-child) {
                margin-right: 15px;
            }

    /* ----------------------------------------------------------------
   LINKS
   ---------------------------------------------------------------- */

    .header .menu a {
        text-decoration: none;
        text-transform: capitalize;
        font-size: 12px;
        color: var(--white);
        line-height: 40px;
        display: block;
        white-space: nowrap;
    }

    .header .menu > ul > li > a {
        padding: 14px 0;
    }

    .header .menu > ul > .nav-dropdown > a {
        padding-right: 15px;
    }

    /* ----------------------------------------------------------------
   CHEVRON ICONS
   ---------------------------------------------------------------- */

    .header .menu i {
        font-size: 8px;
        pointer-events: none;
        user-select: none;
        position: absolute;
        color: var(--white);
        top: calc(50% - 5px);
    }

    .header .menu > ul > li > i {
        right: 0;
    }

/* ----------------------------------------------------------------
   DROPDOWNS
   ---------------------------------------------------------------- */

.nav-sub-menu {
    border-radius: var(--kendo-border-radius-md);
}

    .nav-sub-menu li a {
        line-height: 20px !important;
    }

.header .menu .nav-dropdown {
    position: relative;
}

.header .menu .nav-sub-menu {
    position: absolute;
    top: 48px; /* a little lower than the header edge */
    left: 0;
    width: 230px;
    padding: 5px 0;
    background: var(--bs-dark);
    box-shadow: 0 0 5px var(--black);
    z-index: 9999;
    transform-origin: top;
    transform: scaleY(0);
    visibility: hidden;
    opacity: 0;
}

.header .menu .nav-sub-menu-right {
    left: calc(100% + 5px);
    top: 0;
}

.header .menu .nav-sub-menu-left {
    top: 0;
    left: auto;
    right: 101%;
}

.header .menu li.nav-dropdown.active > .nav-sub-menu {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.header .menu .nav-sub-menu a {
    padding: 6px 24px;
}

.header .menu .nav-sub-menu .nav-dropdown > a {
    padding-right: 34px;
}

.header .menu .nav-sub-menu span {
    background-image: linear-gradient(var(--white), var(--white));
    background-size: 0 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.5s ease;
}

.header .menu .nav-sub-menu li:hover > a > span {
    background-size: 100% 1px;
}

.header .menu .nav-sub-menu i {
    transform: rotate(-90deg);
    right: 24px;
}

/* ----------------------------------------------------------------
   HEADER RIGHT
   ---------------------------------------------------------------- */

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
    gap: 4px; /* tight uniform spacing between icons */
}

    .header-right > * {
        margin-left: 0; /* replaced by gap */
    }

    /* Tighter icon buttons */
    .header-right .nav-icon-btn {
        padding: 0 3px !important;
    }

/* Slightly smaller avatar */
.nav-img-btn img {
    width: 26px;
    height: 26px;
}

/* Progressive icon hiding — add class="... hide-md" or "hide-sm"
   to secondary icons in _MenuNavBar.cshtml to hide them at smaller widths */
@media (max-width: 1400px) {
    .header-right .nav-icon-btn.hide-md {
        display: none;
    }
}

@media (max-width: 1100px) {
    .header-right .nav-icon-btn.hide-sm {
        display: none;
    }
}

.header-right .nav-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--white);
    font-size: 10px;
}

.header-right .open-menu-btn {
    display: none;
}

.nav-icon-btn i {
    font-size: 12px;
}

.nav-icon-btn {
    padding-top: .65rem !important;
}

.nav-img-btn img {
    width: 30px;
    height: 30px;
    border-radius: var(--kendo-border-radius-md);
}

/* ================================================================
   MOBILE  –  full-screen slide-in menu (≤ 1200 px)
   ================================================================ */

@media (max-width: 1200px) {

    .header {
        padding: 1px 0;
    }

        .header .nav-container {
            justify-content: space-between;
        }

        .header .menu {
            position: fixed;
            right: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: var(--bs-dark);
            padding: 15px 30px 30px;
            overflow-x: hidden;
            overflow-y: auto;
            z-index: 9999;
            transform: translateX(100%);
            scrollbar-gutter: stable both-edges;
            white-space: normal;
            flex: none;
            min-width: unset;
        }

            .header .menu::-webkit-scrollbar {
                display: block;
                width: 6px;
            }

            .header .menu::-webkit-scrollbar-thumb {
                background-color: var(--bs-secondary);
                opacity: 0.5;
                border-radius: 4px;
            }

            .header .menu.open {
                transform: none;
            }

            .header .menu .head {
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 25px;
            }

            .header .menu .close-menu-btn {
                height: 35px;
                width: 35px;
                position: relative;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                background-color: transparent;
                cursor: pointer;
                border: none;
            }

                .header .menu .close-menu-btn::before,
                .header .menu .close-menu-btn::after {
                    content: '';
                    position: absolute;
                    height: 2px;
                    width: 80%;
                    background: var(--white);
                }

                .header .menu .close-menu-btn::before {
                    transform: rotate(45deg);
                }

                .header .menu .close-menu-btn::after {
                    transform: rotate(-45deg);
                }

            .header .menu > ul {
                display: block;
                height: auto;
                padding-left: 0;
                overflow: visible;
                transform: none !important; /* reset any JS translation */
            }

                .header .menu > ul > li {
                    display: block;
                }

                    .header .menu > ul > li:not(:last-child) {
                        margin-right: 0;
                    }

            .header .menu li {
                border-bottom: 1px solid var(--light);
            }

                .header .menu li:first-child {
                    border-top: 1px solid var(--light);
                }

            .header .menu > ul > li > a {
                padding: 12px 0;
                line-height: 1.4;
                white-space: normal;
            }

            .header .menu > ul > .nav-dropdown > a {
                padding-right: 34px;
            }

            .header .menu i {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                pointer-events: auto;
                cursor: pointer;
                top: 26px;
                font-size: 16px;
                font-weight: bold;
            }

            .header .menu .nav-dropdown.active > i {
                background-color: var(--secondary);
                transform: rotate(180deg);
            }

            .header .menu .nav-sub-menu {
                position: static !important;
                opacity: 1;
                transform: none;
                visibility: visible;
                padding: 0;
                transition: none;
                box-shadow: none;
                width: 100%;
                display: none;
            }

            .header .menu .nav-dropdown.active > .nav-sub-menu {
                display: block;
            }

            .header .menu .nav-sub-menu li:last-child {
                border: none;
            }

            .header .menu .nav-sub-menu a {
                padding: 12px 0 12px 15px;
                line-height: 1.4;
                white-space: normal;
            }

            .header .menu .nav-sub-menu .nav-sub-menu a {
                padding-left: 30px;
            }

            .header .menu .nav-sub-menu .nav-sub-menu .nav-sub-menu a {
                padding-left: 45px;
            }

            .header .menu .nav-sub-menu span {
                background-image: none;
            }

            .header .menu .nav-sub-menu i {
                transform: none;
                right: 0;
            }

    .header-right .open-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 30px;
        width: 34px;
        cursor: pointer;
        position: relative;
        background-color: transparent;
        border: none;
    }

        .header-right .open-menu-btn .line {
            height: 2px;
            width: 30px;
            background-color: var(--white);
            position: absolute;
        }

        .header-right .open-menu-btn .line-1 {
            transform: translateY(-8px);
        }

        .header-right .open-menu-btn .line-3 {
            transform: translateY(8px);
        }

    .nav-icon-btn {
        padding-top: 10px !important;
    }
}
