/* Живой поиск калькуляторов в шапке (см. includes/calc-search.php и calc-search.js). */

.cl-hsearch { position: relative; display: flex; align-items: center; }

.cl-hsearch__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #0f2740;
	background: #fff;
	border: 1px solid #dfe3e8;
	border-radius: 4px;
	cursor: pointer;
}

.cl-hsearch__field {
	position: relative;
	display: flex;
	align-items: center;
	width: 300px;
}
/* Лупа справа, как у grandline: слева тогда остаётся ровный отступ у текста. */
.cl-hsearch__ico {
	position: absolute;
	right: 12px;
	color: #98a2ae;
	pointer-events: none;
}
.cl-hsearch__input {
	width: 100%;
	height: 44px;
	padding: 0 40px 0 14px;
	font-size: 14px;
	line-height: 1.2;
	color: #111827;
	background: #fff;
	border: 1px solid #dfe3e8;
	border-radius: 4px;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
}
.cl-hsearch__input::placeholder { color: #9aa7b6; }
.cl-hsearch__input:hover { border-color: #c9d1d9; }
.cl-hsearch__input:focus { border-color: #2b5876; box-shadow: 0 0 0 3px rgba(43, 88, 118, .12); }
.cl-hsearch__input::-webkit-search-cancel-button { display: none; }

.cl-hsearch__clear {
	position: absolute;
	right: 36px;
	width: 20px;
	height: 20px;
	padding: 0;
	font-size: 17px;
	line-height: 1;
	color: #94a3b8;
	background: transparent;
	border: 0;
	cursor: pointer;
}
.cl-hsearch__clear:hover { color: #475569; }

/* ---------- выпадающие результаты ---------- */

.cl-hsearch__drop {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 9500;
	width: 360px;
	max-width: calc(100vw - 24px);
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #dfe3e8;
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
	padding: 6px;
}
.cl-hsearch__head {
	padding: 6px 10px 4px;
	font: 700 11px/1.2 Arial, sans-serif;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #94a3b8;
}
.cl-hsearch__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 10px;
	border-radius: 3px;
	text-decoration: none;
	color: #1f2937;
}
.cl-hsearch__item:hover,
.cl-hsearch__item.is-active { background: #eff6ff; }
.cl-hsearch__thumb {
	flex: none;
	width: 44px;
	height: 32px;
	object-fit: contain;
	border-radius: 5px;
	background: #f1f5f9;
}
.cl-hsearch__thumb--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
}
.cl-hsearch__text { display: flex; flex-direction: column; min-width: 0; }
.cl-hsearch__name {
	font-size: 13.5px;
	line-height: 1.3;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.cl-hsearch__cat { font-size: 11.5px; color: #94a3b8; }
.cl-hsearch__empty { padding: 14px 10px; text-align: center; color: #94a3b8; font-size: 13px; }

/* На узких экранах поле прячется за лупу, чтобы не давить логотип и бутерброд. */
@media (max-width: 960px) {
	.cl-hsearch__toggle { display: inline-flex; }
	.cl-hsearch__field { display: none; }
	.cl-hsearch.is-open { position: static; }
	.cl-hsearch.is-open .cl-hsearch__field {
		display: flex;
		position: absolute;
		left: 12px;
		right: 12px;
		top: 100%;
		width: auto;
		z-index: 9600;
	}
	.cl-hsearch.is-open .cl-hsearch__toggle { color: #2b5876; border-color: #2b5876; }
	.cl-hsearch__drop { left: 12px; right: 12px; width: auto; top: calc(100% + 56px); }
}

@media print {
	.cl-hsearch { display: none !important; }
}
