<?php echo $header; ?>
<?php if ($journal3->get('pageTitlePosition') == 'top') { ?>
  <h1 class="title page-title <?php echo $journal3->get("title_color_scheme"); ?>"><span class="page-title-text"><?php echo $heading_title; ?></span></h1>
<?php } ?>
<div class="breadcrumbs <?php echo $journal3->get("breadcrumbs_color_scheme"); ?>">
  <ul class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
      <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
    <?php } ?>
  </ul>
</div>
<?php echo $journal3_top; ?>
<div id="product-category" class="container">
  <div class="row"><?php echo $column_left; ?>
    <?php if ($column_left && $column_right) { ?>
    <?php $class = 'col-sm-6'; ?>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class = 'col-sm-9'; ?>
    <?php } else { ?>
    <?php $class = 'col-sm-12'; ?>
    <?php } ?>
    <div id="content" class="<?php echo $class; ?>">
      <?php if ($journal3->get('pageTitlePosition') == 'default') { ?>
      <h1 class="title page-title <?php echo $journal3->get("title_color_scheme"); ?>"><?php echo $heading_title; ?></h1>
      <?php } ?>
      <?php echo $content_top; ?>
      <?php if ($journal3->get('categoryPageDescStatus')) { ?>
      <?php if ($thumb || $description) { ?>
      <div class="category-description">
        <?php if ($thumb && $journal3->get('categoryPageCategoryImageStatus')) { ?>
        <img src="<?php echo $thumb; ?>" <?php if (!empty($thumb2x)) { ?>srcset="<?php echo $thumb; ?> 1x, <?php echo $thumb2x; ?> 2x"<?php } ?> alt="<?php echo $heading_title; ?>" title="<?php echo $heading_title; ?>" class="category-image"/>
        <?php } ?>
        <?php if ($description && $journal3->get('categoryPageCategoryDescriptionStatus')) { ?>
        <div class="category-text"><?php echo $description; ?></div>
        <?php } ?>
      </div>
      <?php } ?>
      <?php } ?>
      <?php if ($journal3->get('subcategoriesStatus')) { ?>
      <?php if ($categories) { ?>
      <div class="refine-categories refine-<?php echo $journal3->get('subcategoriesDisplay'); ?>">
      <?php if ($journal3->get('refineTitle')) { ?>
      <h3 class="refine-title title"><?php echo $journal3->get('refineTitleText'); ?></h3>
      <?php } ?>
      <?php if ($journal3->get('subcategoriesGridType') == 'ipr' && $journal3->get('subcategoriesDisplay') == 'carousel') { ?>
      <div class="swiper" data-items-per-row='<?php echo json_encode($journal3->get('subcategoriesItemsPerRow'), JSON_FORCE_OBJECT); ?>' data-options='<?php echo $journal3->jsonAttrs($journal3_images_carousel); ?>'>
        <div class="swiper-container" <?php if ($journal3->is_rtl) { ?>dir="rtl"<?php } ?>>
          <div class="swiper-wrapper ipr-grid">
            <?php foreach ($categories as $category) { ?>
            <div class="refine-item swiper-slide">
              <a href="<?php echo $category['href']; ?>">
                <?php if ($journal3->get('subcategoriesDisplay') != 'links') { ?>
                <img src="<?php echo $category['image']; ?>" <?php if (!empty($category['image2x'])) { ?>srcset="<?php echo $category['image']; ?> 1x, <?php echo $category['image2x']; ?> 2x"<?php } ?> alt="<?php echo $category['alt']; ?>"/>
                <?php } ?>
                <span class="refine-name"><?php echo $category['name']; ?></span>
              </a>
            </div>
            <?php } ?>
          </div>
        </div>
        <div class="swiper-buttons">
          <div class="swiper-button-prev"></div>
          <div class="swiper-button-next"></div>
        </div>
        <div class="swiper-pagination"></div>
      </div>
      <?php } else { ?>
      <div class="refine-items no-scroll <?php echo $journal3->get('subcategoriesGridType'); ?>-grid">
      <?php if ($journal3->get('subcategoriesGridType') == 'auto') { ?>
        <div class="auto-grid-items">
          <?php foreach ($categories as $category) { ?>
          <div class="refine-item">
            <a href="<?php echo $category['href']; ?>">
              <?php if ($journal3->get('subcategoriesDisplay') != 'links') { ?>
              <img src="<?php echo $category['image']; ?>" <?php if (!empty($category['image2x'])) { ?>srcset="<?php echo $category['image']; ?> 1x, <?php echo $category['image2x']; ?> 2x"<?php } ?> alt="<?php echo $category['alt']; ?>"/>
              <?php } ?>
              <span class="refine-name"><?php echo $category['name']; ?></span>
            </a>
          </div>
          <?php } ?>
        </div>
        <div class="auto-carousel-bar auto-carousel-controls"><div class="auto-carousel-thumb"></div><div class="auto-carousel-fill"></div></div>
        <div class="auto-carousel-buttons auto-carousel-controls"><div class="auto-carousel-prev"><span></span></div><div class="auto-carousel-next"><span></span></div></div>
      <?php } else { ?>
        <?php foreach ($categories as $category) { ?>
        <div class="refine-item">
          <a href="<?php echo $category['href']; ?>">
            <?php if ($journal3->get('subcategoriesDisplay') != 'links') { ?>
            <img src="<?php echo $category['image']; ?>" <?php if (!empty($category['image2x'])) { ?>srcset="<?php echo $category['image']; ?> 1x, <?php echo $category['image2x']; ?> 2x"<?php } ?> alt="<?php echo $category['alt']; ?>"/>
            <?php } ?>
            <span class="refine-name"><?php echo $category['name']; ?></span>
          </a>
        </div>
        <?php } ?>
      <?php } ?>
      </div>
      <?php } ?>
      </div>
      <?php } ?>
      <?php } ?>
      <div class="main-products-wrapper">
      <?php if ($products) { ?>
      <?php if ($journal3->get('sortBarStatus')) { ?>
      <div class="products-filter">
        <div class="grid-list">
          <button id="btn-grid-view" class="view-btn <?php if($journal3->get('globalProductView') == 'grid') { ?>active<?php } ?>" <?php if ($journal3->is_desktop) { ?>data-toggle="tooltip-hover"<?php } ?> title="<?php echo $button_grid; ?>" data-view="grid" aria-label="<?php echo $button_grid; ?>"></button>
          <button id="btn-list-view" class="view-btn <?php if($journal3->get('globalProductView') == 'list') { ?>active<?php } ?>" <?php if ($journal3->is_desktop) { ?>data-toggle="tooltip-hover"<?php } ?> title="<?php echo $button_list; ?>" data-view="list" aria-label="<?php echo $button_list; ?>"></button>
          <a href="<?php echo $compare; ?>" id="compare-total" class="compare-btn" title="<?php echo $text_compare; ?>"><?php echo $journal3_text_compare; ?></a>
        </div>
        <div class="select-group">
          <div class="input-group input-group-sm sort-by">
            <label class="input-group-addon" for="input-sort"><?php echo $text_sort; ?></label>
            <select id="input-sort" class="form-control">
              <?php foreach ($sorts as $sorts) { ?>
              <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
              <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
          </div>
          <div class="input-group input-group-sm per-page">
            <label class="input-group-addon" for="input-limit"><?php echo $text_limit; ?></label>
            <select id="input-limit" class="form-control">
              <?php foreach ($limits as $limits) { ?>
              <?php if ($limits['value'] == $limit) { ?>
              <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
          </div>
        </div>
      </div>
      <?php } ?>
      <div class="main-products main-products-style product-<?php echo $journal3->get('globalProductView'); ?> <?php echo $journal3->get('globalProductGridType'); ?>-grid" data-product-count="<?php echo $journal3_products_count; ?>">
        <?php echo $products; ?>
      </div>
      <div class="row pagination-results">
        <div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
        <div class="col-sm-6 text-right"><?php echo $results; ?></div>
      </div>
      <?php } ?>
      <?php if (!$categories && !$products) { ?>
      <p><?php echo $text_empty; ?></p>
      <div class="buttons">
        <div class="pull-right"><a href="<?php echo $continue; ?>" class="btn btn-primary"><?php echo $button_continue; ?></a></div>
      </div>
      <?php } ?>
      </div>
      <?php echo $content_bottom; ?></div>
    <?php echo $column_right; ?></div>
</div>
<?php echo $journal3_rich_snippets; ?>
<?php echo $footer; ?>
