<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>

<div class="container">
	<a href="/" class="logo">
		<img src="/images/logo.svg" alt="" width="217px" height="32px" />
	</a>
	
	<div class="header_menu">
		<div class="header_search">
			<form action="/search/">
				<div class="form_field">
					<input type="search" placeholder="Поиск" name="q" minlength="2" required>
				</div>
				<button type="submit" class="button button-blue">Поиск</button>
			</form>
		</div>
		<nav>
			<?
				$selected = "Главная";
				foreach($arResult as $arItem)
				{
					if($arItem["SELECTED"])
					{
						$selected = $arItem['TEXT'];
						break;
					}
				}
			?>
			<button class="nav_toggle"><?= $selected; ?></button> 
			<ul id="menu_list">
				<li>
					<form action="/search/">
						<input type="search" name="q" placeholder="Поиск" minlength="2" required/>
						<button type="submit" aria-label="Найти"></button>
					</form>
				</li>
				<li><a href="/">Главная</a></li>
				<?if (!empty($arResult)):?>
					<? foreach($arResult as $arItem): ?>
						<? if($arItem["SELECTED"]): ?>
							<li class="active"><a href="<?= $arItem["LINK"]; ?>" style="white-space: nowrap;"><?= $arItem["TEXT"]; ?></a></li>
						<? else: ?>
							<li style="white-space: nowrap;"><a href="<?= $arItem["LINK"]; ?>"><?= $arItem["TEXT"]; ?></a></li>
						<? endif ?>
					<? endforeach ?>
				<? endif ?>
			</ul>
		</nav>
		<div class="header_buttons_wrapper">
			<a id="comagic1" href="tel:88003337575">8 800 333 75 75</a>
			<? $APPLICATION->IncludeComponent(
				"evolution:callback.button",
				"",
				Array()
			); ?>
		</div>
	</div>
	<a href="https://lk.evoleasing.ru/" class="lk" title="Личный кабинет" target="_blank"></a>
</div>