{extends_parent}

{block utils append}
   {get_templates product=$body.product exclude=3 assign='product_templates'}
   {get_templates product=$body.product include=3 assign='sizeTables'}
   {$isMultiSet = isset($body.product.campaign_codes.MS)}
{/block}

{block "main"}
   {foreach $body.product.variations.variations as $var}
      {if $var.photos[0]}{$varPhotos = true}{$showCarousel = true}{/if}
   {/foreach}
   {block "tpl_vars"}
      {$tpl_vars.left_colummn_class = "col-xxs-12 col-xl-8 col-lg-7 column-left"}
      {$tpl_vars.right_colummn_class = "col-xxs-12 col-xl-4 col-lg-5 column-right pull-right"}
   {/block}
   <main class="main product-main">
      <div class="container product-top">
         {get_unified_product product=$body.product assign="unifiedProduct"}
         {prepare_product_discount product=$unifiedProduct}

         <div class="row">
            <div class="{$tpl_vars.left_colummn_class|default:"col-xxs-12 col-sm-6 column-left"} gallery-col">
               {if $varPhotos}
                  {include "product/product.ajax.tpl" product=$unifiedProduct hideSubmit=1 hideCode=1 hideStickyPhoto=1}
               {else}
                  {include "product/product.gallery.tpl"}
               {/if}
               {foreach $body.product.links as $link}
                  {if $link.type == "360"}
                     <a class="link-360" href="{$link.link}" data-rel="gallery" data-type="video">
                        <span class="fc icons_360"></span>
                     </a>
                  {/if}
               {/foreach}

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

            <div class="{$tpl_vars.right_colummn_class|default:"col-xxs-12 col-sm-6 col-xxl-5 column-right pull-right"} breadcrumbs-col">
               {include "components/breadcrumbs.tpl" home="{t}Úvodní strana{/t}"}
            </div>
            <div class="{$tpl_vars.right_colummn_class|default:"col-xxs-12 col-sm-6 col-xxl-5 column-right pull-right"}" id="product-form">
               <h1 class="h2">{$body.product.title}</h1>
               <div class="product-top-data">
                  {if $body.product.producer}<p>{t}Výrobce:{/t} <a href="{url s=category IDpd=$body.product.producer.id}">{$body.product.producer.name}</a></p>{/if}
                  {include "product/product.ajax.tpl" product=$unifiedProduct hideSubmit=1 hideGallery=1 hideStickyPhoto=1}
               </div>

               {ifmodule PRODUCT_SETS}
                  {* modul product_sets - jednodušší sety k produktu *}
                  {include "product/product.sets.tpl"}
               {/ifmodule}

               {ifmodule PRODUCT_GIFTS}
                  {* modul product_gifts - dárky k produktu *}
                  {include "product/product.gifts.tpl"}
               {/ifmodule}

               <p class="annotation">{$body.product.descr} <a href="#description" data-scrollto>{t}Více{/t}</a></p>

               {if $isMultiSet}
                  {include "product/product.js-multisets.tpl"}
               {else}
                  {if !$body.product->isold()}
                     {include 'product/product.template.tpl' position='price'}
                     {block "product-ajax"}
                        {ifmodule PRODUCTS_COLLECTIONS}
                        {insert_products type="collection_product" template="product/block.products.collections.tpl" image=4 product=$body.product.id param_id={$cfg.cyklospeciality_tpl.variation_color_param_id} listType='detail_collections' listId=$body.product.id}
                        {/ifmodule}
                        {if $isB2BUser and $body.product.variations.variations|count}
                           {include "product/product.variations.b2b.tpl"}
                        {else}
                           {if $body.product.variations.variations|count}
                              {include "product/product.variations.tpl"}
                           {/if}
                           {include "product/product.ajax.tpl" product=$unifiedProduct hideGallery=1 hideCode=1 hideStickyPhoto=1}

                           {ifmodule PRODUCTS__SETS}
                              {*{include "product/sets/product.usedInSets.tpl"}*}
                           {/ifmodule}
                        {/if}

                        {include "product/product.links.tpl"}
                     {/block}
                  {else}
                     {include "product/product.soldout.tpl"}
                  {/if}
               {/if}
            </div>
         </div>
      </div>
      {include "product/product.bottom-content.tpl"}
   </main>
{/block}

{block "body" append}
   {include "focus/focus.sizetable.tpl" class="sizetable" sizeTables=$sizeTables}

   {if !$body.product->isold() and !$isSet}
      {include "focus/focus.product-delivery.tpl" class="product-delivery"}
   {/if}
{/block}

{block "js-entry" append}
   {if $isMultiSet}
      {encore_entry_script_tags entry='js-multisets'}
   {/if}
{/block}
