Don't be confused, first of all, Table A should have: id+product-name. The product-id of table B have to refer to id of table A. To make so, both fields must keep the same format. For instance, integer. So your table B would look like follows.
product_id + product_type + product_num
1 + red + 10
1 + blue + 20
2 + red + 5
2 + blue + 15
To get what you want, you can try:
select unique product-name, B.product-num as red-num, C.product-num as blue-num from B, B as C, A where A.id=B.product-id and A.id=C.product-id and B.product-type="red" and C.product-type="blue";
I haven't tested it, since I haven't a mysql server running at the momment. Hope it works. Remove the unique if it doesn't work, you may get something similar to what you need.