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

{$description = false}
{foreach $descr_plus.blocks as $block}
   {if $block.identifier == "product_descr"}
      {$description = $block}
   {/if}
{/foreach}

{if $body.product.links}
   {foreach $body.product.links as $link}
      {if $link.type == 'youtube'}
         {$video_links[] = $link}
      {/if}
   {/foreach}
{/if}

<div class="product-bottom">
   {foreach $body.product.param[20].values|default:[] as $key=>$param}
      {if in_array($param.data.position, [4,5,6])}
         {$material = true}
      {/if}
   {/foreach}

   {include 'product/product.sticky-info.tpl'}
   <div class="container-narrow">
      {include 'product/product.description.tpl'}

      {* todo activity, vlastnosti, materiály *}

      {if $video_links|count > 0}
         <a href="#video" class="alter-nav-link" data-opener="#video">{t}Video{/t}</a>
         <div class="product-video" id="video">
            <div class="container">
               <h3 class="title"><span class="fc icons_youtube"></span>{t}Video{/t}</h3>
               {foreach $video_links as $video}
                  {$link = $video.link|replace:'watch?v=':'embed/'}
                  <div class="video-wrapper">
                     <iframe frameborder="0"
                             allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
                             allowfullscreen src="{$link}"></iframe>
                  </div>
               {/foreach}
            </div>
         </div>
      {/if}

      {if $material}
         <a href="#properties" class="alter-nav-link" data-opener="#properties">{t}Vlastnosti produktu{/t}</a>
         <div class="product-properties" id="properties">
            <div class="container">
               <h3 class="title">{t}Vlastnosti produktu{/t}</h3>
               {include 'product/product.materials.tpl'}
            </div>
         </div>
      {/if}

      <a href="#reviews" class="alter-nav-link" data-opener="#reviews">{t}Recenze{/t}
         {if $product_reviews.rating_count}
            <div class="review-stars">
               {for $i=1 to 5}
                  <i class="fc {if $i > $product_reviews.rating|round}icons_star{else}icons_star_full{/if}"></i>
               {/for}
            </div>
         {/if}
      </a>
      <div class="product-reviews" id="reviews">
         <div class="container">
            {include 'product/product.reviews.tpl'}
         </div>
      </div>
   </div>
   {include 'components/block.products.related.tpl'}
</div>

