Regarding URL behavior in a dynamic page

HI, I was making an eCom website. I realized that when creating dynamic pages, URLs don’t seem to work as I expected and I want to know how to get the desired results.

eg1) products in collections are displayed in repeater as www.wix.com/collections/name
when clicked on a product it takes us to, www.wix.com/collections/name/product_name .

Are this type of URL better for SEO?
Now when I created a dynamic page for collections, it gave me www…/collections/{name}. I can jump to that page using links. But when I have to add a dataset of products and filter products to show the products belonging to that particular collection. Am I right?
But how do I get the collection name and apply the filter to the products dataset before any data is fetched?
Also in the case of showing all the products in the repeater, how do I get the URL to show the page in which(pagination to show multiple pages of the dataset) the user is currently in? www…/collections/name?page-2 (something like this URL).

And my final problem, how do I show the desired results if the user searches directly the www…/collections/name?page-2 in the browser?
I tried routers to solve these problems but can’t seem to figure it out. As routers is a new topic for me and I can’t wrap my head around it completely.