/**
 * Оформлення живого пошуку FindFast під стиль timss-parfum.com.ua.
 * Палітра сайту: білий фон, текст #282828, акцент #cd2122, рамки #e9eaea,
 * Montserrat, радіус 3px. Файл лежить у містку, а не в самому FindFast —
 * оновлення плагіна його не зачепить.
 */

.ff-search {
	position: relative;
	/* Без власного z-index випадайку перекривають наступні віджети
	   сайдбару — вони йдуть далі в DOM і малюються поверх. */
	z-index: 60;
	font-family: "Montserrat", Helvetica, Arial, sans-serif;
}

/* ------------------------------------------------------------------ *
 * Поле вводу
 * ------------------------------------------------------------------ */

.ff-search .ff-search__input {
	width: 100%;
	height: 44px;
	padding: 0 40px 0 14px;
	font-family: inherit;
	font-size: 14px;
	color: #282828;
	background: #fff;
	border: 1px solid #e9eaea;
	border-radius: 3px;
	box-shadow: none;
	transition: border-color .2s ease;
}

.ff-search .ff-search__input::placeholder {
	color: #a3a3a3;
}

.ff-search .ff-search__input:focus {
	outline: none;
	border-color: #cd2122;
}

/* ------------------------------------------------------------------ *
 * Випадайка
 * ------------------------------------------------------------------ */

.ff-search .ff-search__results {
	position: absolute;
	/* Вище за промо-картку Premium Collection (9997): поки людина шукає,
	   видача важливіша за банер. */
	z-index: 10000;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	max-height: 420px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border: 1px solid #e9eaea;
	border-radius: 3px;
	box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .28);
	animation: ff-drop .18s ease both;
}

@keyframes ff-drop {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

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

.ff-search .ff-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ------------------------------------------------------------------ *
 * Рядок товару
 * ------------------------------------------------------------------ */

.ff-search .ff-item + .ff-item {
	border-top: 1px solid #f1f1f2;
}

.ff-search .ff-item__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	text-decoration: none;
	color: #282828;
	transition: background-color .16s ease;
}

.ff-search .ff-item__link:hover,
.ff-search .ff-item.is-active .ff-item__link {
	background: #f7f7f8;
	color: #282828;
}

.ff-search .ff-item__img {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	object-fit: cover;
	background: #f4f4f5;
	/* Фото товарів зняті на світлому тлі й зливаються з білою карткою —
	   тонка рамка повертає їм межу. */
	border: 1px solid #f0f0f1;
	border-radius: 3px;
}

/* Спани в розмітці інлайнові — робимо з них колонку, інакше все злипається. */
.ff-search .ff-item__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.ff-search .ff-item__title {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
	color: #282828;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ff-search .ff-item__sku {
	display: block;
	font-size: 10px;
	letter-spacing: .04em;
	color: #a3a3a3;
}

/* --- ціна --- */

.ff-search .ff-item__price {
	display: block;
	font-size: 13px;
	line-height: 1.3;
	color: #282828;
}

.ff-search .ff-item__price del,
.ff-search .ff-item__price del .amount {
	margin-right: 6px;
	font-size: 12px;
	font-weight: 400;
	color: #a3a3a3;
	text-decoration: line-through;
}

.ff-search .ff-item__price ins,
.ff-search .ff-item__price ins .amount {
	font-weight: 700;
	color: #cd2122;
	text-decoration: none;
	background: none;
}

/* Прихований дубль ціни для скрінрідерів не має ламати рядок. */
.ff-search .ff-item__price .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* --- наявність --- */

.ff-search .ff-item__stock {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	color: #767676;
}

.ff-search .ff-item__stock-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.ff-search .ff-item__stock--in    { color: #2e7d32; }
.ff-search .ff-item__stock--back  { color: #ee9e00; }
.ff-search .ff-item__stock--out   { color: #b0b0b0; }

/* ------------------------------------------------------------------ *
 * Порожня видача
 * ------------------------------------------------------------------ */

.ff-search .ff-empty {
	padding: 18px 14px;
	font-size: 13.5px;
	text-align: center;
	color: #767676;
}

/* ------------------------------------------------------------------ *
 * Смуга прокрутки — тонка, щоб не сперечалась із карткою
 * ------------------------------------------------------------------ */

.ff-search .ff-search__results::-webkit-scrollbar {
	width: 6px;
}

.ff-search .ff-search__results::-webkit-scrollbar-thumb {
	background: #dcdcde;
	border-radius: 999px;
}

.ff-search .ff-search__results::-webkit-scrollbar-track {
	background: transparent;
}

/* ------------------------------------------------------------------ *
 * Мобільні
 * ------------------------------------------------------------------ */

@media (max-width: 767px) {
	.ff-search .ff-search__results {
		max-height: 320px;
	}

	.ff-search .ff-item__img {
		width: 44px;
		height: 44px;
	}

	.ff-search .ff-item__title {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ff-search .ff-search__results {
		animation: none;
	}
}

/* ================================================================== *
 * Пошук у шапці: кнопка + оверлей (ПК) і закріплений рядок (мобайл)
 * ================================================================== */

/* --- кнопка-лупа в шапці --- */

.tff-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	/* Тема додає сусіду ще 10px зліва, а сама кнопка має 9px поля навколо
	   іконки — з великим margin просвіт біля лупи виглядав удвічі ширшим. */
	margin-right: 2px;
	padding: 0;
	color: #000;
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease;
}

.tff-trigger:hover,
.tff-trigger:focus-visible {
	color: #cd2122;
	background: rgba(205, 33, 34, .07);
}

/* На телефоні місця в шапці менше — стискаємо кнопку. */
@media (max-width: 767px) {
	.tff-trigger {
		width: 32px;
		height: 32px;
	}

	.tff-trigger svg {
		width: 18px;
		height: 18px;
	}
}

/* --- оверлей --- */

.tff-overlay {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 20px 20px;
	font-family: "Montserrat", Helvetica, Arial, sans-serif;
}

.tff-overlay[hidden] {
	display: none;
}

.tff-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	animation: tff-fade .2s ease;
}

@keyframes tff-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.tff-overlay__panel {
	position: relative;
	width: 100%;
	max-width: 620px;
	max-height: 76vh;
	overflow-y: auto;
	padding: 26px 26px 22px;
	background: #fff;
	border-radius: 3px;
	box-shadow: 0 26px 60px -22px rgba(0, 0, 0, .5);
	animation: tff-rise .24s cubic-bezier(.2, .9, .3, 1) both;
}

@keyframes tff-rise {
	from { opacity: 0; transform: translateY(-10px); }
	to   { opacity: 1; transform: translateY(0); }
}

.tff-overlay__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 30px;
	height: 30px;
	font-size: 22px;
	line-height: 1;
	color: #a3a3a3;
	background: none;
	border: 0;
	cursor: pointer;
	transition: color .2s ease;
}

.tff-overlay__close:hover {
	color: #282828;
}

/* Поле всередині оверлея — трохи більше за звичайне. */
.tff-overlay__field .ff-search__input {
	height: 50px;
	font-size: 15px;
}

.tff-overlay__hint {
	margin: 10px 0 0;
	font-size: 12.5px;
	color: #a3a3a3;
}

/* --- пропоновані товари --- */

.tff-suggested {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid #e9eaea;
}

.tff-suggested__label {
	display: block;
	margin-bottom: 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #cd2122;
}

.tff-suggested__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tff-suggested__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	text-decoration: none;
	color: #282828;
	border-radius: 3px;
	transition: background-color .16s ease;
}

.tff-suggested__link:hover {
	color: #282828;
	background: #f7f7f8;
}

.tff-suggested__img {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	object-fit: cover;
	background: #f4f4f5;
	border: 1px solid #f0f0f1;
	border-radius: 3px;
}

.tff-suggested__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.tff-suggested__title {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.tff-suggested__price {
	font-size: 12.5px;
	color: #282828;
}

.tff-suggested__price del {
	margin-right: 5px;
	font-size: 11.5px;
	color: #a3a3a3;
}

.tff-suggested__price ins {
	font-weight: 700;
	color: #cd2122;
	text-decoration: none;
	background: none;
}

/* У шапці телефона правій колонці дістається лише 176px, а лупа, мова
   й кошик просять 203 — кошик зривався на другий рядок. Забираємо
   зайве в лого (колонка тримала фіксовану basis 49%) і в відступів теми. */
@media (max-width: 767px) {
	/* Колонка лого тримала basis 49% — забираємо зайве, але не даємо їй
	   стискатись. .logo-container лишився 69px від старого лого, а картинка
	   з max-width:none вилазила за нього — права колонка заходила під лого. */
	.site-header .site-header-main > .fxb-start-x {
		flex: 0 0 auto;
	}

	.site-header .logo-container {
		width: auto;
	}

	.site-header .site-logo-img {
		height: 42px !important;
	}

	/* Відступи вирівняні по «чорнилу», а не по боксах: у кнопки 7px
	   власного поля навколо іконки, тому її margin менший за сусідів. */
	.site-header .site-header-main-right-top .tff-trigger {
		margin-right: 10px;
	}

	/* zn_dynamic.css (налаштування білдера) розсовує компоненти шапки
	   на 30px через !important — інакше кошик іде на другий рядок. */
	.site-header .site-header-main-right-top .topnav--lang {
		margin-right: 15px !important;
	}
}

@media (max-width: 767px) {
	/* Оверлей на телефоні — на весь екран, без зайвих полів. */
	.tff-overlay {
		padding: 0;
	}

	.tff-overlay__panel {
		max-width: none;
		max-height: 100%;
		height: 100%;
		border-radius: 0;
		/* Панель на весь екран — фону, щоб закрити тапом, немає.
		   Тримаємо хрестик над полем, а не поверх нього. */
		padding: 56px 16px 20px;
	}

	.tff-overlay__close {
		top: 12px;
		right: 10px;
		width: 36px;
		height: 36px;
		font-size: 26px;
	}

	.tff-suggested__list {
		grid-template-columns: 1fr;
	}
}

body.tff-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.tff-overlay__backdrop,
	.tff-overlay__panel {
		animation: none;
	}
}
