{% if error %}
<div class="warning">{{ error }}</div>
{% else %}
  {% if products %}
    {% for product in products %}
      <label class="radio radio-medium js-table-product">
        <input type="radio" id="ajustem-item" name="ajustem-item" class="radio-entry {% if product.IsGrid %}js-radio-grade{% endif %}" value="{{ product.product_id }}">
        <span class="radio-text">
          <div class="row small-space-xs">
            <div class="col-xs-auto">
              <div class="content-box">
                <img src="{{ product.image }}" alt="{{ product.name }}" />
              </div>
            </div>
            <div class="col-xs">
              <div class="content-box">
                <span class="visible-block text-small text-gray">{{ product.model }}</span>
                <a href="{{ product.href }}" target="_blank" class="visible-block text-medium text-dark">{{ product.name }}</a>
                <span class="visible-block text-small text-gray">{{ product.category }}</span>
                {% if product.product_grid %}
                  <label class="field field-medium js-content-select-grid hidden">
                    <span class="field-label">Produtos da grade</span>
                    <select class="field-entry">
                      <option value="*">Selecione uma opção:</option>
                      {% for product_grid in product.product_grid %}
                        <option value="{{ product_grid.product_id }}">
                          {% if product_grid.color_description %} {{ product_grid.color_template_description }}: {{ product_grid.color_description }} {% endif %}
                          {% if product_grid.size_description %}  {{ product_grid.size_template_description }}: {{ product_grid.size_description }} {% endif %}
                          {% if product_grid.specification_description %} {{ product_grid.specification_template_description }}: {{ product_grid.specification_description }} {% endif %}
                        </option>
                      {% endfor %}
                    </select>
                  </label>
                {% endif %}
              </div>
            </div>
          </div>
        </span>
      </label>
    {% endfor %}
  {% else %}
    <span class="visible-block text-medium text-dark">Sem resultados!</span>
  {% endif %}
{% endif %}

{% if products %}
  {{ pagination }}
{% endif %}
