// body class when menu is open

body {
    &:before {
        @include anim;
        content: '';
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 100vw;
        background-color: rgba(#000, 0.51);
        z-index: 100;

        visibility: hidden;
        opacity: 0;
    }

    &.is-menu-open {
        @media screen and (max-width: $screen-md - 1) and (max-height: $mq-header-fixed - 1) {
            height: 100vh;
        }

        &:before {
            visibility: visible;
            opacity: 1;
        }
    }
}

.navbar {
    padding: 4px 0 5px;
    position: relative;
    z-index: 2;

    @include media('<desktop') {
        margin-bottom: 36px;
    }
}

.navbar__list {
    @include adaptive-font(17, 14);
    @extend %listreset;
    font-weight: 500;
    text-transform: uppercase;

    @include media('>=desktop') {
        display: flex;
        justify-content: flex-end;
    }

    li {
        @include media('<desktop') {
            margin-bottom: 28px;
        }

        @include media('>=desktop') {
            margin-left: 30px;
        }
    }

    a {
        color: #a4afbb;

        @include hover {
            color: #fff;
        }
    }
}

.navbar__btn {
    @include ycenter;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    padding: 6px 3px;
    cursor: pointer;
    z-index: 1002;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    background-color: #1c3576;

    @include media('<desktop') {
        display: flex;
    }

    .bar {
        position: relative;
        width: 22px;
        background-color: #fff;
        border-radius: 3px;
        transition: background-color .27s .3s;
        background-clip: padding-box;
        height: 2px;

        .is-menu-open & {
            background-color: transparent;

            &:before {
                bottom: 0;
                transform: rotate(-45deg) translateX(-50%);
                transition: bottom .3s cubic-bezier(.23,1,.32,1), transform .3s .3s cubic-bezier(.23,1,.32,1);
            }

            &:after {
                top: 0;
                transform: rotate(45deg) translateX(-50%);
                transition: top .3s cubic-bezier(.23,1,.32,1), transform .3s .3s cubic-bezier(.23,1,.32,1);
            }
        }

        &:before {
            bottom: 9px;
            transition: bottom .3s .3s cubic-bezier(.23,1,.32,1), transform .3s cubic-bezier(.23,1,.32,1);
        }

        &:after {
            top: 9px;
            transition: top .3s .3s cubic-bezier(.23,1,.32,1), transform .3s cubic-bezier(.23,1,.32,1);
        }

        &:before,
        &:after {
            content: '';
            @include xcenter;
            transform: rotate(0) translateX(-50%);
            width: 22px;
            border-radius: 3px;
            background-clip: padding-box;
            height: 2px;
            background-color: #fff;
            transform-origin: 0 50%;
        }
    }
}

.mobile-menu {
    @include media('<desktop') {
        @include anim($dur: $animation-speed-slow);
        overflow: hidden;
        position: fixed;
        z-index: 999;
        top: 0;
        left: 100%;
        height: 100vh;
        width: 303px;
        background-color: rgba(28, 53, 118, 0.98);
        padding: 108px 26px 30px;
        display: flex;
        flex-direction: column;
        //transform: translateX(-100%);
    }

    .is-menu-open & {
        transform: translateX(-100%);
    }
}
