How to change the URL template of the Magento category page

The question may be simple, but if we see the requirement, it seems difficult,

How to change the URL structure of the Magento category page?

Here are the examples of URLs that I want to achieve:

I want the category URL last by keeping the filters in the base URL and the category URL.

Please, help me get an idea of ​​where to dig it.