{extends_parent}

{insert_product_descr_plus id_product=$body.product.id assign="descr_plus"}

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

{block 'utils-end' append}
    {get_unified_product product=$body.product assign="unifiedProduct"}
{/block}

{block "main"}
   <main class="main product-main">
      <div class="container product-top">
          {include "components/breadcrumbs.tpl"}
         <div class="row">
            <div class="col-xxs-12 col-lg-7 col-xxl-7 column-left">
                {*{if $isSet}
                    {include "product/sets/product.sets.tpl"}
                {else}*}
                    {include "product/product.gallery.tpl"}
                {*{/if}*}
                {include "product/product.links.tpl"}
            </div>

            <div class="col-xxs-12 col-lg-5 col-xxl-4 column-right pull-right product-wrapper">
                {include "components/breadcrumbs.tpl"}

               <h1>{$body.product.title}</h1>

               <div class="review-wrapper{if !$body.product.campaign_codes or $body.product.campaign_codes['L']} flags-wrapper{/if}">
                   {if $body.product.campaign_codes}
                      <div class="flags-product">
                          {foreach $body.product.campaign_codes as $flag}
                              {if $flag.catalog_class}
                                 <span class="flag flag-{$flag.catalog_class}">{$flag.singular}</span>
                              {/if}
                          {/foreach}
                      </div>
                   {/if}
                   {if $product_reviews.rating}
                      <div class="product-top-reviews review-stars-wrapper">
                         <div class="review-stars">
                             {for $i=1 to 5}
                                <i class="fc {if $i > $product_reviews.rating|round}icons_star_empty{else}icons_star_full{/if}"></i>
                             {/for}
                         </div>
                         <a class="reviews-count" href="#reviews-header" data-scrollto>{$product_reviews.rating_count}
                             {t count=$product_reviews.rating_count plural="hodnocení" plural5="hodnocení"}hodnocení{/t}</a>
                      </div>
                   {/if}
               </div>

               <p class="annotation">{$body.product.descr}</p>

                {if $isMultiSet}
                    {include "product/product.js-multisets.tpl"}
                {else}
                    {ifmodule PRODUCTS_COLLECTIONS}
                    {insert_products type="collection_product" template="product/block.products.collections.tpl" image=4 product=$body.product.id param_id=14}
                    {/ifmodule}

                    {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}

                    {if !$body.product->isold()}
                        {if $isSet}
                            {include "product/sets/product.sets.selected.tpl" image=4}
                            {include "product/product.price-block.tpl"}
                        {elseif $body.product.variations.variations|count}
                            {include "product/product.variations.tpl"}
                        {/if}

                        {if $isSet}
                           <form action="{url s=cart}" method="get" data-buy-form>
                              <input type="hidden" name="act" value="add">
                              <input type="hidden" value="1" name="redir">
                              <input type="hidden" name="IDproduct" value="{$body.product.id}">
                               {include "product/sets/product.submit-block.set.tpl"}
                           </form>
                        {else}
                            {get_unified_product product=$body.product assign="unifiedProduct"}
                            {include "product/product.ajax.tpl" product=$unifiedProduct hide_gallery=1}
                        {/if}

                        {ifmodule PRODUCTS__SETS}
                            {include "product/sets/product.usedInSets.tpl"}
                        {/ifmodule}
                    {else}
                        {include "product/product.soldout.tpl"}
                    {/if}
                {/if}
            </div>
         </div>
      </div>

      <div class="container product-bottom product-content">
         <div class="row">
            <div class="col-xxs-12 col-lg-7 col-xxl-7 column-left">
                {include "product/product.description.tpl"}

               <div class="templates-mobile">
                   {if $product_templates[4]}
                      <div class="description-box">
                          {include "product/product.template.tpl" category=1 show_id=4}
                      </div>
                   {/if}

                   {if $product_templates[8]}
                      <div class="ingredients">
                          {include "product/product.template.tpl" category=1 show_id=8}
                      </div>
                   {/if}

                   {if $product_templates[9]}
                      <div class="info">
                          {include "product/product.template.tpl" category=1 show_id=9}
                      </div>
                   {/if}
               </div>

                {include "components/banner-effects.tpl"}

                {include "reviews/product.reviews.tpl"}
            </div>

            <div class="col-xxs-12 col-lg-5 col-xxl-4 column-right pull-right product-info">
               <div class="templates-desktop">
                   {if $product_templates[4]}
                      <div class="description-box">
                          {include "product/product.template.tpl" category=1 show_id=4}
                      </div>
                   {/if}

                   {if $product_templates[8]}
                      <div class="ingredients">
                          {include "product/product.template.tpl" category=1 show_id=8}
                      </div>
                   {/if}

                   {if $product_templates[9]}
                      <div class="info">
                          {include "product/product.template.tpl" category=1 show_id=9}
                      </div>
                   {/if}
               </div>

                {*{include "product/product.params.tpl"}*}

                {foreach $descr_plus.blocks as $block}
                    {if $block.identifier == "product_side"}
                        {$block|inline_edit nofilter}
                    {/if}
                {/foreach}

                {ifmodule ARTICLES}
                {get_articles product_id=$body.product.id assign="product_articles" count=3}
                {if $product_articles.articles}
                   <h2><strong>Přečtěte si</strong></h2>
                   <div class="product-articles">
                       {include "articles/block.articles.small.tpl" articles=$product_articles.articles}
                   </div>
                {/if}
                {/ifmodule}

                {include "components/helpbox.tpl"}
            </div>
         </div>

      </div>

      <div class="container-product-slider">
          {insert_products type="related_product" product=$body.product count=12 in_store=1 image=2 id="related" template="components/block.products.product.tpl" listType='detail_related' listId=$body.product.id fallback=[['type'=>'related_product', 'products'=>$body.products], ['type'=>'bestselling_product', 'price_max'=>2500, 'order'=>'RAND()']]}
      </div>
       {include "components/badges.tpl"}
   </main>
   <div class="container newsletter">
       {include "components/newsletter.tpl"}
   </div>
{/block}


{block "body" append}
    {if !$body.product->isold() and !$isSet}
        {include "focus/focus.product-delivery.tpl" class="product-delivery"}
    {/if}
   <div class="set-selection-wrapper" data-sets="wrapper">
       {foreach $set.categories as $cat_id => $category}
           {include "focus/sets/focus.sets.tpl" class="product-set-focus"}
       {/foreach}
   </div>
{/block}

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

