.fwcn-header-search-wrap {
	--fwcn-search-accent: #2271b1;
	--fwcn-search-accent-hover: #185a91;
	--fwcn-search-border: #d7dce3;
	--fwcn-search-text: #172033;
	--fwcn-search-muted: #687386;
	position: relative;
	z-index: 99999;
	width: 100%;
	max-width: 520px;
	font-size: 14px;
}

.fwcn-header-search { width: 100%; margin: 0; }

.fwcn-header-search-field {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 100%;
	min-height: 46px;
	overflow: hidden;
	border: 1px solid var(--fwcn-search-border);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 3px 14px rgba(23, 32, 51, 0.08);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.fwcn-header-search-field:focus-within {
	border-color: var(--fwcn-search-accent);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.14), 0 6px 22px rgba(23, 32, 51, 0.12);
}

.fwcn-header-search-leading-icon {
	position: absolute;
	top: 50%;
	left: 15px;
	z-index: 2;
	width: 19px;
	height: 19px;
	transform: translateY(-50%);
	color: #7c8798;
	pointer-events: none;
}

.fwcn-header-search-leading-icon svg,
.fwcn-header-search-submit svg,
.fwcn-search-clear svg { display: block; width: 100%; height: 100%; fill: currentColor; }

.fwcn-header-search input[type="search"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: auto;
	min-height: 44px;
	margin: 0;
	padding: 10px 48px 10px 44px;
	border: 0 !important;
	border-radius: 0;
	outline: 0;
	background: transparent;
	color: var(--fwcn-search-text);
	box-shadow: none !important;
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
}

.fwcn-header-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.fwcn-header-search input[type="search"]::placeholder { color: #8993a2; opacity: 1; }

.fwcn-search-clear {
	position: absolute;
	top: 50%;
	right: 116px;
	z-index: 3;
	width: 30px;
	height: 30px;
	padding: 7px;
	transform: translateY(-50%);
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #7b8594;
	cursor: pointer;
}

.fwcn-header-search-no-button .fwcn-search-clear { right: 8px; }
.fwcn-search-clear:hover,
.fwcn-search-clear:focus-visible { outline: 0; background: #eef1f5; color: var(--fwcn-search-text); }

.fwcn-header-search-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-width: 106px;
	margin: 4px;
	padding: 8px 16px;
	border: 0;
	border-radius: 9px;
	background: var(--fwcn-search-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.18s ease, transform 0.18s ease;
}

.fwcn-header-search-submit svg { width: 17px; height: 17px; }
.fwcn-header-search-submit:hover,
.fwcn-header-search-submit:focus-visible { outline: 0; background: var(--fwcn-search-accent-hover); color: #fff; }
.fwcn-header-search-submit:active { transform: scale(0.98); }

.fwcn-live-results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 1000000;
	max-height: min(520px, 70vh);
	overflow-x: hidden;
	overflow-y: auto;
	border: 1px solid #e2e6ec;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 18px 46px rgba(18, 28, 45, 0.20);
	overscroll-behavior: contain;
}

.fwcn-live-results[hidden] { display: none !important; }

.fwcn-live-result-item {
	display: grid;
	grid-template-columns: 58px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	min-height: 78px;
	padding: 10px 13px;
	border-bottom: 1px solid #edf0f4;
	color: var(--fwcn-search-text);
	text-decoration: none !important;
	transition: background 0.15s ease;
}

.fwcn-live-result-item.fwcn-live-result-no-image { grid-template-columns: minmax(0, 1fr) auto; }
.fwcn-live-result-item.fwcn-live-result-no-image.fwcn-live-result-no-price { grid-template-columns: minmax(0, 1fr); }
.fwcn-live-result-item:hover,
.fwcn-live-result-item:focus,
.fwcn-live-result-item.is-active { outline: 0; background: #f5f8fc; color: var(--fwcn-search-text); }

.fwcn-live-result-image {
	width: 58px;
	height: 58px;
	overflow: hidden;
	border: 1px solid #edf0f4;
	border-radius: 9px;
	background: #f7f8fa;
}

.fwcn-live-result-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.fwcn-live-result-content { min-width: 0; }
.fwcn-live-result-title-row { display: flex; align-items: flex-start; gap: 7px; }

.fwcn-live-result-title {
	overflow: hidden;
	color: var(--fwcn-search-text);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fwcn-live-sale-badge {
	flex: 0 0 auto;
	padding: 2px 6px;
	border-radius: 999px;
	background: #fff0e8;
	color: #b94408;
	font-size: 10px;
	font-weight: 800;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fwcn-live-result-meta { display: flex; flex-wrap: wrap; gap: 3px 9px; margin-top: 5px; color: var(--fwcn-search-muted); font-size: 12px; }
.fwcn-live-result-sku { font-weight: 700; }
.fwcn-live-result-price { justify-self: end; color: var(--fwcn-search-text); font-size: 13px; font-weight: 800; white-space: nowrap; }
.fwcn-live-result-price del { color: var(--fwcn-search-muted); font-weight: 500; }
.fwcn-live-result-price ins { text-decoration: none; }

.fwcn-live-view-all {
	display: block;
	padding: 13px 16px;
	background: #f8fafc;
	color: var(--fwcn-search-accent);
	font-weight: 800;
	text-align: center;
	text-decoration: none !important;
}

.fwcn-live-view-all:hover,
.fwcn-live-view-all:focus-visible { outline: 0; background: #eef5fb; color: var(--fwcn-search-accent-hover); }
.fwcn-live-message { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 70px; padding: 16px; color: var(--fwcn-search-muted); text-align: center; }

.fwcn-live-spinner {
	width: 17px;
	height: 17px;
	border: 2px solid #d7e2ed;
	border-top-color: var(--fwcn-search-accent);
	border-radius: 50%;
	animation: fwcn-search-spin 0.7s linear infinite;
}

@keyframes fwcn-search-spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
	.fwcn-header-search-wrap { max-width: none; }
	.fwcn-header-search-field { min-height: 43px; border-radius: 10px; }
	.fwcn-header-search-submit { min-width: 44px; padding: 8px 12px; }
	.fwcn-header-search-submit span { display: none; }
	.fwcn-search-clear { right: 52px; }
	.fwcn-live-results { position: fixed; top: auto; right: 12px; bottom: 12px; left: 12px; max-height: min(68vh, 520px); }
	.fwcn-live-result-item { grid-template-columns: 50px minmax(0, 1fr); min-height: 68px; }
	.fwcn-live-result-image { width: 50px; height: 50px; }
	.fwcn-live-result-price { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.fwcn-header-search-field,
	.fwcn-header-search-submit,
	.fwcn-live-result-item { transition: none; }
}
