/**
 * CV Compatibility Centre: "Replacements for this kit" on kit pages.
 *
 * Figma PDP/Compatibility-Default (8775:14215): grey box 16 radius, 24 of
 * padding and gap; heading 18, subline 14; white cards on a 20 radius with a
 * gray-200 hairline, 64 photo, 14 name and price, 6 between cards. Hover
 * (8641:13345): the name turns brand red and underlined.
 */

.cg-parts {
	--cg-white: #fff;
	--cg-gray-100: #f5f5f4;
	--cg-gray-200: #e7e5e4;
	--cg-gray-400: #a9a29d;
	--cg-gray-500: #79716b;
	--cg-gray-600: #57534e;
	--cg-gray-950: #171412;
	--cg-brand: #e0302c;

	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 12px 0 0;
	padding: 24px;
	border-radius: 16px;
	background: var(--cg-gray-100);
}

.cg-parts__head {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cg-parts__title {
	margin: 0;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: -.02em;
	color: var(--cg-gray-950);
}

.cg-parts__sub {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
}

.cg-parts__list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cg-parts__list li {
	margin: 0;
}

.cg-parts__card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 24px 12px 12px;
	border: 1px solid var(--cg-gray-200);
	border-radius: 20px;
	background: var(--cg-white);
	text-decoration: none;
	transition: border-color 200ms ease;
}

.cg-parts__card:hover {
	border-color: var(--cg-gray-400);
}

.cg-parts__ph {
	width: 64px;
	height: 64px;
	flex: 0 0 64px;
	border-radius: 8px;
	background: var(--cg-gray-100);
	overflow: hidden;
	display: grid;
	place-items: center;
}

.cg-parts__ph img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.cg-parts__tx {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cg-parts__name {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-950);
}

.cg-parts__card:hover .cg-parts__name,
.cg-parts__card:focus-visible .cg-parts__name {
	color: var(--cg-brand);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cg-parts__stock {
	font-size: 12px;
	line-height: 1.4;
	color: var(--cg-gray-500);
}

.cg-parts__price {
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
	white-space: nowrap;
	text-align: right;
}

.cg-parts__price del {
	color: var(--cg-gray-400);
}

.cg-parts__price ins {
	text-decoration: none;
}

@media (max-width: 639px) {
	.cg-parts {
		padding: 16px;
		gap: 16px;
	}

	.cg-parts__card {
		padding: 8px 16px 8px 8px;
		align-items: flex-start;
		flex-wrap: wrap;
	}

	.cg-parts__ph {
		width: 56px;
		height: 56px;
		flex-basis: 56px;
	}

	/* the price drops under the name on a phone */
	.cg-parts__tx {
		align-self: center;
	}

	.cg-parts__price {
		flex: 0 0 100%;
		padding-left: 68px;
		text-align: left;
		white-space: normal;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cg-parts__card {
		transition: none;
	}
}
