It need not be complicated, but you are taking what is essentially a file system paradigm (folder/folder/file) and re-enacting it in a database.
If you are serious about a polyhierchical structure so that you can essentially have:
Where product1 is always the same page, but the breadcrumb permits the user to navigate "back up" to either :
.. depending on which way they got there, then the best option will be to maintain a referential table which stores all of those possible relationships.
But are you sure that is what you want? Can product1 really belong to many brands?