/**
 * GRAND BAR: поиск по каталогу
 * - средняя колонка шапки: мессенджеры + часы работы, под ними строка поиска (компьютер, от 992px)
 * - строка поиска под шапкой на телефоне и планшете (до 991px)
 * - выпадающий список: разделы + товары + «Показать все»
 * - страница результатов /catalog/search/
 * Подключается в header.php после ShowHead(), поэтому идёт после стилей шаблона.
 */

/* =========================================================
   Шапка: раскладка колонок
   ========================================================= */
.gb-header-mid {
	display: none;
}

@media (min-width: 992px) {
	.gb-header .gb-header-left {
		flex: 0 0 auto;
	}

	.gb-header .gb-header-mid {
		display: flex;
		flex-direction: column;
		gap: 10px;
		flex: 0 1 300px;
		width: 300px;
		min-width: 250px;
		margin: -4px 20px 0 16px;
	}

	/* контакты не сжимаем (иначе текст уезжает влево под поиск) — сжимается колонка поиска */
	.gb-header .gb-header-center {
		flex: 0 0 auto;
		margin-left: auto;
	}
}

/* верхняя строка: WhatsApp, Telegram, часы работы, «Заявки 24/7» */
.gb-header-mid-top {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.gb-header .gb-header-mid .gb-header-socials {
	display: flex;
	gap: 8px;
	margin: 0;
}

.gb-header .gb-header-mid .gb-header-social-link {
	width: 30px;
	height: 30px;
}

.gb-header .gb-header-hours {
	gap: 8px;
	min-width: 0;
}

.gb-header .gb-header-hours .gb-header-info-icon.gb-icon-clock {
	width: 30px;
	height: 30px;
	background-size: 15px 15px;
}

.gb-header-hours-text {
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.gb-header .gb-header-hours .gb-header-info-text {
	font-size: 13px;
	font-weight: 700;
}

/* плашку «Заявки 24/7» в шапке не показываем: при ширине контейнера сайта (1140px)
   она не помещается рядом с телефонами. Текст остаётся во всплывающей подсказке у часов. */
.gb-header .gb-header-hours .gb-header-info-note {
	display: none;
}

/* логотип чуть меньше на экранах 1200–1399, чтобы шапка помещалась в строку */
@media (min-width: 1200px) and (max-width: 1399.98px) {
	.gb-header .gb-logo .gb-logo-img {
		height: 76px !important;
	}
}

/* на 992–1199 адрес под телефонами прячем — не помещается рядом с поиском */
@media (min-width: 992px) and (max-width: 1199.98px) {
	.gb-header .gb-header-center .gb-header-contact-row:last-child {
		display: none;
	}
}

/* =========================================================
   Строка поиска (общая для шапки и телефона)
   ========================================================= */
.gbs {
	position: relative;
	display: flex;
	align-items: center;
	height: 44px;
	margin: 0;
	padding: 0 5px 0 14px;
	border: 1.5px solid #F9A91D;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(249, 169, 29, 0.16);
	font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.gbs:focus-within {
	box-shadow: 0 0 0 4px rgba(249, 169, 29, 0.18), 0 8px 22px rgba(249, 169, 29, 0.20);
}

.gbs-ico {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-right: 10px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c27c00' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* пока идёт запрос — вместо лупы крутится кольцо */
.gbs.is-loading .gbs-ico {
	border: 2px solid rgba(249, 169, 29, 0.3);
	border-top-color: #F9A91D;
	border-radius: 50%;
	background: none;
	animation: gbsSpin 0.7s linear infinite;
}

@keyframes gbsSpin {
	to { transform: rotate(360deg); }
}

.gbs-in {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	font-size: 15px;
	font-weight: 500;
	color: #1d1d1b;
	-webkit-appearance: none;
	appearance: none;
}

.gbs-in::placeholder {
	color: #9ca3af;
	font-weight: 400;
}

.gbs-in::-webkit-search-cancel-button,
.gbs-in::-webkit-search-decoration {
	-webkit-appearance: none;
	display: none;
}

.gbs-btn {
	flex: 0 0 auto;
	height: 32px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: #F9A91D;
	color: #1d1d1b;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.gbs-btn:hover {
	background: #ffb83a;
}

.gbs-btn:focus {
	outline: none;
}

/* =========================================================
   Выпадающий список
   ========================================================= */
.gbs-drop {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 1050;
	width: max(100%, 520px);
	max-height: min(70vh, 560px);
	overflow-y: auto;
	padding: 8px;
	border: 1px solid #f0e8d8;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(29, 29, 27, 0.14);
	text-align: left;
}

.gbs-drop[hidden] {
	display: none;
}

.gbs-cap {
	padding: 8px 10px 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #9ca3af;
}

.gbs-sec,
.gbs-it {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 7px 10px;
	border-radius: 12px;
	color: #1d1d1b !important;
	text-decoration: none !important;
	transition: background-color 0.15s ease;
}

.gbs-sec {
	background: #fffaf0;
}

.gbs-sec + .gbs-sec {
	margin-top: 4px;
}

.gbs-sec.is-active,
.gbs-sec:hover {
	background: #fff1d6;
}

.gbs-it.is-active,
.gbs-it:hover {
	background: #f6f6f7;
}

.gbs-sec__img {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #f3f4f6 center / cover no-repeat;
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px #f1e3c4;
}

.gbs-sec__text {
	flex: 1 1 auto;
	min-width: 0;
}

.gbs-sec__name {
	display: block;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
}

.gbs-sec__cnt {
	display: block;
	font-size: 12px;
	color: #8a6a2e;
}

.gbs-sec__arr {
	flex: 0 0 auto;
	color: #c27c00;
	font-weight: 700;
}

.gbs-it__img {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: #f6f6f7 center / contain no-repeat;
}

.gbs-it__name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.gbs-it__price {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.gbs-drop mark {
	padding: 0 2px;
	border-radius: 3px;
	background: #FDE3AE;
	color: inherit;
}

.gbs-all {
	display: block;
	margin-top: 6px;
	padding: 11px 12px;
	border-radius: 12px;
	background: #F9A91D;
	color: #1d1d1b !important;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	text-decoration: none !important;
	transition: background-color 0.15s ease;
}

.gbs-all.is-active,
.gbs-all:hover {
	background: #ffb83a;
}

.gbs-empty {
	padding: 14px 12px;
	font-size: 14px;
	line-height: 1.45;
	color: #6b7280;
}

.gbs-empty b {
	color: #1d1d1b;
}

/* =========================================================
   Телефон и планшет: строка поиска под шапкой
   ========================================================= */
.gb-msearch {
	display: none;
}

@media (max-width: 991.98px) {
	.gb-msearch {
		display: block;
		margin-top: 10px;
	}

	.gb-msearch .gbs {
		height: 44px;
		box-shadow: 0 4px 14px rgba(249, 169, 29, 0.14);
	}

	.gb-msearch .gbs-drop {
		width: 100%;
		max-height: 65vh;
	}
}

@media (max-width: 575.98px) {
	.gbs-btn {
		padding: 0 12px;
		font-size: 11px;
	}

	.gbs-in {
		font-size: 16px; /* меньше 16px — iPhone увеличивает страницу при фокусе */
	}

	.gbs-it__img {
		width: 40px;
		height: 40px;
	}

	.gbs-it__name,
	.gbs-it__price {
		font-size: 13px;
	}
}

/* =========================================================
   Страница результатов /catalog/search/
   ========================================================= */
.gb-search-hero__icon {
	background: #F9A91D url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1d1b' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / 42% no-repeat !important;
	font-size: 0 !important;
}

.gb-search-secs {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 16px;
	padding: 12px 16px;
	border: 1px solid #eceef1;
	border-radius: 18px;
	background: #fff;
}

.gb-search-secs__label {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a8f98;
}

.gb-search-secs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
}

.gb-search-sec {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 8px 0 6px;
	border: 1px solid #e3e5e9;
	border-radius: 999px;
	background: #fff;
	color: #1d1d1b !important;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gb-search-sec:hover {
	border-color: #F9A91D;
	box-shadow: 0 4px 12px rgba(249, 169, 29, 0.18);
}

.gb-search-sec__img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #f3f4f6 center / cover no-repeat;
}

.gb-search-sec__cnt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 8px;
	border-radius: 999px;
	background: #f3f4f6;
	color: #6b7280;
	font-size: 12px;
	font-weight: 700;
}

.gb-search-empty {
	margin: 0 0 24px;
	padding: 36px 24px;
	border: 1px solid #f3e4c2;
	border-radius: 20px;
	background: linear-gradient(160deg, #fffaf0 0%, #ffffff 70%);
	text-align: center;
}

.gb-search-empty__title {
	margin-bottom: 8px;
	font-size: 20px;
	font-weight: 800;
	color: #1d1d1b;
}

.gb-search-empty__text {
	max-width: 560px;
	margin: 0 auto 18px;
	font-size: 15px;
	line-height: 1.5;
	color: #6b7280;
}

.gb-search-empty__btn {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 22px;
	border-radius: 999px;
	background: #F9A91D;
	color: #1d1d1b !important;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none !important;
}

@media (max-width: 767.98px) {
	.gb-search-secs {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 12px 0 12px 14px;
	}

	.gb-search-secs__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		padding-right: 14px;
	}

	.gb-search-secs__list::-webkit-scrollbar {
		display: none;
	}
}
