<div class="{$catalog_class|default:'col-xl-3 col-md-4 col-xxs-6'}">
   <div class="catalog-outer">
      <div class="catalog">

         <a href="{url s=product IDproduct=$product.id TITLE=$product.title}" class="product-link"
            data-tracking-click='{get_gtm_data encode=true type='ecommerce' method='ProductClick' data=['product' => $product, 'position' => $product@iteration, 'listType' => $listType, 'listId' => $listId]}'>
            <div class="img">
               <img src="{get_photo photo=$product.image size='product_catalog'}"
                    width="{$cfg.Photo.types.product_catalog.size[0]}" height="{$cfg.Photo.types.product_catalog.size[1]}"
                    class="img-responsive" alt="{$product.title}" loading="lazy">

               <div class="catalog-flags flags">
                   {include 'product/product.flags.tpl'}
               </div>
            </div>

            <div class="catalog-content">
               <p class="producer">{$product.producer.name|default:'&nbsp;' nofilter}</p>
               <h3 class="heading-reset title">{$product.title|replace:$product.producer.name:''}</h3>
               <p class="perex">{$product.descr}</p>

                {calc_product_discount product=$product assign='discount'}
               <p class="price">
                   {if $discount.discount->asFloat() >= 1}
                      <del class="strike-price">{$discount.priceOriginal|format_price}</del>
                  {* {elseif $product.productPrice.value_with_vat->lowerThan($product.productPrice.originalPrice.value_with_vat)}
                      <del class="strike-price">{$product.productPrice.originalPrice|format_price}</del>*}
                   {/if}
                  <strong>
                      {$product.productPrice|format_price}
                  </strong>

                   {block 'catalog-price-per-unit'}
                       {if !$cfg['znz_tpl']['hide_price_per_unit']}
                           {get_znz_unit_price product=$product assign='unitPrice'}
                           {if !$unitPrice.price.price_with_vat->equals($product.productPrice.price_with_vat) && $unitPrice.unit}
                               {$t = "{$unitPrice.price|format_price} / {$unitPrice.unit}"}
                           {/if}
                          <span class="unit-price">{$t|default:'&nbsp;' nofilter}</span>
                       {/if}
                   {/block}
               </p>

               <div class="availability">
                  <p><i class="fc icons_{if $product.inStore}check{else}{/if}-circle"></i>{t}K expedici{/t}</p>

                   {$storeInStore = 0}
                   {$inPersonEnabled = false}
                   {foreach $product.storesInStore as $store}
                       {if $store.figure == 'Y' && $store.id_delivery}
                           {$storeInStore = $store.in_store}
                           {$inPersonEnabled = true}
                       {/if}
                   {/foreach}
                   {if $inPersonEnabled}
                     <p><i class="fc icons_{if $storeInStore > 0}check{else}close{/if}-circle"></i>{t}Na prodejně{/t}</p>
                  {/if}
               </div>
            </div>
         </a>

          <div class="catalog-btn">
             {if $product.variations|count > 1}
                 <a href="{url s=product IDproduct=$product.id TITLE=$product.title}" class="btn btn-block btn-primary"
                    data-tracking-click='{get_gtm_data encode=true type='ecommerce' method='ProductClick' data=['product' => $product, 'position' => $product@iteration, 'listType' => $listType, 'listId' => $listId]}'>
                     {t}Vybrat variantu{/t}
                 </a>
             {else}
                <form action="{url s=cart}" method="get" data-buy-form>
                   <input type="hidden" name="act" value="add">
                   <input type="hidden" name="redir" value="1">
                   <input type="hidden" name="IDproduct" value="{$product.id}">
                   {if $product.variations and $product.variations|count == 1 and $product.variationsIds[0]}
                      <input type="hidden" name="IDvariation" value="{$product.variationsIds[0]}">
                   {/if}
                   {include 'product/product.submit-block.tpl' submit_text="{t}Vložit do košíku{/t}" hide_buycount=1 hide_favorites=1}
                </form>
             {/if}
          </div>

          {include "block.products.variations.tpl"}
      </div>
   </div>
</div>
