{% macro card(product) %}
{% set title = product.name[language] ~ ' ' ~ product.brand[language] ~ format_dimensions(product.dimensions.x, product.dimensions.y, product.dimensions.z, ' ') ~ ' ' ~ product.weight ~ 'г' %}
<article id="{{ product.getId() }}" class="product unselectable">
	<a data-product-identifier="{{ product.identifier }}" onclick="core.catalog.product(this)" onkeydown="event.keyCode === 13 && core.catalog.product(this)" tabindex="10">
		<img src="{{ product.images.0.storage }}" alt="{{ product.name[language] }}" ondrugstart="return false;">
		<p class="title" title="{{ product.name[language] }}">
			{{ title | length > 45 ? title | slice(0, 45) ~ '...' : title }}
		</p>
	</a>
	<button title="Добавить в корзину" onclick="catalog.cart.add(this)" tabindex="15">
		{{ product.cost }}р
	</button>
</article>
{% endmacro %}
{% if products is not empty %}
<section class="unselectable" data-section="catalog" data-catalog-type="products" data-catalog-level="{{ level ?? 0 }}">
	<div class="column">
		{% for product in products %}
		{% if loop.index % 2 == 0 %}
		{{ _self.card(product) }}
		{% endif %}
		{% endfor %}
	</div>
	<div class="column">
		{% for product in products %}
		{% if loop.index % 2 == 1 %}
		{{ _self.card(product) }}
		{% endif %}
		{% endfor %}
	</div>
</section>
{% endif %}
