I created what you mean a while back for a test on a fashion-platform. All you need are conditional fields. It is a bit like "if...", "then...". It took me a few hours of playing around with it, but it works like a charm.
If you have a field A just make the selection Category A and Category B.
Depending on what is selected you can make appear what you want, but you need to create a separate field for every possible option.
The selector is (if I remember correctly) the 'contain' element. If you use that it makes the correct next field show up.