/*=======  Header  =======*/
.header-topbar {
    border-bottom: 2px solid #ebebeb;
    padding: 15px 0;

    .contact-info {
        li {
            display: inline-block;

            &:not(:last-child) {
                margin-right: 30px;
            }

            a {
                color: $text-color;
                font-size: 14px;
            }

            i {
                margin-right: 5px;
                color: $primary-color;
            }
        }
    }

    .social-icon {
        li {
            display: inline-block;

            &:not(:first-child) {
                margin-left: 20px;
            }

            a {
                color: #aeaeae;
                font-size: 16px;

                &:hover {
                    color: $primary-color;
                }
            }
        }
    }
}

.header-navigation {
    .primary-menu {
        li {
            display: inline-block;
            line-height: 110px;
            position: relative;

            .dd-trigger {
                font-size: 12px;
                font-weight: 500;
                color: #b1b1b1;
                position: absolute;
                right: 0;
                top: 50%;
                transform: translateY(-50%);
                line-height: 1;
                @include transition(0.3s);

                @include respond-below(xl) {
                    right: -5px;
                }
            }

            a {
                font-size: 18px;
                color: #555;
                padding: 10px;
                font-family: $gilroy;
                text-transform: capitalize;
                margin: 0 10px;

                @include respond-below(xl) {
                    padding: 8px;
                    margin: 0 5px;
                    font-size: 15px;
                }
            }

            .submenu {
                position: absolute;
                left: 0;
                top: 110%;
                width: 200px;
                background-color: $white;
                transition: all 0.3s ease-out 0s;
                z-index: 99;
                height: auto;
                box-shadow: 0 5px 10px rgb(0 0 0 / 10%);
                border-top: 2px solid $primary-color;
                opacity: 0;
                visibility: hidden;

                li {
                    line-height: 1;
                    margin: 0;
                    display: block;

                    &:not(:last-child) {
                        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
                    }

                    a {
                        padding: 14px 20px;
                        font-size: 16px;
                        display: block;
                        margin: 0;

                        &:hover {
                            background-color: $primary-color;
                            color: $white;
                        }
                    }

                    .dd-trigger {
                        right: 20px;
                    }

                    a:hover ~ .dd-trigger {
                        color: $white;
                    }

                    .submenu {
                        left: 100%;
                        top: 20%;
                    }

                    &:hover > .submenu {
                        top: 0;
                    }
                }
            }

            &:hover {
                & > .submenu {
                    visibility: visible;
                    top: 100%;
                    opacity: 1;
                }
            }

            &.current > a,
            &.current > .dd-trigger,
            a:hover,
            a:hover ~ .dd-trigger {
                color: $primary-color;

                @include respond-below(lg) {
                    color: $white;
                }
            }
        }
    }

    .site-logo {
        @media (max-width: 560px) {
            max-width: 150px;
        }

        .sticky-logo {
            display: none;
        }
    }

    .header-extra {
        margin-left: 20px;
    }

    .cart-icon,
    .search-icon {
        font-size: 18px;
        color: #555;
        margin-right: 30px;

        @include respond-below(xl) {
            margin-right: 20px;
        }

        &:hover {
            color: $primary-color;
        }
    }

    .search-widget {
        .search-form {
            position: fixed;
            left: 0;
            top: 0;
            width: 100vw;
            background-color: rgba($black, 0.9);
            display: flex;
            justify-content: center;
            align-items: center;
            transition: all 0.5s;
            will-change: transform, opacity;
            height: 0;
            z-index: -1;
            opacity: 0;

            .search-close {
                font-size: 30px;
                color: $white;
                position: absolute;
                right: 50px;
                top: 50px;
                line-height: 1;
            }

            form {
                width: 50%;
            }

            input {
                background-color: transparent;
                font-size: 20px;
                color: $white;
                border-bottom: 2px solid rgba($white, 0.6);
                padding: 0 30px;
            }

            &.opened {
                height: 100vh;
                opacity: 1;
                z-index: 99;
            }
        }
    }

    .offcanvas-icon,
    .nav-toggler {
        position: relative;
        width: 25px;
        height: 25px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        line-height: 1;
        cursor: pointer;

        span {
            background-color: $primary-color;
            height: 2px;
            width: 100%;
            flex: 0 0 100%;
            @include transition(0.3s);
            position: relative;
        }
    }

    .nav-toggler {
        display: none;

        &.menu-opened {
            span {
                &:nth-child(1) {
                    transform: rotate3d(0, 0, 1, 45deg);
                    top: 8px;
                }

                &:nth-child(2) {
                    opacity: 0;
                }

                &:nth-child(3) {
                    transform: rotate3d(0, 0, 1, -45deg);
                    top: -8px;
                }
            }
        }
    }

    .nav-close {
        display: none;
        font-size: 20px;
        color: $white;
        position: absolute;
        right: 20px;
        top: 20px;
        line-height: 1;
    }

    .navbar-btn {
        margin-left: 40px;

        @include respond-below(xl) {
            margin-left: 30px;
        }

        @include respond-below(md) {
            margin-left: 20px;
        }

        @include respond-below(sm) {
            display: none;
        }

        a {
            font-size: 15px;
            font-weight: 700;
            background-color: $primary-color;
            color: $white;
            border: 2px solid $primary-color;
            border-radius: 5px;
            padding: 15px 25px;

            @include respond-below(xl) {
                padding: 15px 20px;
            }

            i {
                margin-left: 10px;
                position: relative;
                top: 2px;

                @include respond-below(xl) {
                    margin-left: 5px;
                }
            }

            &:hover {
                background-color: transparent;
                color: $primary-color;
            }
        }
    }
}

.header-two {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 999;

    .header-topbar {
        border-bottom: 1px solid #99c2f6;

        .contact-info {
            li {
                a,
                i {
                    color: $secondary-soft;
                }
            }
        }

        .social-icon {
            li {
                a {
                    color: $secondary-soft;
                    &:hover {
                        color: $primary-color;
                    }
                }
            }
        }
    }
}

.header-two,
.header-three {
    .header-navigation {
        .primary-menu {
            li {
                .dd-trigger {
                    right: 5px;

                    @include respond-below(xl) {
                        right: 0;
                    }
                }

                a {
                    color: $secondary-soft;
                    text-transform: uppercase;
                    font-size: 16px;
                    padding: 10px;
                    margin: 0 15px;

                    @include respond-below(xl) {
                        font-size: 15px;
                        margin: 0 5px;
                    }
                }

                .submenu {
                    li {
                        a {
                            font-size: 14px;
                        }
                    }
                }

                &.current > a,
                &.current > .dd-trigger,
                a:hover,
                a:hover ~ .dd-trigger {
                    color: $primary-color;

                    @include respond-below(lg) {
                        color: $white;
                    }
                }
            }
        }

        .nav-toggler {
            border: 1px solid $primary-color;
            height: 50px;
            width: 60px;
            padding: 10px 12px;
            border-radius: 5px;
        }

        .navbar-btn {
            margin-left: 0;

            @include respond-below(lg) {
                margin-left: 40px;
            }

            a {
                padding: 15px 50px;
                border-radius: 5px;

                @include respond-below(xl) {
                    padding: 15px 35px;
                }
            }
        }
    }
}

.header-three {
    .header-topbar {
        border: none;
        background-color: $primary-color;
        position: relative;
        padding: 10px 0;

        &::before,
        &::after {
            position: absolute;
            content: "";
            height: 100%;
            width: 400px;
            background: #fff;
            top: 0;
            left: calc(50% - 25px);
            transform: skew(45deg);

            @include respond-below(xxl) {
                width: 250px;
            }

            @include respond-below(xl) {
                width: 200px;
            }

            @include respond-below(lg) {
                display: none;
            }
        }

        &::after {
            left: auto;
            right: calc(50% - 25px);
            transform: skew(-45deg);
        }

        .top-menu {
            li {
                display: inline-block;

                &:not(:last-child) {
                    margin-right: 30px;
                }
                a {
                    color: $white;
                    font-size: 14px;
                }
            }
        }

        .social-icon {
            li {
                a {
                    color: $white;
                    font-size: 15px;
                }
            }
        }
    }
}

.header-four {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 999;

    .header-navigation {
        .primary-menu {
            li {
                .dd-trigger {
                    right: 5px;
                    color: $white;

                    @include respond-below(xl) {
                        right: 0;
                    }
                }

                a {
                    color: $white;
                    text-transform: uppercase;
                    font-size: 16px;
                    padding: 10px;
                    margin: 0 15px;

                    @include respond-below(xl) {
                        font-size: 15px;
                        margin: 0 5px;
                    }
                }

                .submenu {
                    border: none;

                    li {
                        a {
                            font-size: 14px;
                            color: $text-color;

                            &:hover {
                                background-color: $primary-color;
                                color: $white;
                            }
                        }

                        .dd-trigger {
                            color: $text-color;
                        }
                    }
                }

                &.current > a,
                &.current > .dd-trigger,
                a:hover,
                a:hover ~ .dd-trigger {
                    color: $white;
                }
            }
        }

        .nav-toggler {
            border: 1px solid $white;
            height: 50px;
            width: 60px;
            padding: 10px 12px;
            border-radius: 5px;

            span {
                background-color: $white;
            }
        }

        .navbar-btn {
            margin-left: 0;

            @include respond-below(lg) {
                margin-left: 40px;
            }

            a {
                padding: 15px 50px;
                border-radius: 5px;
                background-color: transparent;
                border: 1px solid rgba(245, 250, 255, 0.1);

                @include respond-below(xl) {
                    padding: 15px 35px;
                }

                &:hover {
                    background-color: $primary-color;
                    color: $white;
                    border-color: $primary-color;
                }
            }
        }
    }
}

.sticky-header {
    &.sticky-on {
        .header-navigation {
            position: fixed;
            top: 0;
            width: 100%;
            z-index: 999;
            animation: sticky 1.2s;
            background-color: $white;
            box-shadow: 0px 5px 5px 0px rgb(0 0 0 / 4%);

            .sticky-logo {
                display: block;
            }

            .main-logo {
                display: none;
            }

            &:not(.breakpoint-on) {
                .primary-menu {
                    & > li {
                        line-height: 80px;

                        a,
                        .dd-trigger {
                            color: #555;
                        }

                        &.current > a,
                        &.current > .dd-trigger,
                        a:hover,
                        a:hover ~ .dd-trigger {
                            color: $primary-color;
                        }

                        .submenu li a:hover {
                            color: $white;
                        }
                    }
                }
            }
        }

        &.header-four {
            .navbar-btn {
                a {
                    background-color: $primary-color;
                }
            }

            .nav-toggler {
                border: 1px solid $primary-color;

                span {
                    background-color: $primary-color;
                }
            }
        }
    }
}

.header-navigation {
    &.breakpoint-on {
        padding: 20px 0;

        .nav-toggler {
            display: flex;
        }

        .site-nav-menu {
            position: fixed;
            top: 0;
            height: 100vh;
            width: 300px;
            padding: 50px 25px;
            background-color: $secondary-color;
            z-index: 999;
            overflow-x: hidden;
            overflow-y: scroll;
            left: -300px;
            visibility: hidden;
            opacity: 0;
            @include transition(0.3s);

            .nav-close {
                display: block;
            }

            &::-webkit-scrollbar {
                background-color: $secondary-color;
            }

            &.menu-opened {
                left: 0;
                visibility: visible;
                opacity: 1;
            }

            &::-webkit-scrollbar {
                width: 5px;
            }

            .primary-menu {
                li {
                    margin: 0;
                    padding: 0;
                    display: block;

                    a {
                        color: $white;
                        display: block;
                        padding: 15px 25px 15px 0;
                        font-size: 15px;
                        line-height: 1;
                        border-bottom: 1px solid rgba($white, 0.2);
                    }

                    .dd-trigger {
                        display: block;
                        top: 0;
                        transform: translate(0);
                        right: 0 !important;
                        height: 45px;
                        width: 45px;
                        color: $white;
                        cursor: pointer;
                        text-align: center;
                        line-height: 45px;
                        border-left: 1px solid rgba($white, 0.2);

                        i {
                            @include transition(0.3s);
                        }
                    }

                    .submenu {
                        padding-left: 15px;
                        transition: 0;
                        border: none;

                        a {
                            color: $white !important;
                            display: block;
                            padding: 15px 25px 15px 0;
                            line-height: 1;

                            &:hover {
                                background-color: transparent !important;
                            }
                        }
                    }

                    .submenu,
                    li .submenu {
                        position: unset;
                        top: 0;
                        width: 100%;
                        transition: none;
                        visibility: visible;
                        opacity: 1;
                        background-color: transparent;
                        box-shadow: none;
                        display: none;
                    }

                    &.current {
                        &::before {
                            position: absolute;
                            left: -25px;
                            top: 2px;
                            bottom: 2px;
                            width: 2px;
                            background-color: $white;
                            content: "";
                        }
                    }
                }
            }
        }
    }
}
