.m-nav {
  @include respond-to('medium') {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 37px;
    overflow-y: hidden;
  }

  @include respond-to('largest') {
    margin: 0 -5px;
  }

  &.toggle-overflow {
    @include respond-to('medium') {
      overflow-y: initial;
    }
  }
}

.m-nav__left {
  margin-bottom: 30px;

  @include respond-to('medium') {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-top: 40px;
    padding-bottom: 40px;
    padding-left: 5px;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
  }

  &.toggle-overflow {
    @include respond-to('medium') {
      overflow-x: hidden;
    }
  }

  ul:not(.m-secondary-menu) {
    padding: 0;
    margin: 0;

    @include respond-to('medium') {
      display: flex;
      align-items: center;
    }
  }

  li {
    color: var(--titles-color);
    letter-spacing: 0.3px;
    font-size: 1.125rem;
    margin-bottom: 15px;

    @include respond-to('medium') {
      margin-bottom: 0;
      margin-right: 35px;
      position: relative;
    }

    &:last-of-type {
      margin-bottom: 0;
    }

    &.nav-current {
      font-weight: 600;
    }

    a {
      color: inherit;
    }

    &.more {
      a {
        display: inline-flex;
        align-items: center;

        @include respond-to('medium') {
          display: flex;
        }

        span {
          display: inline-block;
          color: inherit;
          font-size: 1rem;
          margin-left: 8px;
          @include transform(translateY(1px));
        }
      }
    }

    &.submenu-option {
      @include respond-to('medium') {
        z-index: 2;
      }
    }
  }
}

.m-nav__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  @include respond-to('medium') {
    flex-shrink: 0;
    position: relative;
    padding-left: 20px;
    padding-right: 5px;
  }

  &:before {
    @include respond-to('medium') {
      content: '';
      position: absolute;
      pointer-events: none;
      top: 0;
      left: -20px;
      width: 20px;
      height: 100%;
      z-index: 2;
      background: linear-gradient(90deg, var(--header-menu-gradient-first-color) 0, var(--header-menu-gradient-second-color));
    }
  }
}

.rtl {
  .m-nav__left {
    @include respond-to('medium') {
      padding-left: 0;
      padding-right: 5px;
    }

    li {
      @include respond-to('medium') {
        margin-right: 0;
        margin-left: 35px;
      }
    }
  }

  .m-nav__right {
    @include respond-to('medium') {
      padding-left: 5px;
      padding-right: 20px;
    }

    &:before {
      @include respond-to('medium') {
        left: auto;
        right: -20px;
        @include transform(rotate(180deg));
      }
    }
  }
}
