You are probably familiar with the Cartesian product. It takes two lists and creates a list of all pairs that can be made from an element of the first and an element from the second:
\$ \left[1,2\right] \times \left[3,4\right] = \left[(1,3),(1,4),(2,3),(2,4)\right] \$
Here the order of the result is such that the pairs whose first element is earlier in the first list come earlier in the result, and if the first elements come from the same element the pair whose second element comes first is earlier.
Now we can also have a generalized Cartesian product which takes 3 arguments, two lists and a function to combine pairs.
So for example if we wanted to find all ways to add an element of the first list to an element of the second list:
\$ \mathrm{Cart} : \left((A,B) \rightarrow C, [A], [B]\right)\rightarrow[C]\\ \mathrm{Cart}\left(+,[1,2],[3,4]\right) = [4,5,5,6] \$
This is the same as taking the regular Cartesian product and then adding up each pair.
Now with this generalized Cartesian product we are going to define the "product all the way down"
\$ a\otimes b = \mathrm{Cart}\left(\otimes, a,b\right) \$
This recursive definition is a little bit mind bending. \$\otimes\$ takes a ragged list containing nothing but lists all the way down and combines each pair of elements using itself.
Lets work through some examples. The simplest example is \$[\space]\otimes[\space]\$. Since the generalized Cartesian product of an empty list with anything is the empty list it doesn't matter that this is recursive the answer is just \$[\space]\otimes[\space] = [\space]\$. There are two elements to combine so there are no ways to combine two elements.
The next example is \$[[\space]]\otimes[[\space]]\$, here we have some elements. The regular Cartesian product of these is \$[([\space],[\space])]\$, we already know how to combine \$[\space]\$ with \$[\space]\$ so we can do that. Our result is \$[[\space]]\$.
Ok Let's do \$[[\space],[[\space]]]\otimes[[[\space]]]\$. First we take the Cartesian product,
\$ [([\space],[[\space]]),([[\space]],[[\space]])] \$
Then we combine each with \$\otimes\$:
\$ \begin{array}{ll} [[\space]\otimes[[\space]],&[[\space]]\otimes[[\space]]] \\ [[\space],&[[\space]]\otimes[[\space]]] \\ [[\space],&[[\space]\otimes[\space]]] \\ [[\space],&[[\space]]] \\ \end{array} \$
Task
Your task is to take two finite-depth ragged lists and return their "product all the way down".
Answers will be scored in bytes with the goal being to minimize the size of the source code.
Test cases
If you are having difficulty understanding please ask rather than try to infer the rules from test cases.
[] [] -> []
[[]] [[]] -> [[]]
[[],[[]]] [[[]]] -> [[],[[]]]
[[[[]]]] [] -> []
[[],[[]],[]] [[],[[]]] -> [[],[],[],[[]],[],[]]