Nested Product variable

Hello everyone !
I am working on a shopify theme project. On the product page the customer will need to selection the color then after the size. Which mean that every product got 2 option with 2 to 3 value.

I need to use variant to generate a ID for each different variants. Looping option1 and nesting option2 loop.
But saldy option 1 is not even looping . is my synthax wrong ?


                  {% for option1 in product.variants.option1 %}
                  

{{ product.option1 }}

                      
                        {% for option2 in product.variants.option2 %}
                        - {{ variant.option2 }}
                          

                            
                          

                        
                        {% endfor %}
                      
 
                   {% endfor %}

Thanks a lot !