.ai-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: $bgWhite;
    .ai-header-top {
        background: $bgPrimary;
        padding: 8px 0;
        @media only screen and (min-width: $xs_576) {
            padding: 12px 0;
        }
        @media only screen and (min-width: $xl_1601) {
            padding: 14px 0;
        }
        .ai-phone {
            @include aiDflexAlignItemsCenter;
            gap: 10px;
            @media only screen and (max-width: $xs_375) {
                gap: 4px;
                svg {
                    height: 12px;
                    width: 12px;
                }
            }
            a {
                color: $textWhite;
                text-decoration: none;
            }
        }
        .ai-header-links {
            ul {
                list-style: none;
                margin: 0;
                padding: 0;
                @include aiDflexWrap;
                gap: 12px;
                @media only screen and (min-width: $xs_576) {
                    gap: 16px;
                }
                @media only screen and (min-width: $lg_1200) {
                    gap: 20px;
                }
                @media only screen and (min-width: $xl_1601) {
                    gap: 24px;
                }
                li {
                    color: $textWhite;
                    a {
                        color: $textWhite;
                        text-decoration: none;
                        &:hover {
                            text-decoration: underline;
                        }
                    }
                }
            }
        }
        @media only screen and (max-width: $xs_375) {
            font-size: 12px;
        }
    }
    .ai-header-bottom {
        border-bottom: solid #E5E5E5 1px;
        box-shadow: 0px 0px 10px 0px rgb(0, 0, 0, 0.05);
        .navbar {
            padding: 12px 0;
            @media only screen and (min-width: $xs_576) {
                padding: 16px 0;
            }
            @media only screen and (min-width: $lg_1200) {
                padding: 20px 0;
            }
            .navbar-toggler {
                padding: 0;
                border: none;

                .navbar-toggler-icon {
                    position: relative;
                    margin-top: -8px;
                    box-shadow: none;
                    background-image: none;

                    &:before,
                    &:after {
                        position: absolute;
                        left: 15px;
                        width: 2px;
                        content: '';
                        height: 25px;
                        background-color: $bgBlue;
                    }

                    &:before {
                        box-shadow: 6px 0 0 0 $bgBlue;
                    }

                    &:before {
                        top: 0;
                        transform: rotate(90deg);
                        -o-transform: rotate(90deg);
                        -ms-transform: rotate(90deg);
                        -moz-transform: rotate(90deg);
                        -webkit-transform: rotate(90deg);
                    }

                    &:after {
                        bottom: -7px;
                        transform: rotate(-90deg);
                        -o-transform: rotate(-90deg);
                        -ms-transform: rotate(-90deg);
                        -moz-transform: rotate(-90deg);
                        -webkit-transform: rotate(-90deg);
                    }
                }

                &[aria-expanded="true"] {
                    .navbar-toggler-icon {

                        &:before {
                            top: 5px;
                            transform: rotate(45deg);
                            -o-transform: rotate(45deg);
                            -ms-transform: rotate(45deg);
                            -moz-transform: rotate(45deg);
                            -webkit-transform: rotate(45deg);
                            box-shadow: none;
                        }

                        &:after {
                            bottom: -1px;
                            transform: rotate(-45deg);
                            -o-transform: rotate(-45deg);
                            -ms-transform: rotate(-45deg);
                            -moz-transform: rotate(-45deg);
                            -webkit-transform: rotate(-45deg);
                        }
                    }
                }

                &:focus {
                    box-shadow: none;
                }
            }
            .navbar-collapse {
                @media only screen and (max-width: $md_991) {
                    overflow-y: auto;
                    overflow-x: hidden;
                    overscroll-behavior: contain;
                    position: fixed;
                    top: 0;
                    z-index: 2;
                    left: calc(-92vw - 40px);
                    width: min(380px, 92vw);
                    max-width: 100vw;
                    padding: 16px 14px 24px;
                    box-shadow: 5px 0 10px 0  rgba($color: $bgBlack, $alpha: 0.15);
                    height: 100dvh !important;
                    display: block !important;
                    background: $bgWhite $bgBlueGradient;
                    -webkit-overflow-scrolling: touch;
                    @include aiTransition;

                    &.show {
                        left: 0;
                        right: auto;
                    }

                }

                @media only screen and (max-width: $xs_414) {
                    width: 100vw;
                    left: -100vw;
                    padding: 14px 12px 18px;
                }
            }
            .ai-header-links {
                @include aiDflexWrap;
                gap: 8px;
                @media only screen and (max-width: $md_991) {
                    width: 100%;
                    flex-direction: column;
                    align-items: stretch;
                    gap: 0;
                }
                @media only screen and (min-width: $md_992) and (max-width: $lg_1199) {
                    gap: 16px;
                }
                @media only screen and (min-width: $lg_1200) {
                    gap: 36px;
                }
                @media only screen and (min-width: $xl_1601) {
                    gap: 48px;
                }
                .nav-item {
                    @media only screen and (max-width: $md_991) {
                        width: 100%;
                    }
                    .nav-link {
                        font-size: $font16;
                        color: $textDark;
                        font-weight: $fontLight;
                        border-top: solid 2px transparent;
                        border-bottom: solid 2px transparent;
                        position: relative;
                        padding: 4px 2px 8px;
                        @include aiDflexAlignItemsCenter;
                        gap: 8px;
                        justify-content: space-between;
                        @media only screen and (min-width: $md_992) and (max-width: $lg_1199) {
                            font-size: 14px;
                        }
                        &:after {
                            width: 100%;
                            height: 2px;
                            border-radius: 8px;
                            background: transparent;
                            content: '';
                            position: absolute;
                            bottom: 0;
                            left: 0;
                        }
                        &:hover,&:focus {
                            color: $textBlue;
                        }
                        &.ai-active {
                            color: $textBlue;
                            font-weight: $fontRegular;
                            &:after {
                                background: $bgBlue;
                            }
                        }
                        &.dropdown-toggle {
                            &::after {
                                border: none;
                            }
                        }
                    }
                    @media only screen and (min-width: $md_992) {
                        .ai-dropdown-menu {
                            @include aiColumnBrd;
                            padding: 5px 12px;
                            border-radius: 0;
                            margin: 0;
                            top: calc(100% - 2px);
                            &:after {
                                content: '';
                                height: 16px;
                                width: 16px;
                                background: $bgWhite;
                                position: absolute;
                                top: -8px;
                                left: 15px;
                                border: solid $borderColor 1px;
                                transform: rotate(45deg);
                                box-shadow: $boxShadow;
                                z-index: -1;
                            }
                            &::before {
                                background: $bgWhite;
                                position: absolute;
                                left: 0;
                                top: 0;
                                width: 100%;
                                height: 100%;
                                background: $bgWhite;
                                content: '';
                                z-index: 1;
                                border-radius: 5px;
                            }
                            li {
                                position: relative;
                                z-index: 2;
                                + {
                                    li {
                                        border-top: solid $borderColor 1px;
                                    }
                                }
                                .ai-dropdown-item {
                                    padding: 8px 4px;
                                    font-size: $font14;
                                    font-weight: $fontRegular;
                                    @include transition;
                                    .ai-menu-arrow {
                                        @include transition;
                                    }
                                    &:hover,&:focus {
                                        background: transparent;
                                        color: $textBlue;
                                    }
                                }
                            }

                            &.ai-mega-menu {
                                padding: 12px 16px;
                                display: none;
                                max-height: calc(100vh - 140px);
                                overflow-y: auto;
                                overflow-x: hidden;

                                &::after {
                                    left: 28px;
                                }

                                li {
                                    border-top: none !important;

                                    .ai-dropdown-item {
                                        padding: 8px 10px;
                                        border-radius: 4px;
                                    }
                                }

                                @media only screen and (min-width: $lg_1200) {
                                    column-gap: 18px;

                                    &.ai-mega-2 {
                                        column-count: 2;
                                    }

                                    &.ai-mega-3 {
                                        column-count: 3;
                                        min-width: 760px;
                                    }

                                    li {
                                        break-inside: avoid;
                                        page-break-inside: avoid;
                                        margin-bottom: 2px;
                                    }
                                }
                            }
                        }
                        &:hover,&.show {
                            .ai-menu-arrow {
                                transform: rotate(180deg);
                            }
                            .ai-dropdown-menu {
                                display: block;        
                            }
                        }
                    }
                    @media only screen and (max-width: $md_991) {
                        .nav-link {
                            font-size: 15px;
                            padding: 10px 0;
                            border-bottom: solid $borderColor 1px;
                            white-space: normal;
                            word-break: break-word;
                            .ai-menu-arrow {
                                @include transition;
                            }
                            &.show {
                                .ai-menu-arrow {
                                    transform: rotate(180deg);
                                }
                                .ai-dropdown-menu {
                                    display: block;        
                                }
                            }
                        }
                        .ai-dropdown-menu {
                            @include aiColumnBrd;
                            padding: 5px 12px;
                            border-radius: 5px;
                            margin: 8px 0 0;
                            position: relative;
                            width: 100%;
                            min-width: 100%;
                            max-width: 100%;
                            max-height: calc(100dvh - 260px);
                            overflow-y: auto;
                            overflow-x: hidden;
                            &:after {
                                content: '';
                                height: 16px;
                                width: 16px;
                                background: $bgWhite;
                                position: absolute;
                                top: -8px;
                                left: 15px;
                                border: solid $borderColor 1px;
                                transform: rotate(45deg);
                                box-shadow: $boxShadow;
                                z-index: -1;
                            }
                            &::before {
                                background: $bgWhite;
                                position: absolute;
                                left: 0;
                                top: 0;
                                width: 100%;
                                height: 100%;
                                background: $bgWhite;
                                content: '';
                                z-index: 1;
                                border-radius: 5px;
                            }
                            @media only screen and (max-width: $xs_575) {
                                &:after {
                                    display: none;
                                }
                            }
                            li {
                                position: relative;
                                z-index: 2;
                                + {
                                    li {
                                        border-top: solid $borderColor 1px;
                                    }
                                }
                                .ai-dropdown-item {
                                    padding: 8px 4px;
                                    font-size: $font14;
                                    font-weight: $fontRegular;
                                    white-space: normal;
                                    word-break: break-word;
                                    @include transition;
                                    .ai-menu-arrow {
                                        @include transition;
                                    }
                                    &:hover,&:focus {
                                        background: transparent;
                                        color: $textBlue;
                                    }
                                }
                            }

                            &.ai-mega-menu {
                                column-count: 1 !important;
                                min-width: 100%;
                                max-width: 100%;
                                padding: 8px 12px;
                                @include aiDflex;
                                flex-direction: column;
                                overflow-y: auto;

                                li {
                                    .ai-dropdown-item {
                                        padding: 9px 6px;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            .ai-mainlogo {
                .navbar-brand {
                    margin-right: 4px;
                    img {
                        @media only screen and (max-width: $xs_375) {
                            width: 145px;
                            height: auto;
                        }
                        @media only screen and (min-width: $md_992) and (max-width: $lg_1199) {
                            width: 165px;
                            height: auto;
                        }
                    }
                }
            }
            .ai-header-rs {
                @include aiDflexWrap;
                align-items: center;
                gap: 16px;
                @media only screen and (max-width: $md_991) {
                    gap: 12px;
                    margin-right: 12px;
                }
                @media only screen and (min-width: $md_992) {
                    gap: 20px;
                }
                @media only screen and (min-width: $lg_1281) {
                    gap: 40px;
                }
                @media only screen and (min-width: $xl_1601) {
                    gap: 60px;
                }
                ul {
                    list-style: none;
                    margin: 0;
                    padding: 0;
                    @include aiDflexWrap;
                    gap: 24px;
                    @media only screen and (max-width: $md_991) {
                        gap: 14px;
                    }
                    li {
                        &.ai-search-wrapper {
                            position: relative;
                            @include aiDflexAlignItemsCenter;

                            .ai-search-toggle {
                                cursor: pointer;
                                display: inline-flex;
                            }

                            .ai-search-bar {
                                position: absolute;
                                right: -8px;
                                top: 50%;
                                transform: translateY(-50%);
                                gap: 8px;
                                width: 0;
                                opacity: 0;
                                overflow: hidden;
                                background: $bgWhite;
                                border-radius: 48px;
                                padding: 4px 10px;
                                border: solid $borderColor 1px;
                                min-height: 44px;
                                box-shadow: 0px 0px 10px 0 rgba($color: $bgBlack, $alpha: 0.05);
                                z-index: 1;
                                visibility: hidden;
                                line-height: normal;
                                @include aiDflexAlignItemsCenter;
                                @include transition;

                                @media only screen and (max-width: $sm_767) {
                                    right: 0;
                                }
                            
                                input {
                                    width: calc(100% - 20px);
                                    border: none;
                                    outline: none;
                                    font-size: $font14;
                                    font-weight: $fontLight;
                                    color: $textGray;
                                    padding: 5px 8px;
                                    &::placeholder {
                                        color: $textGray;
                                        opacity: 1;
                                    }
                                }

                                .ai-search-close {
                                    cursor: pointer;
                                    font-size: $font32;
                                    line-height: normal;
                                    font-weight: $fontLight;
                                    transform: rotate(45deg);
                                    color: $textBlue;
                                    position: absolute;
                                    right: 12px;
                                    top: 0;
                                    height: 100%;
                                }
                            }

                            &.active {
                                pointer-events: inherit;
                                .ai-search-bar {
                                    width: 265px;
                                    visibility: visible;
                                    opacity: 1;
                                    @media only screen and (max-width: $xs_575) {
                                        width: min(220px, 68vw);
                                    }
                                }
                            }
                            }
                    }
                }
            }
            .ai-navigation {
                position: relative;
                @media only screen and (max-width: $lg_1199) {
                    margin-left: 0 !important;
                }
            }
        }
    }
}

