/*
 * Shop by motorcycle: chassis finder, brand and model directory, parts for one bike,
 * and the home-page finder band. Loaded only by those two pages; uses gsp-ui.css tokens.
 */

.gsp-bike,
.gsp-home-finder {
	--bike-ink: var(--mf-ink, #101418);
	--bike-text: var(--mf-text, #3f4650);
	--bike-muted: var(--mf-muted, #667085);
	--bike-border: var(--mf-border, #e4e7ec);
	--bike-soft: var(--mf-soft, #f5f6f8);
	--bike-red: var(--gsp-red, #d3141c);
	--bike-red-dark: var(--gsp-red-dark, #a80f16);
	--bike-red-tint: var(--gsp-red-tint, #fff1f1);
	--bike-radius: var(--gsp-radius, 14px);
	--bike-radius-sm: var(--gsp-radius-sm, 10px);
	color: var(--bike-text);
	font-family: var(--mf-font, inherit);
}

.gsp-bike {
	display: grid;
	gap: 20px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 16px 0 32px;
}

.gsp-bike h1,
.gsp-bike h2,
.gsp-bike h3 {
	color: var(--bike-ink);
	letter-spacing: -0.01em;
}

.gsp-bike-eyebrow {
	margin: 0 0 6px;
	color: var(--bike-red);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.gsp-bike-code {
	padding: 1px 6px;
	border-radius: 6px;
	background: var(--bike-soft);
	color: var(--bike-ink);
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: 0.92em;
	letter-spacing: 0.04em;
	overflow-wrap: anywhere;
}

/* ---------- Hero and chassis form ---------- */

.gsp-bike-hero {
	display: grid;
	gap: 18px;
	padding: 22px 18px;
	border-radius: var(--bike-radius);
	background:
		radial-gradient(120% 140% at 100% 0%, rgba(211, 20, 28, 0.16), transparent 55%),
		linear-gradient(160deg, #15191e 0%, #23282f 100%);
	color: #e8ebef;
}

.gsp-bike-hero h1 {
	margin: 0;
	color: #fff;
	font-size: clamp(1.6rem, 6vw, 2.5rem);
	font-weight: 800;
	line-height: 1.1;
}

.gsp-bike-hero .gsp-bike-eyebrow {
	color: #ff8a8f;
}

.gsp-bike-lead {
	margin: 10px 0 0;
	max-width: 46ch;
	color: #c9ced6;
	font-size: 1rem;
	line-height: 1.5;
}

.gsp-bike-chassis {
	display: grid;
	gap: 8px;
	margin: 0;
}

.gsp-bike-chassis label,
.gsp-bike-filter label {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
}

.gsp-bike-hero .gsp-bike-chassis label {
	color: #fff;
}

.gsp-bike-chassis__row {
	display: flex;
	gap: 8px;
}

.gsp-bike > *,
.gsp-bike-hero > *,
.gsp-bike-directory > *,
.gsp-bike-selected > *,
.gsp-home-finder > * {
	/* Grid children may shrink below their content's natural width. */
	min-width: 0;
}

.gsp-bike-chassis__row input {
	/* A zero basis stops the input's intrinsic size from widening the card. */
	flex: 1 1 0;
	width: 0;
	min-width: 0;
	height: var(--gsp-control, 48px);
	padding: 0 14px;
	border: 1px solid var(--gsp-control-border, #d0d5dd);
	border-radius: var(--bike-radius-sm);
	background: #fff;
	color: var(--bike-ink);
	font-size: 16px;
}

.gsp-bike-chassis input[name="chassis"] {
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.gsp-bike-chassis input[name="chassis"]::placeholder {
	letter-spacing: 0.02em;
	text-transform: none;
}

.gsp-bike-chassis__row input:focus {
	border-color: var(--bike-red);
	box-shadow: var(--gsp-focus, 0 0 0 3px rgba(211, 20, 28, 0.2));
	outline: none;
}

.gsp-bike-chassis__row .btn {
	flex: 0 0 auto;
	height: var(--gsp-control, 48px);
	padding: 0 18px;
	white-space: nowrap;
}

.gsp-bike .gsp-chassis-hint {
	margin: 0;
	color: #aeb4be;
	font-size: 0.8125rem;
	line-height: 1.4;
}

.gsp-bike-where {
	margin-top: 2px;
	font-size: 0.875rem;
}

.gsp-bike-where summary {
	display: inline-flex;
	min-height: 32px;
	align-items: center;
	color: #fff;
	cursor: pointer;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gsp-bike-where ul {
	display: grid;
	gap: 8px;
	margin: 8px 0 0;
	padding: 12px 14px 12px 30px;
	border-radius: var(--bike-radius-sm);
	background: rgba(255, 255, 255, 0.07);
	color: #d7dbe1;
	line-height: 1.45;
}

.gsp-bike-where strong {
	color: #fff;
}

.gsp-bike-hero .gsp-bike-code {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

/* ---------- Remembered bike ---------- */

.gsp-my-bike {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	padding: 10px 12px;
	border-radius: var(--bike-radius-sm);
	background: #fff;
	color: var(--bike-ink);
}

.gsp-my-bike[hidden] {
	display: none;
}

.gsp-my-bike__label {
	color: var(--bike-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.gsp-my-bike__name {
	flex: 1 1 auto;
	min-width: 0;
	color: var(--bike-ink);
	font-weight: 700;
	overflow-wrap: anywhere;
}

.gsp-my-bike__name::after {
	content: " →";
	color: var(--bike-red);
}

.gsp-my-bike__clear {
	min-height: 32px;
	padding: 0 10px;
	border: 1px solid var(--bike-border);
	border-radius: 999px;
	background: transparent;
	color: var(--bike-text);
	font-size: 0.8125rem;
}

/* ---------- Chassis result ---------- */

.gsp-bike-result {
	padding: 16px;
	border: 1px solid var(--bike-border);
	border-left: 4px solid var(--bike-red);
	border-radius: var(--bike-radius);
	background: #fff;
	box-shadow: var(--gsp-card-shadow, none);
}

.gsp-bike-result__title {
	margin: 0 0 6px;
	font-size: 1rem;
	font-weight: 700;
}

.gsp-bike-result__message {
	margin: 0;
	line-height: 1.5;
}

.gsp-bike-matches {
	display: grid;
	gap: 10px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.gsp-bike-match {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	gap: 10px 12px;
	align-items: center;
	padding: 12px;
	border-radius: var(--bike-radius-sm);
	background: var(--bike-soft);
}

.gsp-bike-match__text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.gsp-bike-match__text strong {
	color: var(--bike-ink);
	overflow-wrap: anywhere;
}

.gsp-bike-match__text small {
	color: var(--bike-muted);
	overflow-wrap: anywhere;
}

.gsp-bike-match__cta {
	grid-column: 1 / -1;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.gsp-bike-result__note {
	margin: 14px 0 0;
	color: var(--bike-muted);
	font-size: 0.875rem;
}

.gsp-bike-result__note a {
	color: var(--bike-red);
	font-weight: 600;
}

/* ---------- Icons ---------- */

.gsp-bike-kind {
	display: inline-grid;
	width: 52px;
	height: 40px;
	place-items: center;
	border-radius: var(--bike-radius-sm);
	background: var(--bike-red-tint);
	color: var(--bike-red);
}

.gsp-bike-kind--large {
	width: 64px;
	height: 52px;
}

.gsp-bike-icon {
	width: 34px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.2;
}

.gsp-bike-kind--large .gsp-bike-icon {
	width: 44px;
	height: 30px;
}

/* ---------- Directory ---------- */

.gsp-bike-directory {
	display: grid;
	gap: 18px;
}

.gsp-bike-directory__head {
	display: grid;
	gap: 12px;
}

.gsp-bike-directory__head h2 {
	margin: 0;
	font-size: 1.375rem;
	font-weight: 800;
}

.gsp-bike-filter {
	display: grid;
	gap: 6px;
	margin: 0;
}

.gsp-bike-brands {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
	gap: 10px;
}

.gsp-bike-brand {
	display: grid;
	justify-items: center;
	gap: 4px;
	padding: 14px 10px 12px;
	border: 1px solid var(--bike-border);
	border-radius: var(--bike-radius);
	background: #fff;
	color: var(--bike-ink);
	text-align: center;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.gsp-bike-brand:hover,
.gsp-bike-brand:focus-visible {
	border-color: var(--bike-red);
	box-shadow: var(--mf-shadow, 0 10px 30px rgba(16, 24, 40, 0.1));
	color: var(--bike-ink);
	text-decoration: none;
}

.gsp-bike-brand img {
	width: auto;
	max-width: 96px;
	height: 34px;
	object-fit: contain;
}

.gsp-bike-brand__mark {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 50%;
	background: var(--bike-ink);
	color: #fff;
	font-weight: 800;
}

.gsp-bike-brand__name {
	font-weight: 700;
}

.gsp-bike-brand small {
	color: var(--bike-muted);
	font-size: 0.75rem;
}

.gsp-bike-group {
	scroll-margin-top: 90px;
}

.gsp-bike-group[hidden] {
	display: none;
}

.gsp-bike-group h3 {
	margin: 0 0 10px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--bike-ink);
	font-size: 1.125rem;
	font-weight: 800;
}

.gsp-bike-models {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gsp-bike-models li[hidden] {
	display: none;
}

.gsp-bike-model {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	min-height: 64px;
	padding: 10px 12px;
	border: 1px solid var(--bike-border);
	border-radius: var(--bike-radius-sm);
	background: #fff;
	color: var(--bike-ink);
	text-decoration: none;
}

.gsp-bike-model:hover,
.gsp-bike-model:focus-visible {
	border-color: var(--bike-red);
	color: var(--bike-ink);
	text-decoration: none;
}

.gsp-bike-model__text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.gsp-bike-model__text strong {
	overflow-wrap: anywhere;
}

.gsp-bike-model__text small {
	color: var(--bike-muted);
}

.gsp-bike-model__go {
	color: var(--bike-red);
	font-size: 1.5rem;
	line-height: 1;
}

/* ---------- One bike's parts ---------- */

.gsp-bike-selected {
	display: grid;
	gap: 14px;
}

.gsp-bike-selected__card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 12px 14px;
	align-items: center;
	padding: 16px;
	border: 1px solid var(--bike-border);
	border-radius: var(--bike-radius);
	background: #fff;
}

.gsp-bike-selected__text h2 {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 800;
	overflow-wrap: anywhere;
}

.gsp-bike-selected__text .gsp-bike-eyebrow {
	margin-bottom: 2px;
}

.gsp-bike-selected__years {
	margin: 2px 0 0;
	color: var(--bike-muted);
}

.gsp-bike-change {
	grid-column: 1 / -1;
	justify-self: start;
	color: var(--bike-red);
	font-weight: 600;
}

.gsp-bike-parts__title {
	margin: 4px 0 0;
	font-size: 1.125rem;
	font-weight: 800;
}

.gsp-bike-parts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gsp-bike-part {
	display: grid;
	grid-template-rows: auto 1fr;
	overflow: hidden;
	border: 1px solid var(--bike-border);
	border-radius: var(--bike-radius-sm);
	background: #fff;
}

.gsp-bike-part__image {
	display: grid;
	aspect-ratio: 1 / 1;
	place-items: center;
	background: #fff;
	border-bottom: 1px solid var(--bike-border);
}

.gsp-bike-part__image img {
	width: 100%;
	height: 100%;
	padding: 8px;
	object-fit: contain;
}

.gsp-bike-part__placeholder {
	color: #c4c9d1;
}

.gsp-bike-part__placeholder .gsp-bike-icon {
	width: 56px;
	height: 40px;
}

.gsp-bike-part__body {
	display: grid;
	align-content: start;
	gap: 4px;
	padding: 10px;
}

.gsp-bike-part__code {
	margin: 0;
	color: var(--bike-muted);
	font-size: 0.75rem;
	overflow-wrap: anywhere;
}

.gsp-bike-part__title {
	display: -webkit-box;
	overflow: hidden;
	color: var(--bike-ink);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.gsp-bike-part__title::after {
	position: absolute;
	inset: 0;
	content: "";
}

.gsp-bike-part {
	position: relative;
}

.gsp-bike-part__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 8px;
	margin: 4px 0 0;
	font-size: 0.875rem;
}

.gsp-bike-part__bottom strong {
	color: var(--bike-ink);
	font-size: 1rem;
}

.gsp-bike-part__bottom span {
	color: var(--bike-red);
	font-weight: 600;
}

.gsp-bike-part:hover,
.gsp-bike-part:focus-within {
	border-color: var(--bike-red);
}

.gsp-bike-pages {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.gsp-bike-pages:empty {
	display: none;
}

.gsp-bike-empty {
	display: grid;
	justify-items: start;
	gap: 10px;
	padding: 16px;
	border: 1px dashed var(--bike-border);
	border-radius: var(--bike-radius);
	background: var(--bike-soft);
}

.gsp-bike-empty[hidden] {
	display: none;
}

.gsp-bike-empty p {
	margin: 0;
}

/* ---------- Help band ---------- */

.gsp-bike-help {
	display: grid;
	gap: 14px;
	padding: 18px;
	border-radius: var(--bike-radius);
	background: var(--bike-red-tint);
}

.gsp-bike-help h2 {
	margin: 0 0 4px;
	font-size: 1.125rem;
	font-weight: 800;
}

.gsp-bike-help p {
	margin: 0;
	line-height: 1.5;
}

.gsp-bike-help__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.gsp-bike-help__actions .btn,
.gsp-bike-empty .btn {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

/* ---------- Home-page finder band ---------- */

.gsp-home-finder {
	display: grid;
	gap: 12px;
	margin: 12px 0 16px;
	padding: 16px;
	border-radius: var(--bike-radius);
	background:
		radial-gradient(120% 160% at 100% 0%, rgba(211, 20, 28, 0.18), transparent 55%),
		linear-gradient(160deg, #15191e 0%, #23282f 100%);
	color: #e8ebef;
}

.gsp-home-finder h2 {
	margin: 0;
	color: #fff;
	font-size: clamp(1.25rem, 5vw, 1.75rem);
	font-weight: 800;
	line-height: 1.15;
}

.gsp-home-finder .gsp-bike-eyebrow {
	color: #ff8a8f;
}

.gsp-home-finder .gsp-bike-chassis label {
	color: #fff;
}

.gsp-home-finder__brands {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 2px;
	scrollbar-width: none;
}

.gsp-home-finder__brands::-webkit-scrollbar {
	display: none;
}

.gsp-home-finder__brands a {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
}

.gsp-home-finder__brands a:hover,
.gsp-home-finder__brands a:focus-visible {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	text-decoration: none;
}

.gsp-home-finder__brands a.is-all {
	border-color: var(--bike-red);
	background: var(--bike-red);
}

/* ---------- Wider screens ---------- */

@media (min-width: 768px) {
	.gsp-bike {
		gap: 26px;
		padding-top: 24px;
	}

	.gsp-bike-hero {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		align-items: end;
		gap: 28px;
		padding: 36px;
	}

	.gsp-bike-hero .gsp-my-bike {
		grid-column: 1 / -1;
	}

	.gsp-bike-match {
		grid-template-columns: 52px minmax(0, 1fr) auto;
	}

	.gsp-bike-match__cta {
		grid-column: auto;
	}

	.gsp-bike-directory__head {
		grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
		align-items: end;
	}

	.gsp-bike-selected__card {
		grid-template-columns: auto minmax(0, 1fr) auto;
		padding: 20px 24px;
	}

	.gsp-bike-change {
		grid-column: auto;
		justify-self: end;
	}

	.gsp-bike-parts {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 14px;
	}

	.gsp-bike-help {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		padding: 22px 26px;
	}

	.gsp-home-finder {
		grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
		align-items: end;
		gap: 16px 28px;
		padding: 22px 28px;
	}

	.gsp-home-finder__brands,
	.gsp-home-finder .gsp-my-bike {
		grid-column: 1 / -1;
	}
}

@media (max-width: 380px) {
	.gsp-bike-chassis__row {
		flex-wrap: wrap;
	}

	.gsp-bike-chassis__row .btn {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gsp-bike-brand {
		transition: none;
	}
}
