<div {{ attributes.defaults({class: ((this.show_buyform ? ' has-buyform') ~ (this.borderless ? ' borderless') ~ (this.isCarouselItem ? ' carousel-item'))}) }}>
   {% set BestSellerItemThis = this %}
   <a href="{{ this.url }}" title="{{ this.title }}">
      <span class="counter counter-{{ iteration_count }}">{{ iteration_count }}</span>
      {% if this.thumbnail %}
         <twig:Picture class="img-responsive" thumbnail="{{ this.thumbnail }}" type="product-catalog-small">
            {% if BestSellerItemThis.show_discount_label %}
               <twig:Product:DiscountLabel id_product="{{ BestSellerItemThis.id_product }}"/>
            {% endif %}
         </twig:Picture>
      {% endif %}
         <h3 class="heading-reset title">{{ this.title }}</h3>
      <div class="content">
         <twig:Product:Price id_product="{{ this.id_product }}"/>
         <twig:Product:DeliveryTime:Availability id_product="{{ this.id_product }}"/>
      </div>
   </a>
   {% if this.show_buyform %}
      <twig:Product:BuyForm id_product="{{ id_product }}">
         {% if BestSellerItemThis is defined %}
            <twig:Product:SubmitBlock>
               {% if not outerScope.this.canBuy or BestSellerItemThis.hasVariations %}
                  {# todo modal AddToCart, border-radius v submit-blocku #}
                  <a role="button" class="btn btn-ctr btn-block" title="{{ 'add.to.cart'|trans([], 'products') }}"
                     data-wpj-modal="{{ path('kupshop_components_modal_modal', {template: 'submit-block-modal', id_product: id_product}) }}">
                     <twig:ux:icon name="cart" class="c-icon"/>
                  </a>
               {% else %}
                  <twig:Product:AddToCartButton show_icon="true"  error_text="{{ outerScope.this.error_text }}" />
               {% endif %}
            </twig:Product:SubmitBlock>
         {% endif %}
      </twig:Product:BuyForm>
   {% endif %}
</div>
