<twig:Modal>
   {% if app.user and app.user.type('b2b') %}
      <twig:Product:ModalInfo id_product="{{ body.id_product }}"/>
      <twig:Product:BuyForm id_product="{{ body.id_product }}">
         <twig:Product:Variations id_product="{{ this.id_product }}" size_table="true" id="vars">
            <twig:Product:VariationLabel:B2BList id_product="{{ body.id_product }}" id_label="{{ id_label }}"/>
         </twig:Product:Variations>

         {% if this.canBuy %}
            <twig:Product:SubmitBlock>
               <twig:Product:AddToCartButton show_icon="false" error_text="{{ outerScope.this.error_text }}" />
            </twig:Product:SubmitBlock>
         {% endif %}
      </twig:Product:BuyForm>
   {% else %}
      <twig:Product:ModalLayout id_product="{{ body.id_product }}">
         <twig:Product:BuyForm id_product="{{ this.id_product }}">
            <twig:Product:Variations id_product="{{ this.id_product }}" size_table="{{ false }}" id="vars">
               <twig:Product:VariationLabel:CellLarge id_product="{{ this.id_product }}" id_label="{{ id_label }}"/>
            </twig:Product:Variations>
            <twig:Product:Price id_product="{{ this.id_product }}" id_variation="{{ this.id_variation }}"/>

            {% if this.canBuy %}
               <twig:Product:SubmitBlock>
                  <twig:Product:BuyCount
                        id_product="{{ outerScope.this.id_product }}"
                        id_variation="{{ outerScope.this.id_variation }}"
                  />
                  <twig:Product:AddToCartButton error_text="{{ outerScope.this.error_text }}" />
               </twig:Product:SubmitBlock>
            {% endif %}
            {% if this.canWatch %}
               <twig:Product:WatchDog:InfoText/>
               <twig:Product:SubmitBlock>
                  <twig:Product:WatchDog id_product="{{ outerScope.this.id_product }}"
                                         id_variation="{{ outerScope.this.id_variation ?? null }}"/>
               </twig:Product:SubmitBlock>
            {% endif %}
            {% if not this.canBuy and not this.canWatch %}
               <twig:Product:DeliveryTime id_product="{{ this.id_product }}" id_variation="{{ this.id_variation }}">
                  <p class="delivery delivery--1">Prodej ukončen</p>
               </twig:Product:DeliveryTime>
            {% endif %}
         </twig:Product:BuyForm>
      </twig:Product:ModalLayout>
   {% endif %}
</twig:Modal>
