<h1>{{ heading_title }}</h1>

{% if image or description %}
  <div class="row">
    {% if image %}
      <div class="col-3"><img src="{{ image }}" alt="{{ heading_title }}" title="{{ heading_title }}" class="img-thumbnail" style="width: 268px"/></div>
    {% endif %}
    {% if description %}
      <div class="col-9">{{ description }}</div>
    {% endif %}
  </div>
  <hr/>
{% endif %}

{% if categories %}

  <h3>{{ text_refine }}</h3>
  {% if categories|length <= 5 %}
    <div class="row">
      <div class="col-sm-3">
        <ul>
          {% for category in categories %}
            <li><a href="{{ category.href }}">{{ category.name }}</a></li>
          {% endfor %}
        </ul>
      </div>
    </div>
  {% else %}
    <div class="row row-cols-sm-2 row-cols-lg-4">
      {% set total = category.children|length %}
      {% if total > 20 %}
        {% set batch = (total / 4)|round(0, 'ceil') %}
      {% else %}
        {% set batch = 5 %}
      {% endif %}
      {% for category in categories|batch(batch) %}
        <div class="col">
          <ul>
            {% for child in category %}
              <li><a href="{{ child.href }}">{{ child.name }}</a></li>
            {% endfor %}
          </ul>
        </div>
      {% endfor %}
    </div>
    <br/>
  {% endif %}

{% endif %}

<product-list sort="" order=""></product-list>