/*
 * Rekisterikilven valot - ajoneuvohaku
 *
 * Tyylit on rajattu .rkv-juureen, jotta ne eivat vuoda teemaan. Asettelu on
 * yksisarakkeinen: haku, rajausrivi, tulokset. Nain tuloksilla on aina koko
 * leveys kaytossaan eika mikaan voi tyontaa niita kapeaan sarakkeeseen.
 */

.rkv {
	--rkv-ink: #14161a;
	--rkv-ink-2: #5b6270;
	--rkv-ink-3: #8a919e;
	--rkv-line: #e2e5ea;
	--rkv-line-2: #eff1f4;
	--rkv-surface: #f7f8fa;
	--rkv-white: #fff;
	--rkv-accent: #14161a;
	--rkv-glow: #ffc53d;
	--rkv-ok: #157347;
	--rkv-warn: #8a5a00;
	--rkv-radius: 14px;
	--rkv-radius-sm: 9px;

	color: var(--rkv-ink);
	font-size: 16px;
	line-height: 1.5;
	max-width: 1280px;
	margin: 0 auto;

	/* Asettelu mukautuu taman lohkon leveyteen, ei selainikkunan. */
	container-type: inline-size;
}

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

.rkv button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.rkv svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rkv [hidden] {
	display: none !important;
}

/* Teeman perustyylien neutralointi; valit hoidetaan gap-arvoilla. */
.rkv .rkv-card-body > p,
.rkv .rkv-card-foot > * {
	margin: 0;
}

.rkv .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rkv-title {
	margin: 0 0 18px;
	font-size: clamp(1.6rem, 1.1rem + 1.9vw, 2.3rem);
	line-height: 1.15;
	letter-spacing: -.02em;
}

/* ---------------------------------------------------------------- Hakukentta */

.rkv-searchbar {
	margin-bottom: 18px;
}

.rkv-label {
	display: block;
	margin-bottom: 8px;
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rkv-ink-2);
}

/*
 * Kehys on kentan ymparilla olevassa laatikossa, ei itse input-elementissa,
 * ja ikoni on flex-rivin osa eika absoluuttisesti sijoitettu. Nain teeman
 * omat lomaketyylit eivat voi tyontaa tekstia ikonin alle.
 */
.rkv-field {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 12px 0 18px;
	background: var(--rkv-white);
	border: 2px solid var(--rkv-line);
	border-radius: var(--rkv-radius);
	transition: border-color .15s, box-shadow .15s;
}

.rkv-field:focus-within {
	border-color: var(--rkv-accent);
	box-shadow: 0 0 0 4px rgba(20, 22, 26, .07);
}

.rkv-field-icon {
	flex: none;
	width: 21px;
	height: 21px;
	color: var(--rkv-ink-3);
	pointer-events: none;
}

/* Teeman lomaketyylit kumotaan, jotta kentta istuu kehykseensa. */
.rkv .rkv-field .rkv-input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 17px 0 !important;
	font-family: inherit;
	font-size: 1.125rem !important;
	line-height: 1.3 !important;
	color: var(--rkv-ink) !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.rkv-input::-webkit-search-cancel-button,
.rkv-input::-webkit-search-decoration {
	display: none;
	-webkit-appearance: none;
}

.rkv-input::placeholder {
	color: var(--rkv-ink-3);
	opacity: 1;
}

.rkv-clear {
	flex: none;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	color: var(--rkv-ink-2);
	background: var(--rkv-line-2);
	border: 0;
	border-radius: 50%;
}

.rkv-clear:hover {
	color: var(--rkv-ink);
	background: var(--rkv-line);
}

.rkv-clear svg {
	width: 14px;
	height: 14px;
}

/* ------------------------------------------------------------- OE-vihjepalkki */

/* Kapea tietolaatikko, joka ei kilpaile hakukentan kanssa huomiosta. */
.rkv .rkv-oe-hint {
	display: inline-flex;
	align-items: flex-start;
	gap: 8px;
	max-width: 100%;
	margin: 10px 0 0;
	padding: 8px 13px;
	font-size: .8125rem;
	line-height: 1.5;
	color: var(--rkv-ink-2);
	background: #fffaf0;
	border: 1px solid #f0e2c2;
	border-radius: var(--rkv-radius-sm);
}

.rkv-oe-icon {
	flex: none;
	width: 15px;
	height: 15px;
	margin-top: 3px;
	color: var(--rkv-warn);
	stroke-width: 2;
}

.rkv-oe-demo {
	padding: 1px 8px;
	font-size: .8125rem;
	font-variant-numeric: tabular-nums;
	color: var(--rkv-warn);
	background: rgba(255, 197, 61, .2);
	border: 1px dashed #dcc17c;
	border-radius: 100px;
}

.rkv-oe-demo:hover {
	background: rgba(255, 197, 61, .4);
}

/* Kermatausta vaatii tummemman savyn kuin --rkv-ink-3, jotta pieni
   teksti pysyy luettavana. */
.rkv-oe-note {
	color: var(--rkv-ink-2);
}

/* ------------------------------------------------------------- Rajausrivi */

.rkv-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 14px;
	padding: 16px 0;
	margin-bottom: 20px;
	border-top: 1px solid var(--rkv-line);
	border-bottom: 1px solid var(--rkv-line);
}

.rkv-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px;
}

.rkv-facet {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.rkv-facet-label {
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--rkv-ink-3);
}

/* Kuten hakukentassa: teeman lomaketyylit kumotaan. */
.rkv .rkv-filters .rkv-select {
	width: auto;
	max-width: 100%;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 9px 34px 9px 13px !important;
	font-family: inherit;
	font-size: .9375rem !important;
	line-height: 1.3 !important;
	color: var(--rkv-ink) !important;
	background-color: var(--rkv-white) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6270' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
	background-size: 15px 15px !important;
	border: 1px solid var(--rkv-line) !important;
	border-radius: var(--rkv-radius-sm) !important;
	box-shadow: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.rkv .rkv-filters .rkv-select:focus {
	border-color: var(--rkv-accent) !important;
	outline: none !important;
	box-shadow: 0 0 0 3px rgba(20, 22, 26, .08) !important;
}

.rkv-reset {
	align-self: flex-end;
	padding: 9px 14px;
	font-size: .875rem;
	font-weight: 600;
	color: var(--rkv-ink);
	background: var(--rkv-line-2);
	border: 1px solid transparent;
	border-radius: var(--rkv-radius-sm);
}

.rkv-reset:hover {
	background: var(--rkv-line);
}

.rkv .rkv-status {
	margin: 0;
	font-size: .9375rem;
	color: var(--rkv-ink-2);
	white-space: nowrap;
}

.rkv .rkv-status strong {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--rkv-ink);
}

.rkv .rkv-status em {
	font-style: normal;
	font-weight: 600;
	color: var(--rkv-ink);
}

/* ------------------------------------------------------------------ Tulokset */

/*
 * Sarakemaara seuraa kaytettavissa olevaa tilaa: kortti ei koskaan kapene
 * alle 280 pikselin, oli lohko kuinka kapea tahansa.
 */
.rkv-results {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.rkv-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--rkv-white);
	border: 1px solid var(--rkv-line);
	border-radius: var(--rkv-radius);
	transition: border-color .15s, box-shadow .15s, transform .15s;
}

.rkv-card:hover {
	border-color: var(--rkv-ink-3);
	box-shadow: 0 6px 28px rgba(20, 22, 26, .1);
	transform: translateY(-3px);
}

/* Tuotekuvat ovat valkoisella pohjalla, joten alue on valkoinen; muuten
   kuvan ymparille jaa nakyva vaalea laatikko. */
.rkv-card-media {
	position: relative;
	aspect-ratio: 4 / 3;
	padding: 14px;
	background: var(--rkv-white);
	border-bottom: 1px solid var(--rkv-line-2);
}

.rkv-card-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.rkv-badges {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	max-width: calc(100% - 24px);
}

.rkv-badge {
	padding: 4px 9px;
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rkv-white);
	background: var(--rkv-accent);
	border-radius: 5px;
}

/* Ominaisuus erottuu tuotekoodista: reunus mustan laatan sijaan. */
.rkv-badge.is-hp {
	color: var(--rkv-ink);
	background: var(--rkv-white);
	box-shadow: inset 0 0 0 1px var(--rkv-ink);
}

.rkv-badge.is-oe {
	color: #3d2c00;
	background: var(--rkv-glow);
	font-variant-numeric: tabular-nums;
	text-transform: none;
	letter-spacing: 0;
}

.rkv-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 11px;
	padding: 16px 18px 18px;
}

.rkv-card-sku {
	font-size: .75rem;
	letter-spacing: .04em;
	color: var(--rkv-ink-3);
}

.rkv-card-name {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 650;
	line-height: 1.32;
	letter-spacing: -.01em;
}

.rkv-card-name a {
	color: inherit;
	text-decoration: none;
}

.rkv-card-name a:hover {
	text-decoration: underline;
}

.rkv-fitline {
	padding: 10px 12px;
	font-size: .8125rem;
	line-height: 1.45;
	background: var(--rkv-surface);
	border-left: 3px solid var(--rkv-ok);
	border-radius: 0 var(--rkv-radius-sm) var(--rkv-radius-sm) 0;
}

.rkv-fitline-label {
	display: block;
	margin-bottom: 2px;
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rkv-ok);
}

.rkv-fitline mark {
	padding: 0 3px;
	color: inherit;
	background: rgba(255, 197, 61, .55);
	border-radius: 3px;
}

.rkv-fitline-note {
	display: block;
	margin-top: 5px;
	font-size: .75rem;
	color: var(--rkv-warn);
}

.rkv-more {
	align-self: flex-start;
	padding: 0;
	font-size: .8125rem;
	color: var(--rkv-ink-2);
	text-decoration: underline;
	background: none;
	border: 0;
}

.rkv-more:hover {
	color: var(--rkv-ink);
}

.rkv-details {
	font-size: .875rem;
	color: var(--rkv-ink-2);
}

.rkv-card-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 10px;
	margin-top: auto;
	padding-top: 6px;
}

.rkv-price {
	font-size: 1.375rem;
	font-weight: 700;
	letter-spacing: -.01em;
	white-space: nowrap;
}

.rkv-stock {
	font-size: .8125rem;
	color: var(--rkv-ok);
}

.rkv-stock.is-out {
	color: var(--rkv-ink-3);
}

.rkv-btn {
	flex: 1 1 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 4px;
	padding: 13px 18px;
	font-size: .9375rem;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	color: var(--rkv-white);
	background: var(--rkv-accent);
	border: 1px solid var(--rkv-accent);
	border-radius: var(--rkv-radius-sm);
	transition: opacity .15s;
}

.rkv-btn:hover,
.rkv-btn:focus {
	color: var(--rkv-white);
	opacity: .86;
}

/* --------------------------------------------------------------- Tyhja tila */

.rkv-empty {
	grid-column: 1 / -1;
	padding: 44px 24px;
	text-align: center;
	background: var(--rkv-surface);
	border: 1px dashed var(--rkv-line);
	border-radius: var(--rkv-radius);
}

.rkv-empty h3 {
	margin: 0 0 10px;
	font-size: 1.25rem;
	letter-spacing: -.01em;
}

.rkv .rkv-empty p {
	max-width: 48ch;
	margin: 0 auto 8px;
	font-size: .9375rem;
	color: var(--rkv-ink-2);
}

/* Tarkempi kuin ylla oleva .rkv .rkv-empty p, jonka sisalla tama on. */
.rkv .rkv-empty .rkv-suggest {
	margin: 14px auto 0;
	font-size: .9375rem;
	color: var(--rkv-ink);
}

.rkv-empty-oe {
	display: inline-block;
	margin-bottom: 12px;
	padding: 8px 14px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 1rem;
	background: var(--rkv-white);
	border: 1px solid var(--rkv-line);
	border-radius: var(--rkv-radius-sm);
}

.rkv-suggest button {
	padding: 0;
	font-weight: 700;
	color: var(--rkv-ink);
	text-decoration: underline;
	background: none;
	border: 0;
}

.rkv .rkv-empty-cta {
	margin: 18px 0 0;
}

.rkv .rkv-empty-cta .rkv-btn {
	flex: 0 0 auto;
	width: auto;
	margin: 0;
}

/* Pysyva kehotus tulosten alla. */
.rkv .rkv-help {
	margin: 26px 0 0;
	padding-top: 18px;
	font-size: .9375rem;
	text-align: center;
	color: var(--rkv-ink-2);
	border-top: 1px solid var(--rkv-line);
}

.rkv .rkv-help a {
	color: var(--rkv-ink);
	font-weight: 600;
	text-underline-offset: 3px;
}

.rkv-skeleton {
	height: 340px;
	background: linear-gradient(90deg, var(--rkv-surface) 25%, var(--rkv-line-2) 37%, var(--rkv-surface) 63%);
	background-size: 400% 100%;
	border-radius: var(--rkv-radius);
	animation: rkv-shimmer 1.3s ease-in-out infinite;
}

@keyframes rkv-shimmer {
	0%   { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

.rkv-noscript {
	padding: 16px;
	background: var(--rkv-surface);
	border-radius: var(--rkv-radius);
}

/* ------------------------------------------------------------------ Kapea */

@container (max-width: 560px) {
	.rkv-toolbar {
		align-items: stretch;
		flex-direction: column;
	}

	.rkv-filters {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.rkv .rkv-filters .rkv-select {
		width: 100%;
	}

	.rkv-reset {
		grid-column: 1 / -1;
	}

	.rkv .rkv-status {
		white-space: normal;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rkv *,
	.rkv *::before,
	.rkv *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}

	.rkv-card:hover {
		transform: none;
	}
}
