/**
 * Поиск по сайту — свой блок в шапке (разметка в header.php, логика в assets/js/search.js).
 *
 * Стилей Tilda здесь нет намеренно: её оформление виджета подгружалось скриптом уже
 * после отрисовки страницы и прятало кнопку правилом display:none — из-за чего лупа
 * появлялась, исчезала и появлялась снова. Теперь всё своё и грузится вместе со страницей.
 */

/* ---------- плавающая кнопка ---------- */

/* Кружок под лупой — как на витрине: белый на 80%, мягкая тень, 80×80. */
.wsn-search-btn {
	position: fixed;
	top: 120px;
	right: 20px;
	z-index: 4000;
	width: 80px;
	height: 80px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .8);
	box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2);
	overflow: hidden;
	cursor: pointer;
	line-height: 0;
	will-change: transform;
	transition: transform .2s ease-in-out;
}

.wsn-search-btn:hover,
.wsn-search-btn:focus-visible { transform: scale(1.08); }

.wsn-search-btn svg { display: block; width: 80px; height: 80px; }

/* ---------- окно поиска ---------- */

.wsn-search {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: #fff;
	overflow-y: auto;
	font-family: 'Montserrat', Arial, sans-serif;
}

.wsn-search[hidden] { display: none; }

.wsn-search__head {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 30px 40px;
	background: #fff;
	border-bottom: 1px solid #eee;
}

.wsn-search__field {
	position: relative;
	flex: 1 1 auto;
	max-width: 1140px;
	margin: 0 auto;
}

.wsn-search__icon {
	position: absolute;
	top: 50%;
	left: 18px;
	transform: translateY(-50%);
	pointer-events: none;
}

.wsn-search__input {
	width: 100%;
	box-sizing: border-box;
	height: 60px;
	padding: 0 52px 0 56px;
	border: 1px solid #d5d5d5;
	border-radius: 12px;
	font-size: 18px;
	font-family: inherit;
	color: #000;
	outline: none;
	background: #fff;
}

.wsn-search__input:focus { border-color: #408dda; }
.wsn-search__input::placeholder { color: #000; opacity: .4; }

.wsn-search__clear {
	position: absolute;
	top: 50%;
	right: 18px;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	line-height: 0;
	display: none;
}

.wsn-search__clear svg { display: block; margin: auto; }
.wsn-search_filled .wsn-search__clear { display: block; }

.wsn-search__close {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	line-height: 0;
}

/* ---------- результаты ---------- */

.wsn-search__body {
	max-width: 1140px;
	margin: 0 auto;
	padding: 30px 40px 60px;
}

.wsn-search__count {
	margin-bottom: 24px;
	font-size: 15px;
	color: #000;
	opacity: .5;
}

.wsn-search__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 34px 40px;
}

.wsn-search__item {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	color: inherit;
	text-decoration: none;
}

.wsn-search__img {
	flex: 0 0 auto;
	width: 106px;
	height: 106px;
	border-radius: 6px;
	background: #f4f4f4 center / cover no-repeat;
}

.wsn-search__title {
	margin-bottom: 6px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	color: #000;
}

.wsn-search__desc {
	margin-bottom: 8px;
	font-size: 15px;
	line-height: 1.4;
	color: #000;
	opacity: .5;
}

/* совпадение подсвечиваем жирным — так было в выдаче витрины */
.wsn-search__desc b,
.wsn-search__title b { font-weight: 700; opacity: 1; }

.wsn-search__price {
	font-size: 16px;
	font-weight: 700;
	color: #000;
}

.wsn-search__empty {
	font-size: 17px;
	color: #000;
	opacity: .6;
}

@media screen and (max-width: 960px) {
	.wsn-search-btn { top: 60px; right: 10px; width: 60px; height: 60px; }
	.wsn-search-btn svg { width: 60px; height: 60px; }
	.wsn-search__head { padding: 16px 16px; gap: 14px; }
	.wsn-search__input { height: 50px; font-size: 16px; padding: 0 46px 0 48px; }
	.wsn-search__body { padding: 20px 16px 40px; }
	.wsn-search__list { grid-template-columns: 1fr; gap: 24px; }
	.wsn-search__img { width: 84px; height: 84px; }
}
