<h1>{t}Vyhledávání{/t} {t}„{/t}{$body.search}{t}“{/t}</h1>

{$products = $body.results.products}
<div class="search-types">
   <div class="tabs search-tabs" data-tabs="search-results">
      <a href="#tabs-products" data-tab-target="#tabs-products" data-tabs="nav" class="nav-link active">
         {t pocet=$products.pager.total}Produkty ({pocet}){/t}</a>
      <div class="tab-pane active" id="tabs-products" data-tabs="content">
         <div class="category-body">
            {if $products.list|count}
               <div class="category-products">
                  {block "search-result-products"}
                     {include "block.products.tpl" products=$products.list}
                     {include "components/pager.tpl" pager=$products.pager show_arrows=true}
                  {/block}
               </div>
            {else}
               {insert_page type="EMPTY_SEARCH" exists='exists'}
               {if !$exists}
                  <div class="alert alert-info">
                     {t}Nenalezeno žádné zboží odpovídající těmto vlastnostem.{/t}
                  </div>
               {/if}
            {/if}
         </div>
      </div>

      {if $body.results.sections.list}
         <a href="#tabs-sections" data-tab-target="#tabs-sections" data-tabs="nav" class="nav-link">
            {t}Kategorie{/t} ({$body.results.sections.list|count})</a>
         <div class="tab-pane" id="tabs-sections" data-tabs="content">
            <div class="row subsections">
               {foreach $body.results.sections.list as $section}
                  {block "search-result-section"}
                     <div class="subsection-item search-results-item col-xxs-12 col-sm-6 col-md-4 col-xl-3">
                        <a href="{url s=category IDcat=$section.id}" class="subsection-item-inner">
                           <span class="subsection-item-title">{$section.name}</span>
                        </a>
                     </div>
                  {/block}
               {/foreach}
            </div>
         </div>
      {/if}

      {ifmodule PRODUCERS}
      {if $body.results.producers.list}
         <a href="#tabs-producers" data-tab-target="#tabs-producers" data-tabs="nav" class="nav-link">
            {t}Značky{/t} ({$body.results.producers.list|count})</a>
         <div class="tab-pane" id="tabs-producers" data-tabs="content">
            <div class="row subsections">
               {foreach $body.results.producers.list as $producer}
                  <div class="subsection-item search-results-item col-xxs-12 col-sm-6 col-md-4 col-xl-3">
                     <a href="{url s=category IDpd=$producer.id producerTitle=$producer.name}" class="subsection-item-inner">
                        <span class="subsection-item-title">{$producer.name}</span>
                     </a>
                  </div>
               {/foreach}
            </div>
         </div>
      {/if}
      {/ifmodule}

      {ifmodule ARTICLES}
      {if $body.results.articles.list}
         <a href="#tabs-articles" data-tab-target="#tabs-articles" data-tabs="nav" class="nav-link">
            {t}Články{/t} ({$body.results.articles.list|count})</a>
         <div class="tab-pane" id="tabs-articles" data-tabs="content">
            <div class="search-blog">
               {$id_array = []}
               {foreach $body.results.articles.list as $article}
                  {$id_array[$article.id] = $article.id}
               {/foreach}
               {insert_articles id=$id_array order_by=$id_array assign="articles"}
               {if $articles.articles}
                  {block "search-results-articles"}
                     {include "block.articles.tpl" articles=$articles.articles}
                  {/block}
               {/if}
            </div>
         </div>
      {/if}
      {/ifmodule}

      {if $body.results.pages.list}
         <a href="#tabs-menuitems" data-tab-target="#tabs-menuitems" data-tabs="nav" class="nav-link">
            {t}Ostatní{/t} ({$body.results.pages.list|count})</a>
         <div class="tab-pane" id="tabs-menuitems" data-tabs="content">
            <div class="row subsections">
               {foreach $body.results.pages.list as $page}
                  {block "search-result-menuitem"}
                     <div class="subsection-item search-results-item col-xxs-12 col-sm-6 col-md-4 col-xl-3">
                        <a href="{$page.url}" class="subsection-item-inner">
                           <span class="subsection-item-title">{$page.name}</span>
                        </a>
                     </div>
                  {/block}
               {/foreach}
            </div>
         </div>
      {/if}
   </div>
</div>
