/*
 * XTRONIC — wyszukiwarka numeru części dostępna z każdej podstrony.
 *
 * Arkusz jest samodzielny: wchodzi na wszystkich stronach, także tam, gdzie nie
 * ładuje się arkusz katalogu ani motyw XTRONIC. Reguły dotykające odnośników mają
 * wariant z prefiksem #xt, bo motyw ustawia `#xt a{color:var(--accent)}`.
 */

.xtc-search-modal {
	--xtc-s-bg: #14171D;
	--xtc-s-line: rgba(255, 255, 255, .1);
	--xtc-s-dim: #9AA1AC;
	--xtc-s-soft: #6C727C;
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(16px, 8vh, 96px) 16px 16px;
	font-family: 'Poppins', system-ui, sans-serif;
}

.xtc-search-modal[hidden] {
	display: none;
}

/* strona pod oknem nie przewija się razem z nim */
html.xtc-search-open,
html.xtc-search-open body {
	overflow: hidden;
}

.xtc-search-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 7, 9, .72);
	backdrop-filter: blur(3px);
}

.xtc-search-panel {
	position: relative;
	width: 100%;
	max-width: 640px;
	background: var(--xtc-s-bg);
	border: 1px solid var(--xtc-s-line);
	border-radius: 16px;
	padding: clamp(20px, 3vw, 28px);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
	animation: xtcSearchIn .18s ease-out;
}

@keyframes xtcSearchIn {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
}

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

.xtc-search-title {
	margin: 0 40px 16px 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--accent, #FF2E2E);
}

.xtc-search-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	border: 1px solid var(--xtc-s-line);
	border-radius: 8px;
	background: transparent;
	color: #E4E6EA;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: border-color .2s, color .2s;
}

.xtc-search-close:hover {
	border-color: var(--accent, #FF2E2E);
	color: #fff;
}

.xtc-search-form {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #0F1116;
	border: 1px solid var(--xtc-s-line);
	border-radius: 12px;
	padding: 6px 6px 6px 16px;
	transition: border-color .2s, box-shadow .2s;
}

.xtc-search-form:focus-within {
	border-color: var(--accent, #FF2E2E);
	box-shadow: 0 8px 28px var(--glow-soft, rgba(255, 46, 46, .18));
}

.xtc-search-icon {
	flex: 0 0 auto;
	display: flex;
	color: var(--xtc-s-soft);
}

#xt .xtc-search-form input[type="search"],
.xtc-search-form input[type="search"] {
	flex: 1;
	min-width: 0;
	width: auto;
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 13px 0;
	color: #F2F3F5;
	font-family: inherit;
	font-size: 16px;
	outline: none;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

#xt .xtc-search-form input[type="search"]:focus,
.xtc-search-form input[type="search"]:focus {
	border: 0;
	box-shadow: none;
}

#xt .xtc-search-submit,
.xtc-search-submit {
	flex: 0 0 auto;
	background: var(--accent, #FF2E2E);
	color: #fff;
	border: 0;
	border-radius: 9px;
	padding: 12px 22px;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	cursor: pointer;
	transition: filter .2s;
}

#xt .xtc-search-submit:hover,
.xtc-search-submit:hover {
	filter: brightness(1.12);
	color: #fff;
}

/* ---------- wyniki ---------- */
.xtc-search-results {
	margin-top: 14px;
	max-height: min(52vh, 460px);
	overflow-y: auto;
	border: 1px solid var(--xtc-s-line);
	border-radius: 12px;
}

.xtc-search-results:empty {
	display: none;
}

.xtc-search-results p {
	margin: 0;
	padding: 16px 18px;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--xtc-s-dim);
}

#xt .xtc-search-results a,
.xtc-search-results a {
	display: block;
	padding: 13px 18px;
	border-bottom: 1px solid var(--xtc-s-line);
	color: #E4E6EA;
	font-size: 14px;
	text-decoration: none;
	transition: background .2s, color .2s;
}

.xtc-search-results a:last-child {
	border-bottom: 0;
}

#xt .xtc-search-results a:hover,
.xtc-search-results a:hover {
	background: rgba(255, 255, 255, .05);
	color: #fff;
}

.xtc-search-results b {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	color: var(--accent, #FF2E2E);
	font-weight: 600;
}

.xtc-search-results small {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	color: var(--xtc-s-soft);
}

.xtc-search-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 0 18px 16px !important;
}

#xt .xtc-search-results a.xtc-search-cta,
.xtc-search-results a.xtc-search-cta {
	display: inline-block;
	padding: 10px 18px;
	border: 1px solid var(--xtc-s-line);
	border-radius: 8px;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

#xt .xtc-search-results a.xtc-search-cta:hover,
.xtc-search-results a.xtc-search-cta:hover {
	border-color: var(--accent, #FF2E2E);
	background: transparent;
}

.xtc-search-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 16px 0 0;
	font-size: 12.5px;
	color: var(--xtc-s-soft);
}

#xt .xtc-search-foot a,
.xtc-search-foot a {
	color: var(--xtc-s-dim);
	text-decoration: none;
	border-bottom: 1px solid var(--xtc-s-line);
}

#xt .xtc-search-foot a:hover,
.xtc-search-foot a:hover {
	color: #fff;
}

.xtc-search-kbd kbd {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11px;
	padding: 3px 7px;
	border: 1px solid var(--xtc-s-line);
	border-radius: 5px;
	color: var(--xtc-s-soft);
}

/* ---------- wejście w nagłówku ---------- */
.xtc-search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	height: 42px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 6px;
	background: rgba(255, 255, 255, .04);
	color: #F2F3F5;
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color .2s, color .2s, background .2s;
}

.xtc-search-trigger:hover {
	border-color: var(--accent, #FF2E2E);
	color: #fff;
}

.xtc-search-trigger svg {
	flex: 0 0 auto;
}

/* w wąskim pasku zostaje sama lupa */
@media (max-width: 1100px) {
	.xtc-search-trigger-label {
		display: none;
	}

	.xtc-search-trigger {
		width: 42px;
		padding: 0;
	}
}

/* wariant w menu mobilnym — pełna szerokość, jak pozostałe pozycje */
.xtc-search-trigger-block {
	width: 100%;
	height: auto;
	padding: 14px;
	border-radius: 6px;
	font-size: 13px;
	letter-spacing: .05em;
}

.xtc-search-trigger-block .xtc-search-trigger-label {
	display: inline;
}

@media (max-width: 480px) {
	.xtc-search-panel {
		padding: 18px 16px 16px;
	}

	.xtc-search-submit {
		padding: 12px 16px;
	}
}
