[eluser]TheFuzzy0ne[/eluser]
If I understand you correctly, the simplest solution would be to use the category and product IDs in the URL.
yoursite.tld/categories/view/<category_id>[/<page_num>]
yoursite.tld/products/view/<product_id>
yoursite.tld/cart/add/<product_id>
Is there any reason that won't work for you?