/**
 * Поиск (arturgolubev:search.title) — стили 1 в 1 как в React (Header.module.css .search, .searchButton, .searchDropdown).
 * Обёртка: .tsk-search-wrap. Компонент Голубева даёт свои стили — перебиваем только нужные через !important.
 */

/* Родители поиска — 100% ширины, чтобы #smart-title-search не обрезался */
.header-full-cont,
.header-full-cont .upper-line-header {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.header-full-cont .tsk-search-wrap {
	flex: 1 1 0;
	min-width: 0;
}

/* Переменные как в React (globals.css) */
.tsk-search-wrap {
	--primary-color: #ffcc33;
	--primary-color-light: rgba(255, 204, 51, 0.1);
}

.tsk-search-wrap {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	font-family: "Montserrat", sans-serif;
	box-sizing: border-box;
}

/* Контейнер #smart-title-search — 100% ширины, чтобы не обрезался */
.tsk-search-wrap #smart-title-search {
	width: 100%;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
}

/* ========== Контейнер поиска = .search в React (строка 302) ========== */
.tsk-search-wrap .bx-searchtitle {
	display: flex;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	margin: auto;
	flex-direction: row;
	position: relative;
	background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
	border-radius: 12px;
	padding: 3px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow:
		0 2px 8px rgba(0, 0, 0, 0.04),
		inset 0 1px 2px rgba(255, 255, 255, 0.8);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 100;
	box-sizing: border-box;
}

.tsk-search-wrap .bx-searchtitle:focus-within {
	border-color: rgba(255, 204, 51, 0.4);
	box-shadow:
		0 3px 12px rgba(255, 204, 51, 0.12),
		inset 0 1px 2px rgba(255, 255, 255, 0.9);
	transform: translateY(-1px);
}

.tsk-search-wrap .bx-searchtitle form {
	display: flex;
	width: 100%;
	min-width: 0;
	position: relative;
	align-items: center;
	margin: 0;
}

.tsk-search-wrap .bx-input-group {
	display: flex;
	width: 100%;
	min-width: 0;
	position: relative;
	align-items: center;
	border: none;
	background: transparent;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

/* ========== Поле ввода = .search input в React (строка 332) ========== */
/* Перебиваем стили компонента Голубева */
.tsk-search-wrap #smart-title-search-input,
.tsk-search-wrap .bx-searchtitle .bx-input-group .bx-form-control,
.tsk-search-wrap .bx-form-control {
	background-color: rgba(255, 255, 255, 0.95) !important;
	color: #1a1a1a !important;
	padding: 8px 90px 8px 16px !important;
	border-radius: 10px !important;
	border: none !important;
	border-right: none !important;
	width: 100% !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	outline: none !important;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
	backdrop-filter: blur(10px);
	letter-spacing: 0.2px;
	height: auto !important;
	min-height: 38px !important;
	box-sizing: border-box !important;
	box-shadow: none !important;
}

.tsk-search-wrap .bx-searchtitle.theme-black .bx-input-group .bx-form-control {
	border-color: transparent !important;
	background-color: rgba(255, 255, 255, 0.95) !important;
	border: none !important;
}

.tsk-search-wrap .bx-input-group span button {
	border: none;
	background: transparent;
}

.tsk-search-wrap .bx-form-control::placeholder {
	color: #9ca3af;
	font-style: normal;
	font-weight: 400;
}

.tsk-search-wrap .bx-form-control:focus {
	background-color: rgba(255, 255, 255, 1) !important;
	box-shadow: 0 0 0 3px rgba(255, 204, 51, 0.15) !important;
}

/* ========== Кнопка «Найти» = .searchButton в React (строка 358) ========== */
.tsk-search-wrap .bx-input-group-btn {
	position: absolute !important;
	right: 3px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 2px;
	border: none !important;
	background: transparent !important;
	padding: 0 !important;
	margin: 0 !important;
	width: auto !important;
}

/* Кнопка поиска = Header_searchButton в React (position absolute на группе, стили на button) */
.tsk-search-wrap .bx-input-group-btn button,
.tsk-search-wrap .bx-searchtitle.theme-black .bx-input-group-btn button,
.tsk-search-wrap .bx-input-group-btn button.tsk-search-btn {
	position: relative;
	right: auto;
	top: auto;
	transform: none;
	background: linear-gradient(
		135deg,
		var(--primary-color) 0%,
		var(--primary-color) 50%,
		var(--primary-color) 100%
	);
	background-size: 200% 200%;
	border: 1px solid rgba(255, 204, 51, 0.3);
	cursor: pointer;
	padding: 7px 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow:
		0 3px 10px rgba(255, 204, 51, 0.3),
		inset 0 1px 2px rgba(255, 255, 255, 0.5);
	font-weight: 600;
	color: #1a1a1a;
	height: auto;
	overflow: hidden;
	font-family: "Montserrat", sans-serif;
	font-size: 13px;
	outline: none;
}

.tsk-search-wrap .bx-input-group-btn button:hover,
.tsk-search-wrap .bx-input-group-btn button:focus {
	outline: none;
}

/* Иконка поиска (лупа) в кнопке */
.tsk-search-wrap .bx-input-group-btn button svg {
	display: block;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

/* Блик при наведении = :before в React */
.tsk-search-wrap .bx-input-group-btn button::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.3),
		transparent
	);
	transition: left 0.5s ease;
}

/* Наведение = Header_searchButton:hover в React */
.tsk-search-wrap .bx-input-group-btn:hover {
	transform: translateY(calc(-50% - 1px));
}

.tsk-search-wrap .bx-input-group-btn button:hover {
	background-position: 100% 0;
	box-shadow:
		0 4px 12px rgba(255, 204, 51, 0.4),
		inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* Перебиваем стили темы .theme-black (background-color #5c5c5c от компонента при hover) */
.tsk-search-wrap .bx-searchtitle.theme-black .bx-input-group-btn button:hover {
	background-color: transparent !important;
	background-image: linear-gradient(
		135deg,
		#ffcc33 0%,
		#ffcc33 50%,
		#ffcc33 100%
	) !important;
	background-position: 100% 0 !important;
	border-color: rgba(255, 204, 51, 0.3) !important;
	text-decoration: none !important;
	box-shadow:
		0 4px 12px rgba(255, 204, 51, 0.4),
		inset 0 1px 2px rgba(255, 255, 255, 0.6) !important;
}

.tsk-search-wrap .bx-input-group-btn button:hover::before {
	left: 100%;
}

/* Active */
.tsk-search-wrap .bx-input-group-btn:active {
	transform: translateY(-50%);
}

.tsk-search-wrap .bx-input-group-btn button:active {
	box-shadow:
		0 2px 6px rgba(255, 204, 51, 0.3),
		inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Прелоадер и очистка */
.tsk-search-wrap .bx-searchtitle-preloader,
.tsk-search-wrap .bx-searchtitle-clear {
	position: relative;
	margin: 0 2px;
}

/* ========== Выпадающий блок — в стиле шапки/подвала (границы, акцент #ffcc33) ========== */
/* Контейнер результата (позиция/ширина задаются скриптом) */
.tsk-search-wrap .title-search-result,
.tsk-search-wrap .bx_smart_searche.bx_searche {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 6px;
	background: rgba(255, 255, 255, 0.98);
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 12px;
	box-shadow:
		0 4px 20px rgba(0, 0, 0, 0.08),
		0 2px 8px rgba(0, 0, 0, 0.04);
	z-index: 10000;
	max-height: 420px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: "Montserrat", sans-serif;
}

.tsk-search-wrap .title-search-result .bx_smart_searche {
	position: static;
	margin-top: 0;
}

.tsk-search-wrap .bx_smart_searche .bx_item_block {
	flex: 1;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #ffcc33 #f0f0f0;
}

.tsk-search-wrap .bx_smart_searche .bx_item_block::-webkit-scrollbar {
	width: 6px;
}

.tsk-search-wrap .bx_smart_searche .bx_item_block::-webkit-scrollbar-track {
	background: #f5f5f5;
	border-radius: 3px;
}

.tsk-search-wrap .bx_smart_searche .bx_item_block::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, #ffcc33, #ffd700);
	border-radius: 3px;
}

.tsk-search-wrap
	.bx_smart_searche
	.bx_item_block::-webkit-scrollbar-thumb:hover {
	background: #e0b300;
}

/* Карточка товара */
.tsk-search-wrap .bx_item_block_href {
	display: flex;
	align-items: flex-start;
	padding: 12px 16px;
	text-decoration: none;
	color: #1a1a1a;
	transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	box-sizing: border-box;
	gap: 12px;
}

.tsk-search-wrap .bx_item_block_href:hover {
	background: rgba(255, 204, 51, 0.08);
}

.tsk-search-wrap .bx_item_block_hrline {
	height: 1px;
	margin: 0 16px;
	background: rgba(0, 0, 0, 0.06);
	border: none;
}

/* Миниатюра (перебиваем инлайн-стили компонента) */
.tsk-search-wrap .bx_item_block_item_image {
	flex-shrink: 0;
	width: 48px !important;
	height: 48px !important;
	min-width: 48px !important;
	min-height: 48px !important;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.06);
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fafafa;
}

.tsk-search-wrap .bx_item_block_item_image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Обёртка названия/описания/цены (перебиваем инлайн padding-left) */
.tsk-search-wrap .bx_item_block_item_info_wrap {
	flex: 1;
	min-width: 0;
	padding-left: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.tsk-search-wrap .bx_item_block_item_info_wrap_flex {
	min-height: auto;
}

.tsk-search-wrap .bx_item_block_item_info_wrap_inner {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 12px;
}

/* Название и описание */
.tsk-search-wrap .bx_item_block_item_name,
.tsk-search-wrap .bx_item_block_item_info_text {
	font-size: 13px;
	line-height: 1.35;
	color: #1a1a1a;
}

.tsk-search-wrap .bx_item_block_item_name b {
	font-weight: 700;
}

.tsk-search-wrap .bx_item_block_item_text {
	font-size: 12px;
	line-height: 1.4;
	color: #606060;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	width: 100%;
}

.tsk-search-wrap .bx_item_block_href_category_title {
	display: none;
}

/* Цена — акцент как в подвале */
.tsk-search-wrap .bx_item_block_item_price,
.tsk-search-wrap .bx_smart_searche .bx_price_new {
	font-weight: 700;
	font-size: 14px;
	color: #1a1a1a;
	white-space: nowrap;
}

.tsk-search-wrap .bx_smart_searche .bx_price_new {
	color: #b8860b;
}

/* Выбранная строка (клавиатурная навигация) */
.tsk-search-wrap .bx_item_block_href.title-search-selected,
.tsk-search-wrap .title-search-result .title-search-selected {
	background: rgba(255, 204, 51, 0.12);
}

/* «Все результаты» — кнопка в стиле сайта */
.tsk-search-wrap .bx_item_block.all_result {
	padding: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	flex-shrink: 0;
	background: #fafafa;
}

.tsk-search-wrap .all_result_button {
	display: block;
	padding: 12px 16px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: #1a1a1a;
	text-decoration: none;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	border: none;
	background: transparent;
	width: 100%;
	cursor: pointer;
	font-family: "Montserrat", sans-serif;
}

.tsk-search-wrap .all_result_button:hover,
.tsk-search-wrap .bx_item_block.all_result:hover .all_result_button {
	background: rgba(255, 204, 51, 0.12);
	color: #1a1a1a;
}

/* «Ничего не найдено» */
.tsk-search-wrap .bx_smart_searche .bx_item_block_title:only-child,
.tsk-search-wrap
	.bx_smart_searche
	.bx_item_block_item_info_text:empty
	+ .bx_item_block_item_clear {
	padding: 20px 16px;
	text-align: center;
	color: #606060;
	font-size: 13px;
	font-family: "Montserrat", sans-serif;
}

/* Подсветка совпадения в названии */
.tsk-search-wrap .bx_smart_searche mark {
	background: linear-gradient(
		180deg,
		transparent 60%,
		rgba(255, 204, 51, 0.35) 60%
	);
	color: #1a1a1a;
	padding: 0 1px;
	border-radius: 0;
	font-weight: 700;
}

/* 960px — компактнее как в React */
@media (max-width: 960px) {
	.tsk-search-wrap .bx-form-control,
	.tsk-search-wrap #smart-title-search-input {
		padding: 7px 85px 7px 14px !important;
		font-size: 12px !important;
	}

	.tsk-search-wrap .bx-input-group-btn button {
		padding: 6px 14px;
		font-size: 12px;
	}
}

@media (max-width: 768px) {
	.tsk-search-wrap .bx-form-control,
	.tsk-search-wrap #smart-title-search-input {
		padding: 6px 80px 6px 12px !important;
		font-size: 12px !important;
	}

	.tsk-search-wrap .bx-input-group-btn button {
		padding: 5px 12px;
		font-size: 12px;
	}
}

/* Выпадающий список — те же стили, если контейнер вне .tsk-search-wrap (позиция задаётся скриптом) */
.title-search-result {
	background: rgba(255, 255, 255, 0.98) !important;
	border: 1px solid rgba(0, 0, 0, 0.06) !important;
	border-radius: 12px !important;
	box-shadow:
		0 4px 20px rgba(0, 0, 0, 0.08),
		0 2px 8px rgba(0, 0, 0, 0.04) !important;
	overflow: hidden;
	font-family: "Montserrat", sans-serif;
}
