{~@img_size=(@base_settings['product_button_width']*2).'_'.(@base_settings['product_button_width']*2)~}
<div>
<check if="{{!empty(@parent) || ((int)@base_settings['product_menu']==2 && (@page>1 || @page<@page_all))}}">
<button type="button" class="catalog_a catalog_navigation" href="/products/list">
	<i class="fas fa-home"></i>
	<br>
	<div class="small">Начало</div>
</button>
<check if="{{!empty(@parent)}}">
<button type="button" class="catalog_a catalog_navigation" href="/products/list?category_id={{@parent['parent_id']}}">
	<i class="fas fa-caret-left"></i>
	<br>
	<div class="small">Назад</div>
</button>
</check>
</check>
<button type="button" id="products_list_close" class="catalog_navigation" style="min-width:calc({{!empty(@parent) || ((int)@base_settings['product_menu']==2 && (@page>1 || @page<@page_all))?'33% - 10px':'100%'}})">
	<i class="fas fa-times"></i>
	<br>
	<div class="small">Закрыть</div>
</button>
</div>
<div id="catalog">
	<check if="{{@fast>0 && @base_settings['cafe_mode']==1 && in_array('products/fast_products', @authorization_user.module) && empty(@parent)}}">
	<button type="button" name="fast_product" class="show_window catalog_item button_with_icon" href="/products/fast_products" titel="Быстрые товары">
		<div class="category_icon">
			<i class="fas fa-thumbtack"></i>
		</div>
		<b>Быстрые<br>товары</b>
	</button>
	</check>
	<repeat group="{{@categories}}" value="{{@c}}">
	<button type="button" class="catalog_item catalog_a {{@c['icon'] && (@c['img']=='' || !@base_settings.show_product_img)?'button_with_icon':''}} {{@base_settings.show_product_img && @c['img']!=''?'product_with_img':''}}" style="{{@c['color']!='transparent'?'background-color: '.@c['color'].';':''}}; {{@base_settings.show_product_img && @c['img']!=''?'background-image:url(https://'.@api_data['domen'].'/upload/'.@api_data['subdomen'].'/'.@img_size.'/'.@c['img'].')':''}}" href="/products/list?category_id={{@c['id']}}">
		<check if="{{@c['icon'] && (@c['img']=='' || !@base_settings.show_product_img)}}">
		<div class="category_icon">
			{{@c['icon']|raw}}
		</div>
		</check>
		<b>{{@c['title']}}</b>
	</button>
	</repeat>
	<repeat group="{{@products}}" value="{{@p}}">
		<check if="{{@p['stop'] && @receipt['type']!=@receipt_print}}">
			<true>
				{~if(@p.images && is_array(@p.images))@img=array_shift(@p.images); else @img=false;~}
	<button id="add_product_{{@p['id']}}" type="button" class="catalog_item catalog_product {{@base_settings.show_product_img && isset(@p.images) && is_array(@p.images)?'product_with_img':''}}" disabled="true" style="{{@base_settings.show_product_img && @img?'background-image:url(https://'.@api_data['domen'].'/upload/'.@api_data['subdomen'].'/'.@img_size.'/'.@img.')':''}}">
		<b>
			<check if="{{@p.marking>0}}">
			<i class="fas fa-qrcode"></i>
			</check>
			{{@p.short_title}}
		</b>
		<div>
			<i class="fas fa-ban false"></i>
			<small>в стоп-листе</small>
		</div>
	</button>
			</true>
			<false>
				{~if(@p.images && is_array(@p.images)) @img=array_shift(@p.images); else @img=false~}
	<button id="add_product_{{@p['id']}}" type="button" class="catalog_item catalog_product {{@base_settings.show_product_img && isset(@p.images) && is_array(@p.images)?'product_with_img':''}}" href='/receipts/add_line?product_id={{@p["id"]}}&count={{@p["quantity"]}}' style="{{@base_settings.show_product_img && @img?'background-image:url(https://'.@api_data['domen'].'/upload/'.@api_data['subdomen'].'/'.@img_size.'/'.@img.')':''}}">
		<b>
			<check if="{{@p.marking>0}}">
			<i class="fas fa-qrcode"></i>
			</check>
			{{@p.short_title}}
		</b>
		<check if="{{!@base_settings['autonomous'] && in_array('products/currentstock', @authorization_user.module)}}">
		<div class="products_stock">{{@p['stock']!=''?@p['stock']:0}}</div>
		</check>
		<check if="{{(int)@base_settings['show_product_code']==1}}">
		<div class="products_code">{{@p['code']}}</div>
		</check>
		<div>
			{~@price=@p.price+(@p.price*(@p.vat/100))*max(0, @p.vat_type)~}
			<check if="{{@p.quantity!=1 && @p.quantity>0}}">
			{{numberformat(@p.quantity, 3, '.', '').@p.unit_short_title}}&equiv;
			</check>
			{{number_format(@price*(@p.quantity==0?1:@p.quantity), 2, '.', '')}}{{@p.unit_short_title!='' && @p.quantity==1?'/'.@p.unit_short_title:''}}
		</div>
	</button>
			</false>
		</check>
	</repeat>
</div>
<div id="products_list_arrows">
	<check if="{{@page>1}}">
	<button type="button" class="left catalog_a" href="/products/list?category_id={{@GET.category_id}}&page={{@page-1}}">
		<i class="fas fa-caret-left"></i>
		Стр. {{@page-1}}
	</button>
	</check>
	<check if="{{@page>1 || @page<@page_all}}">
	<div class="page_number">
		Стр. {{@page}}
	</div>
	</check>
	<check if="{{@page<@page_all}}">
	<button type="button" class="right catalog_a" href="/products/list?category_id={{@GET.category_id}}&page={{@page+1}}">
		Стр. {{@page+1}}
		<i class="fas fa-caret-right"></i>
	</button>
	</check>
</div>
<check if="{{@base_settings['product_button_width']!=125 && @base_settings['product_menu']==2}}">
<style>
@media (min-width: 961px) {
	#product_list_td_big #catalog .catalog_item {
		width: {{@base_settings['product_button_width']}}px !important;
		min-width: {{@base_settings['product_button_width']}}px !important;
		height: {{@base_settings['product_button_width']+(50*max(0, @base_settings['show_product_img']-1))}}px !important;
	}

	#product_list_td_big .title_under_img #catalog .product_with_img {
		background-size: auto {{@base_settings['product_button_width']}}px;
		padding-top: {{@base_settings['product_button_width']+5}}px;
	}
}
</style>
</check>