/* =========================================================
 * Konfigurátor dle značky automobilu
 * =========================================================
 * Markup: šablona `configurator.php`. Hero a drobečková navigace v jazyce
 * nového webu, dlaždice `.shellers-brands-wrap` převzaté ze starého
 * konfigurátoru, aby zákazníkům zůstalo, co znají.
 *
 * Výpis produktů na konci větve jede standardním WooCommerce loopem, takže
 * karty se stylují stejně jako v archivu — tady se o ně nestaráme.
 * ========================================================= */

.shellers-configurator__container {
	width: 100%;
	max-width: var(--wp--style--global--content-size, 1280px);
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

.shellers-configurator__hero {
	background: #f9f9f98c;
	border-bottom: 1px solid var(--wp--preset--color--border, #f6f7f8);
	margin-bottom: 2rem;
}

.shellers-configurator__hero .shellers-configurator__container {
	padding-top: 2rem;
	padding-bottom: 2rem;
}

/* --- Hero s fotkou vozu ---
 * Drží celou větev konfigurátoru, od rozcestníku značek po motorizaci, aby
 * stránky vypadaly stejně. Obrázek má vůz u pravého okraje a vlevo volnou
 * plochu na text, je proto zarovnaný doprava a text zůstává v levé polovině.
 * Na úzkých displejích se skrývá — tam by zbyl jen výřez kola za textem. */

/* Fotka je zarovnaná doprava a její levá hrana tvoří ostrý svislý zlom.
   Překrývá ji proto gradient z barvy pozadí do průhledna — vlevo drží plnou
   barvu pod textem, vpravo odkrývá vůz. */
.shellers-configurator__hero--photo {
	background-color: #f4f5f6;
	/* Prvni deklarace je zaloha pro prohlizece bez `image-set()`. */
	background-image:
		linear-gradient(
			to right,
			#f4f5f6 0%,
			#f4f5f6 38%,
			rgba(244, 245, 246, 0.85) 52%,
			rgba(244, 245, 246, 0) 72%
		),
		url(../images/konfigurator-hero.png);
	background-image:
		linear-gradient(
			to right,
			#f4f5f6 0%,
			#f4f5f6 38%,
			rgba(244, 245, 246, 0.85) 52%,
			rgba(244, 245, 246, 0) 72%
		),
		image-set(
			url(../images/konfigurator-hero.webp) type("image/webp"),
			url(../images/konfigurator-hero.png) type("image/png")
		);
	background-repeat: no-repeat, no-repeat;
	background-position: left center, right center;
	background-size: 100% 100%, auto 100%;
	border-bottom: none;
}

.shellers-configurator__hero--photo .shellers-configurator__container {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding-top: 2.5rem;
	/* Spodni odsazeni nese kartu, ktera do hero zespodu zajizdi. */
	padding-bottom: 5rem;
}

.shellers-configurator__hero--photo .shellers-configurator__title,
.shellers-configurator__hero--photo .shellers-configurator__lead {
	max-width: 32rem;
}

/* --- Pruh duvery pod nadpisem --- */

.shellers-configurator__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem 2.5rem;
	margin: 1.75rem 0 0;
	padding: 0;
	list-style: none;
}

.shellers-configurator__badge {
	display: flex;
	align-items: center;
	gap: 0.625rem;
}

.shellers-configurator__badge-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	flex: 0 0 auto;
	border-radius: 50%;
	background: rgba(8, 91, 213, 0.08);
	color: var(--wp--preset--color--primary, #085bd5);
}

.shellers-configurator__badge-icon svg {
	width: 1.25rem;
	height: 1.25rem;
}

.shellers-configurator__badge-text {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.shellers-configurator__badge-text strong {
	font-size: 0.9375rem;
	font-weight: 600;
}

.shellers-configurator__badge-text small {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

/* --- Karta s prepinacem a hledanim ---
 * Zaporny horni margin ji vtahne do hero, jak je to v navrhu. */

.shellers-configurator__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 2rem;
	margin: -3rem 0 1.5rem;
	padding: 1rem 1.25rem;
	background: var(--wp--preset--color--background, #ffffff);
	border: 1px solid var(--wp--preset--color--border, #f6f7f8);
	border-radius: 0.875rem;
	box-shadow: 0 0.75rem 2rem rgba(18, 18, 18, 0.08);
}

.shellers-configurator__modes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.shellers-configurator__mode {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.625rem 1.25rem;
	border: 0;
	border-radius: 0.5rem;
	background: var(--wp--preset--color--background-alt, #f4f5f6);
	color: var(--wp--preset--color--foreground, #121212);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.shellers-configurator__mode.is-active {
	background: var(--wp--preset--color--primary, #085bd5);
	color: #ffffff;
}

.shellers-configurator__search {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 1 1 22rem;
	min-width: 0;
}

.shellers-configurator__search-icon {
	position: absolute;
	left: 0.875rem;
	display: inline-flex;
	color: var(--wp--preset--color--foreground-muted, #555555);
	pointer-events: none;
}

.shellers-configurator__search-icon svg {
	width: 1.125rem;
	height: 1.125rem;
}

.shellers-configurator__search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	height: 2.75rem;
	padding: 0 0.875rem 0 2.75rem;
	border: 1px solid var(--wp--preset--color--border, #e3e5e8);
	border-radius: 0.5rem;
	background: var(--wp--preset--color--background, #ffffff);
	font-family: inherit;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--foreground, #121212);
}

.shellers-configurator__search input[type="search"]:focus {
	outline: 2px solid var(--wp--preset--color--primary, #085bd5);
	outline-offset: -1px;
}

.shellers-configurator__search-submit {
	flex: 0 0 auto;
	height: 2.75rem;
	padding: 0 1.5rem;
	border: 0;
	border-radius: 0.5rem;
	background: var(--wp--preset--color--primary, #085bd5);
	color: #ffffff;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}

/* --- Naseptavac --- */

.shellers-configurator__suggestions {
	position: absolute;
	top: calc(100% + 0.375rem);
	left: 0;
	right: 0;
	z-index: 20;
	max-height: 20rem;
	overflow-y: auto;
	margin: 0;
	padding: 0.25rem;
	list-style: none;
	background: var(--wp--preset--color--background, #ffffff);
	border: 1px solid var(--wp--preset--color--border, #e3e5e8);
	border-radius: 0.5rem;
	box-shadow: 0 0.75rem 2rem rgba(18, 18, 18, 0.12);
}

.shellers-configurator__suggestion a {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding: 0.5rem 0.75rem;
	border-radius: 0.375rem;
	color: var(--wp--preset--color--foreground, #121212);
	text-decoration: none;
}

.shellers-configurator__suggestion.is-active a,
.shellers-configurator__suggestion a:hover,
.shellers-configurator__suggestion a:focus-visible {
	background: var(--wp--preset--color--background-alt, #f4f5f6);
}

.shellers-configurator__suggestion strong {
	font-size: 0.9375rem;
	font-weight: 600;
}

.shellers-configurator__suggestion small {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

.shellers-configurator__suggestion.is-empty {
	padding: 0.625rem 0.75rem;
	font-size: 0.875rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

/* --- Popup s vyberem vozidla ---
 * Formular uvnitr je blok `affinite/car-selector`, takze jeho vlastni styly
 * prichazeji z pluginu. Tady se resi jen okno kolem nej. */

.shellers-configurator__dialog {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
}

.shellers-configurator__dialog[hidden] {
	display: none;
}

.shellers-configurator__dialog-overlay {
	position: absolute;
	inset: 0;
	background: rgba(18, 18, 18, 0.55);
}

.shellers-configurator__dialog-panel {
	position: relative;
	width: 100%;
	max-width: 34rem;
	max-height: calc(100vh - 2.5rem);
	overflow-y: auto;
	padding: 2rem;
	background: var(--wp--preset--color--background, #ffffff);
	border-radius: 0.875rem;
	box-shadow: 0 1.5rem 3rem rgba(18, 18, 18, 0.25);
}

.shellers-configurator__dialog-title {
	margin: 0 0 1.25rem;
	padding-right: 2rem;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
}

.shellers-configurator__dialog-close {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--background-alt, #f4f5f6);
	color: var(--wp--preset--color--foreground, #121212);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.shellers-configurator__dialog-close:hover {
	background: var(--wp--preset--color--border, #e3e5e8);
}

/* Formular v popupu jde na sirku okna, at je vyber na jeden sloupec. */
.shellers-configurator__dialog .affinite-car-selector__fields {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.shellers-configurator__dialog .affinite-car-selector__field--submit {
	margin-top: 0.25rem;
}

.shellers-configurator__dialog .affinite-car-selector__submit {
	width: 100%;
	justify-content: center;
}

/*
 * Popisek pole, ktere je na rade nebo uz je vyplnene, je tucny; cekajici
 * urovne zustavaji sede, stejne jako jejich vypnute selecty.
 */
.shellers-configurator__dialog .affinite-car-selector__field:has(select:not([disabled])) .affinite-car-selector__label {
	font-weight: 700;
	color: var(--wp--preset--color--foreground, #121212);
}

body.shellers-configurator-dialog-open {
	overflow: hidden;
}

/* --- Kroky vyberu --- */

.shellers-configurator__steps {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

.shellers-configurator__step {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0.875rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

/* Spojnice k dalsimu kroku. Roste, takze kroky drzi rozestup samy a posledni
 * uz za sebou caru nema. */
.shellers-configurator__step:not(:last-child)::after {
	content: "";
	flex: 1 1 1.5rem;
	height: 1px;
	margin-left: 0.25rem;
	background: var(--shellers-box-border, #f3f5f7);
}

.shellers-configurator__step:last-child {
	flex: 0 0 auto;
}

/* Kolecko je bile se sedym rameckem; barvu dostane jen krok, na kterem
 * zakaznik prave stoji. Ramecek je zamerne tmavsi nez `--shellers-box-border`
 * — ten je stavenej na plochy boxu a na bilem kolecku by zmizel. */
.shellers-configurator__step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--shellers-box-inner-bg, #ffffff);
	border: 1px solid #dfe3e9;
	color: var(--wp--preset--color--foreground-muted, #555555);
	font-size: 0.875rem;
	font-weight: 600;
}

.shellers-configurator__step-label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.shellers-configurator__step.is-active {
	color: var(--wp--preset--color--foreground, #121212);
	font-weight: 700;
}

.shellers-configurator__step.is-active .shellers-configurator__step-number {
	background: var(--wp--preset--color--primary, #085bd5);
	border-color: var(--wp--preset--color--primary, #085bd5);
	color: #ffffff;
}


/* --- Hláška o počtu nalezených dílů --- */

.shellers-configurator__result {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	background: rgba(8, 91, 213, 0.05);
	border: 1px solid rgba(8, 91, 213, 0.12);
	border-radius: 0.75rem;
}

.shellers-configurator__result-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--wp--preset--color--primary, #085bd5);
	color: #ffffff;
}

.shellers-configurator__result-icon svg {
	width: 1.75rem;
	height: 1.75rem;
	/* Fajfka na plne barve potrebuje silnejsi tah, jinak se v kolecku ztrati. */
	stroke-width: 2.5;
}

/* Ikona je kolecko s fajfkou; uvnitr modreho kolecka by se obrys kryl s
 * pozadim, proto se kresli jen fajfka. */
.shellers-configurator__result-icon svg circle {
	display: none;
}

.shellers-configurator__result-text {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	min-width: 0;
	padding-left: 0.875rem;
	border-left: 1px solid rgba(8, 91, 213, 0.18);
}

.shellers-configurator__result-text strong {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--wp--preset--color--foreground, #121212);
}

.shellers-configurator__result-count {
	font-size: 1.25rem;
	color: var(--wp--preset--color--primary, #085bd5);
}

.shellers-configurator__result-text small {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

/* --- Vysledky hledani bez JavaScriptu --- */

.shellers-configurator__results {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 0.75rem;
	margin: 0 0 3rem;
	padding: 0;
	list-style: none;
}

.shellers-configurator__results a {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding: 0.875rem 1rem;
	background: var(--wp--preset--color--background, #ffffff);
	border: 1px solid var(--wp--preset--color--border, #f6f7f8);
	border-radius: 0.5rem;
	color: var(--wp--preset--color--foreground, #121212);
	text-decoration: none;
}

.shellers-configurator__results a:hover {
	border-color: var(--wp--preset--color--primary, #085bd5);
}

.shellers-configurator__results small {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

@media (max-width: 781px) {
	.shellers-configurator__hero--photo {
		background-image: none;
	}

	.shellers-configurator__hero--photo .shellers-configurator__container {
		min-height: 0;
		padding-top: 2rem;
		padding-bottom: 2rem;
	}

	.shellers-configurator__panel {
		margin-top: 1.25rem;
	}

	.shellers-configurator__modes,
	.shellers-configurator__mode,
	.shellers-configurator__search {
		flex: 1 1 100%;
	}

	.shellers-configurator__mode {
		justify-content: center;
	}

	.shellers-configurator__steps {
		flex-wrap: wrap;
		gap: 0.5rem 1rem;
	}

	.shellers-configurator__step {
		flex: 1 1 100%;
	}

	.shellers-configurator__step:not(:last-child)::after {
		display: none;
	}

	.shellers-configurator__result {
		align-items: flex-start;
	}
}

.shellers-configurator__breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.8125rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
	margin-bottom: 0.75rem;
}

.shellers-configurator__breadcrumb a {
	color: var(--wp--preset--color--primary, #085bd5);
	text-decoration: none;
}

.shellers-configurator__breadcrumb a:hover,
.shellers-configurator__breadcrumb a:focus-visible {
	text-decoration: underline;
}

/* Oddelovac byl v barve ramecku, tedy skoro bily — proto se ztracel. */
.shellers-configurator__breadcrumb-sep {
	color: var(--wp--preset--color--foreground-muted, #555555);
}

.shellers-configurator__title {
	margin: 0;
	font-size: 2.3rem;
	line-height: 1.2;
	font-weight: 700;
	text-transform: none;
	color: var(--wp--preset--color--foreground, #121212);
}

.shellers-configurator__lead {
	max-width: 46rem;
	margin: 0.75rem 0 0;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

.shellers-configurator__count {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

.shellers-configurator__empty {
	padding: 2rem 0 3rem;
	color: var(--wp--preset--color--foreground-muted, #555555);
}

/* --- Dlaždice větví --- */

.shellers-brands-wrap {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 3rem;
}

.shellers-brands-wrap-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 0.75rem;
	padding: 1.25rem 1rem;
	background: var(--wp--preset--color--background, #ffffff);
	border: 1px solid var(--wp--preset--color--border, #f6f7f8);
	border-radius: 0.75rem;
	color: var(--wp--preset--color--foreground, #121212);
	text-decoration: none;
	text-align: center;
	transition: box-shadow 150ms ease, border-color 150ms ease;
}

.shellers-brands-wrap-item:hover,
.shellers-brands-wrap-item:focus-visible {
	border-color: var(--wp--preset--color--primary, #085bd5);
	box-shadow: 0 0.375rem 1rem rgba(18, 18, 18, 0.08);
	color: var(--wp--preset--color--foreground, #121212);
}

.shellers-brands-wrap-item img {
	display: block;
	width: 100%;
	max-width: 7rem;
	object-fit: contain;
}

.shellers-brands-wrap-item p {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
}

/* --- Výpis produktů na konci větve ---
 * Karty jsou tytéž jako ve výpisu kategorie (`shellers-archive__grid` přidává
 * Affinite_Shellers_LoopCustomizations), mění se jen počet sloupců: tady není
 * filtr po straně, takže je na řádek místo na čtyři. */

.shellers-configurator__products .shellers-archive__grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1199.98px) {
	.shellers-configurator__products .shellers-archive__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 1023.98px) {
	.shellers-configurator__products .shellers-archive__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599.98px) {
	.shellers-configurator__products .shellers-archive__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* --- Stránkování výpisu produktů --- */

.shellers-configurator__pagination {
	display: flex;
	justify-content: center;
	padding-bottom: 3rem;
}

.shellers-configurator__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.5rem;
	margin: 0 0.1875rem;
	border: 1px solid var(--wp--preset--color--border, #f6f7f8);
	border-radius: 0.375rem;
	color: var(--wp--preset--color--foreground, #121212);
	text-decoration: none;
}

.shellers-configurator__pagination .page-numbers.current {
	background: var(--wp--preset--color--primary, #085bd5);
	border-color: var(--wp--preset--color--primary, #085bd5);
	color: #ffffff;
}

@media (max-width: 1365.98px) {
	.shellers-brands-wrap {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media (max-width: 1199.98px) {
	.shellers-brands-wrap {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 991.98px) {
	.shellers-brands-wrap {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 599.98px) {
	.shellers-brands-wrap {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.shellers-configurator__title {
		font-size: 1.5rem;
	}
}
