<main class="main main-category" data-filter-element data-filter="wrapper">
   <div class="container">
      {if $body.producer}
          {include "components/breadcrumbs.tpl"}

         <div data-reload="h1">
            <h1>{$view->getTitle()}</h1>
         </div>

         {if $body.producer.data.id_slider}
             {insert_slider id=$body.producer.data.id_slider template='block.slider.producer.tpl'}
         {/if}

         {if $body.producer.blocks['descr']}
            <div class="category-container">
               <div class="category-side">
                   {if $body.producer.image and !$cfg['znz_tpl']['hide_producer_logos']}
                      <img src="{static_url url=$body.producer.image.src}" alt="{$body.producer.name}" class="img-responsive">
                   {/if}
               </div>
               <div class="category-body">
                  <div data-reload="producer-descr">
                     <div class="category-description">
                         {$body.producer.blocks['descr']|inline_edit nofilter}

                         {if $body.producer.blocks['long_descr'] and $body.producer.blocks['long_descr'].content|strip_tags|count_characters}
                            <a href="#category-description" class="read-more-link" data-scrollto>{t}Číst více{/t}</a>
                         {/if}
                     </div>
                  </div>
               </div>
            </div>
         {/if}
      {/if}

       <div class="category-container">
          <div class="category-side" data-filters>
              {if !$body.producer.id}
                  {insert_sections level=1}
              {/if}
              {include "filter/filter.side.tpl" filter_openers=true}
          </div>

          <div class="category-body">
              {if !$body.producer}
                  {include "components/breadcrumbs.tpl"}

                 <div data-reload="h1">
                    <h1>{$view->getTitle()}</h1>
                 </div>
                 <div data-reload="category-descr">
                    <div class="category-description">
                        {$body.category.blocks['descr']|inline_edit nofilter}

                        {if ($body.category.blocks['long_descr'] and $body.category.blocks['long_descr'].content|strip_tags|count_characters)}
                           <a href="#category-description" class="read-more-link" data-scrollto>{t}Číst více{/t}</a>
                        {/if}
                    </div>
                 </div>
              {/if}


              {insert_subsections category=$body.category up=false css_class="subsection-column col-lg-3 col-md-4 col-sm-6 col-xxs-12"}

            {block 'top_product'}
               {insert_products type="top_product" in_store=1 show_producer=1 count=3 image=12 section=[$body.category.id] producer=[$body.producer.id] allow_virtual=1 template='category/block.products.bestsellers.tpl' listType='catalog_bestsellers' listId=$body.category.id}
            {/block}

            <div class="category-products" data-filter="products">
               {if $body.productsList|count}
                  {include "filter/filter.top.tpl"}
                  <div data-reload="products">
                     {if $isB2BUser && $body.listShow == '2'}
                        {include "block-products/block.products.b2b-list.tpl" products=$body.productsList}
                     {else}
                        {include "block.products.tpl" products=$body.productsList catalog_class="col-xl-3 col-md-4 col-xxs-6"}
                     {/if}
                     {if $body.pager.count > 1}
                        {$loader_text = "{t}Zobrazit další produkty{/t}"}
                        {include "components/pager.tpl" pager=$body.pager load_button=true show_arrows=true}
                     {/if}
                  </div>
               {else}
                  <div data-reload="products">
                     <div class="alert alert-info">
                        {t}Žádný produkt{/t}
                     </div>
                  </div>
               {/if}
            </div>
         </div>
      </div>

       {if $body.category.blocks['long_descr'] or $body.producer.blocks['long_descr']}
          <div{if $body.category.blocks['long_descr'].content|strip_tags|count_characters or $body.producer.blocks['long_descr'].content|strip_tags|count_characters or getAdminUser()} class="category-long-description"{/if}
             id="category-description">
              <div class="row">
                 <div class="col-xl-10 col-xl-offset-1 col-xxs-12">
                     {$body.category.blocks['long_descr']|inline_edit nofilter}
                     {$body.producer.blocks['long_descr']|inline_edit nofilter}
                 </div>
              </div>
          </div>
       {/if}
   </div>
</main>
