<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
$this->setFrameMode(true);

$title = "";
$subtitle = "";

if(!empty($arResult['TITLE']))
{
	$title = $arResult['TITLE'];
}

if(!empty($arResult['SUBTITLE']))
{
	$subtitle = $arResult['SUBTITLE'];
}

?>
<script>
	$(function()
	{
		section_code = "<?= $arResult['SECTION_CODE']; ?>";
		query = "<?= $arResult['QUERY']; ?>";
	});
</script>
<style>
	main {overflow-x: unset;}
</style>
<section data-page="catalog" id="catalog">
	<div class="container">
		<div id="view"></div>
		<div class="pageWithSide">
			<div class="leftColumn">
				<? if($arParams['PROGRAM'] !== "" && !is_null($arParams['PROGRAM'])): ?>
					<h2 class="section_title_with_em"><em><?= !empty($title) ? $title : "Новые автомобили в лизинг"; ?></em><?= $subtitle !== "" ? "<br>".$subtitle : ""; ?></h2>
				<? else: ?>
					<h1 class="section_title_with_em"><em><?= !empty($title) ? $title : "Новые автомобили в лизинг"; ?></em><?= $subtitle !== "" ? "<br>".$subtitle : ""; ?></h1>
				<? endif; ?>
				<div class="special_detail">
					<? if(!$arParams['top_banners']): ?>
					<? else: ?>
						<div class="special_offer">
							<h2>СКИДКИ ДО <span>1,5%</span> <mark>+</mark> СПЕЦТАРИФ НА КАСКО</h2>
							<ul class="list-column">
								<li>Скидки до 1,5% при покупке</li>
								<li>Land Rover в лизинг</li>
								<li>Специальный тариф на каско</li>
							</ul>
							<button class="button button-blue">Отправить заявку</button>
							<img src="/images/special_offer.jpg" alt="" />
						</div>
					<? endif; ?>
					<div id="filter" class="filter_in_catalog" style="display:block;">
						<div class="container">
							<? $APPLICATION->IncludeComponent(
								"evolution:form.catalog.filter",
								"",
								Array(
									"SELECTED" => $arResult['SELECTED'], 
									"PATH" => $arParams['PATH'], 
									"SORTING" => true, 
									"PROGRAM" => $arParams['PROGRAM'], 
									"SCROLL" => $arResult['SCROLL'], 
								)
							); ?>
						</div>
					</div>
					<? if($arParams['REGION'] === "root"): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.cities.list", 
							"", 
							Array(
								"TITLE" => "Выберите город", 
							)
						); ?>
					<? endif; ?>
					<? if(count($arResult['ITEMS']) > 0): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.sort",
							"",
							Array(
								"SORT" => $arParams['SORT'], 
								"FILTER" => $arResult['FILTER_SMALL'], 
							)
						); ?>
					<? else: ?>
						<div class="catalog_sort">
							<div class="sort_container sort_selector">
							</div>
						</div>
					<? endif; ?>
					<? if($arResult['BRAND_DISABLED'] && $arResult['MODEL_DISABLED']): ?>
						<p style="font-size: 18px; line-height: 24px; padding: 10px 40px 40px 0px; border-left: solid 1px white;">Автомобили <b><?= $arResult['TITLES']['BRAND']; ?></b> на данный момент отсутствуют в каталоге, но это не означает, что мы не сможем их для Вас найти. Оставьте <a href="#order">заявку</a> или позвоните по номеру горячей линии <a href="tel:88003337575">8 800 333 75 75</a> и мы найдём Вам автомобиль!</p>
						<p style="font-size: 18px; line-height: 24px; padding: 0px 40px 40px 0px; border-left: solid 1px white;">Посмотрите автомобили других марок:</p>
					<? else: ?>
						<? if($arResult['MODEL_DISABLED']): ?>
							<p style="font-size: 18px; line-height: 24px; padding: 10px 40px 40px 0px; border-left: solid 1px white;">Модель <b><?= $arResult['TITLES']['BRAND']; ?> <?= $arResult['TITLES']['MODEL']; ?></b> на данный момент отсутствует в каталоге, но это не означает, что мы не сможем её для Вас найти. Оставьте <a href="#order">заявку</a> или позвоните по номеру горячей линии <a href="tel:88003337575">8 800 333 75 75</a> и мы найдём Вам автомобиль!</p>
							<p style="font-size: 18px; line-height: 24px; padding: 0px 40px 40px 0px; border-left: solid 1px white;">Посмотрите другие модели <?= $arResult['TITLES']['BRAND']; ?>:</p>
						<? endif; ?>
					<? endif; ?>

					<? if($arParams['REGION'] !== "root"): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.city.team",
							"",
							Array(
								"CITY" => $arResult['CITY'], 
								"BRAND" => $arResult['TITLES']['BRAND'], 
								"MODEL" => $arResult['TITLES']['MODEL'], 
								"EXTENDED" => $arResult['EXTENDED'], 
							)
						); ?>
					<? endif; ?>

					<? if($arResult['SHOW_SPECIAL_OFFERS']): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.special.offers",
							"",
							Array(
								"COUNT" => 3, 
								"EXTENDED" => $arResult['EXTENDED'], 
								"BRAND_ID" => $arResult['SELECTED']['BRAND_ID'], 
								"FILTER_ARRAY" => [ "PROPERTY_ENGINE_FUEL" => $arResult['ENGINE_FUEL'], ], 
							)
						); ?>
					<? endif; ?>

					<? if($arResult['SHOW_PROMO_BRANDS']): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.promo.brand",
							"",
							Array(
								"COUNT" => 3, 
								"PATH" => $arParams['PATH'], 
								"QUERY_STRING" => "?ENGINE_FUEL=".$arResult['ENGINE_FUEL'], 
								"FILTER_ARRAY" => [ "ID" => $arResult['BRANDS_IDS'], ], 
								"PROPERTIES_FILTER_ARRAY" => [ "PROPERTY_ENGINE_FUEL" => $arResult['ENGINE_FUEL'], ], 
							)
						); ?>
					<? endif; ?>

					<? if($arResult['SHOW_PROMO_MODELS']): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.landing.promo.model",
							"",
							Array(
								"COUNT" => 3, 
								"PROPERTIES_FILTER_ARRAY" => [ "PROPERTY_ENGINE_FUEL" => $arResult['ENGINE_FUEL'], ], 
								"PROPERTIES_FILTER_ARRAY_MODELS" => [ "PROPERTY_PROMO_ENGINE_FUEL_VALUE" => "Да" ], 
								"PATH" => $arParams['PATH'], 
							)
						); ?>
					<? endif; ?>

					<? if(count($arResult['ITEMS']) > 0): ?>
						<div class="catalog_list" id="catalog_positions_list">
							<? foreach($arResult['ITEMS'] AS $arItem): ?>
								<? $APPLICATION->IncludeComponent(
									"evolution:catalog.list.item",
									"",
									$arItem
								); ?>
							<? endforeach; ?>
						</div>
						<? if($arResult['PAGE_COUNT'] > 1 && $arResult['PAGE_CURRENT'] != $arResult['PAGE_COUNT']): ?>
							<input type="hidden" id="current_page" value="<?= $arResult['PAGE_CURRENT']; ?>"/>
							<a class="catalog_show_more_button" id="catalog_get_more" style="cursor:pointer;">
								<span>Показать еще</span>
							</a>
						<? endif; ?>
						<?= $arResult['NAV_STRING']; ?>
					<? endif; ?>

					<? if($arResult['SHOW_BRANDS_LIST']): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.brands", 
							"", 
							Array(
								"PATH" => $arParams['PATH'], 
								"TITLE" => $arResult['CARS_CATALOG_TITLE'], 
								"SORT" => $arParams['SORT'], 
								"FILTER" => $arResult['FILTER_SMALL'], 
								"FILTER_ARRAY" => $arResult['FILTER_ARRAY'], 
								"BRANDS_IDS" => $arResult['BRANDS_IDS'], 
								"QUERY_STRING" => "?ENGINE_FUEL=".$arResult['ENGINE_FUEL'], 
								"PROPERTIES_FILTER_ARRAY" => [ '=PROPERTY_ENGINE_FUEL' => $arResult['ENGINE_FUEL'] ], 
							)
						); ?>
					<? endif; ?>
					<? if($arResult['SHOW_MODELS_LIST']): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.models", 
							"", 
							Array(
								"PATH" => $arParams['PATH'], 
								"BRAND" => $_REQUEST['BRAND'], 
								"RECOMMENDED" => true, 
								"REGIONS" => !is_null($arParams['REGION']) ? true : false, 
							)
						); ?>
					<? endif; ?>

					<? if(isset($arParams['REGION']) && $arParams['REGION'] !== "root"): ?>
						<? $APPLICATION->IncludeComponent(
							"evolution:catalog.city.offices", 
							"", 
							Array(
								"CITY" => $arResult['CITY'], 
							)
						); ?>
					<? endif; ?>

				</div>
			</div>
			<aside class="rightColumn">
				<? $APPLICATION->IncludeComponent(
					"evolution:banner.inner", 
					"", 
					Array(
					)
				); ?>
				<? $APPLICATION->IncludeComponent(
					"evolution:banner.ask", 
					"", 
					Array(
					)
				); ?>
			</aside>
		</div>
	</div>
</section>