/*!
 * KIT Search 1.0.3 – KAMARO IT
 * Kolory przez zmienne – nadpisz w motywie, np. .kas-search { --kas-accent: #e30613; }
 */
.kas-search,
.kas-ac {
	--kas-ink: #171717;
	--kas-accent: #ffd500;
	--kas-bg: #ffffff;
	--kas-muted: #5f5f5f;
	--kas-line: rgba(0, 0, 0, .12);
	--kas-hover: #f4f4f2;
	--kas-danger: #b42318;
	--kas-radius: 12px;
}

.kas-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- formularz shortcode ---------- */

.kas-search {
	display: block;
	width: 100%;
	font-family: inherit;
}

.kas-search *,
.kas-search *::before,
.kas-search *::after {
	box-sizing: border-box;
}

.kas-search__form {
	width: 100%;
	margin: 0;
	padding: 0;
}

.kas-search__wrap {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 58px;
	padding: 5px;
	border: 1px solid var(--kas-line);
	border-radius: var(--kas-radius);
	background: var(--kas-bg);
	color: var(--kas-ink);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .02), 0 4px 14px rgba(0, 0, 0, .035);
	transition: border-color .2s ease, box-shadow .2s ease;
}

/* Fokus z kontrastem >= 3:1 (WCAG 2.4.11 / 1.4.11): ciemna obwódka + akcent. */
.kas-search__wrap:focus-within {
	border-color: var(--kas-ink);
	box-shadow: 0 0 0 3px var(--kas-accent), 0 4px 14px rgba(0, 0, 0, .035);
}

.kas-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	margin: 0;
	padding: 0 15px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: transparent !important;
	color: var(--kas-ink) !important;
	font: inherit;
	font-size: 16px; /* 16px – iOS nie przybliża strony przy fokusie */
	line-height: 1.2;
	outline: 0 !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.kas-search__input::placeholder {
	color: #6b6b6b; /* 5.3:1 na białym */
	opacity: 1;
}

.kas-search__input::-webkit-search-cancel-button {
	display: none;
	-webkit-appearance: none;
}

.kas-search__clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	margin: 0 4px 0 0;
	padding: 0;
	border: 0 !important;
	border-radius: 50%;
	background: transparent !important;
	color: var(--kas-muted) !important;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease;
}

.kas-search__clear[hidden] {
	display: none;
}

.kas-search__clear:hover {
	background: var(--kas-hover) !important;
	color: var(--kas-ink) !important;
}

.kas-search__clear:focus-visible,
.kas-search__btn:focus-visible {
	outline: 3px solid var(--kas-ink);
	outline-offset: 2px;
}

.kas-search__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 0 0 auto;
	height: 48px;
	min-width: 108px;
	margin: 0;
	padding: 0 17px;
	border: 0 !important;
	border-radius: 9px !important;
	background: var(--kas-ink) !important;
	color: #fff !important;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.kas-search__btn:hover {
	background: var(--kas-accent) !important;
	color: var(--kas-ink) !important;
}

.kas-search__btn:active {
	transform: scale(.98);
}

.kas-search__icon {
	display: block;
	flex: 0 0 17px;
	width: 17px;
	height: 17px;
	pointer-events: none;
}

.kas-search__current {
	margin: 9px 2px 0;
	color: var(--kas-muted);
	font-size: 13px;
	line-height: 1.45;
}

.kas-search__current strong {
	color: var(--kas-ink);
}

.lsb-searchbox .kas-search__current,
.lsb-quicksearch .kas-search__current,
.lsb-quick-search .kas-search__current {
	color: rgba(255, 255, 255, .78);
}

.lsb-searchbox .kas-search__current strong,
.lsb-quicksearch .kas-search__current strong,
.lsb-quick-search .kas-search__current strong {
	color: var(--kas-accent);
}

/* ---------- panel podpowiedzi ---------- */

.kas-ac-anchor {
	position: relative;
}

/* Blocksy live results – zastąpione podpowiedziami KIT Search. */
.kas-ac-anchor .ct-search-results {
	display: none !important;
}

.kas-ac {
	position: fixed;
	z-index: 2147483000;
	top: 0;
	left: 0;
	box-sizing: border-box;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 6px;
	border: 1px solid var(--kas-line);
	border-radius: var(--kas-radius);
	background: var(--kas-bg);
	color: var(--kas-ink);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
	font-size: 14px;
	line-height: 1.35;
	text-align: left;
}

.kas-ac[hidden] {
	display: none;
}

.kas-ac.is-loading .kas-ac__list {
	opacity: .6;
}

.kas-ac__note {
	margin: 4px 8px 8px;
	color: var(--kas-muted);
	font-size: 13px;
}

.kas-ac__group + .kas-ac__group {
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px solid var(--kas-line);
}

.kas-ac__head {
	padding: 8px 10px 4px;
	color: var(--kas-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
}

.kas-ac__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px; /* cel dotykowy */
	padding: 6px 10px;
	border-radius: 8px;
	cursor: pointer;
}

.kas-ac__opt:hover,
.kas-ac__opt.is-active {
	background: var(--kas-hover);
}

.kas-ac__opt.is-active {
	box-shadow: inset 3px 0 0 var(--kas-ink);
}

.kas-ac__link {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	color: inherit !important;
	text-decoration: none !important;
}

.kas-ac__img {
	display: block;
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: 6px;
	background: var(--kas-hover);
}

.kas-ac__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.kas-ac__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.kas-ac__title {
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	word-break: break-word;
}

.kas-ac__hl {
	padding: 0;
	background: transparent;
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: var(--kas-accent);
	text-decoration-thickness: 3px;
	text-underline-offset: 2px;
}

.kas-ac__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	color: var(--kas-muted);
	font-size: 12px;
}

.kas-ac__stock {
	color: var(--kas-danger);
	font-weight: 600;
}

.kas-ac__price {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	align-items: flex-end;
	font-weight: 700;
	white-space: nowrap;
}

.kas-ac__regular {
	color: var(--kas-muted);
	font-size: 12px;
	font-weight: 400;
}

.kas-ac__count {
	margin-left: auto;
	color: var(--kas-muted);
	font-size: 12px;
}

.kas-ac__opt--all {
	justify-content: center;
	font-weight: 700;
}

.kas-ac__opt--clear {
	color: var(--kas-muted);
	font-size: 13px;
}

.kas-ac__icon {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	background: currentColor;
	opacity: .55;
	-webkit-mask: var(--kas-icon) center / contain no-repeat;
	mask: var(--kas-icon) center / contain no-repeat;
}

.kas-ac__icon--recent {
	--kas-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.kas-ac__icon--popular {
	--kas-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8'/%3E%3Cpath d='M14 7h7v7'/%3E%3C/svg%3E");
}

/* ---------- komunikaty na liście produktów ---------- */

.kas-banner,
.kas-notice {
	display: flex;
	align-items: center;
	gap: 11px;
	width: 100%;
	margin: 0 0 22px;
	padding: 15px 17px;
	border: 1px solid #e5e5e2;
	border-radius: 11px;
	background: #f7f7f5;
	color: #474747;
	font-size: 14px;
	line-height: 1.45;
}

.kas-banner__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: var(--kas-accent, #ffd500);
	color: #171717;
}

.kas-banner__query {
	color: #171717;
	font-weight: 700;
}

.kas-no-results {
	margin: 0 0 24px;
	padding: 1.5rem 1.25rem;
	border-left: 4px solid #171717;
	border-radius: 0 6px 6px 0;
	background: #f7f7f5;
}

.kas-no-results__text {
	margin: 0 0 .25rem;
	font-size: 1rem;
	font-weight: 700;
}

.kas-no-results__hint,
.kas-no-results__label {
	margin: 0 0 .75rem;
	color: #474747;
	font-size: .9rem;
}

.kas-no-results__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
}

.kas-no-results__chips a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid rgba(0, 0, 0, .18);
	border-radius: 999px;
	background: #fff;
	color: #171717;
	text-decoration: none;
}

.kas-no-results__chips a:hover,
.kas-no-results__chips a:focus-visible {
	border-color: #171717;
}

@media (max-width: 600px) {
	.kas-search__wrap {
		min-height: 56px;
		padding: 4px;
	}

	.kas-search__input {
		height: 46px;
		padding-left: 13px !important;
	}

	.kas-search__btn {
		width: 46px;
		min-width: 46px;
		height: 46px;
		padding: 0;
	}

	.kas-search__btn-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.kas-ac {
		max-height: 65vh;
	}

	.kas-ac__img {
		flex-basis: 40px;
		width: 40px;
		height: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kas-search__wrap,
	.kas-search__btn,
	.kas-search__clear {
		transition: none;
	}

	.kas-search__btn:active {
		transform: none;
	}
}

@media (forced-colors: active) {
	.kas-ac__opt.is-active {
		outline: 2px solid Highlight;
	}

	.kas-ac__hl {
		text-decoration-color: Highlight;
	}
}
