.yan-fitment-catalog {
	margin-bottom: 40px;
}

.yan-fitment-title {
	margin-bottom: 24px;
}

.yan-fitment-other-mounts {
	margin: 0 0 20px;
}

.yan-fitment-other-mounts__btn {
	display: inline-block;
}

.yan-fitment-products-title {
	margin: 0 0 22px;
}

.yan-fitment-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 18px;
	margin: 0 0 34px;
}

.yan-fitment-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 150px;
	padding: 18px 12px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	text-align: center;
	text-decoration: none;
	background: #fff;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.yan-fitment-card:hover {
	border-color: currentColor;
	transform: translateY(-2px);
}

.yan-fitment-card-image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: auto;
	margin-bottom: 12px;
}

.yan-fitment-card-image img {
	display: block;
	width: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.yan-fitment-card-fallback {
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	font-size: 34px;
	font-weight: 700;
	text-transform: uppercase;
}

.yan-fitment-card-title {
	color: inherit;
	font-weight: 600;
	line-height: 1.25;
}

.yan-fitment-image-debug {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 8px;
	border: 1px dashed rgba(0, 0, 0, 0.25);
	background: rgba(255, 245, 157, 0.35);
	color: #222;
	font-size: 11px;
	line-height: 1.35;
	text-align: left;
	word-break: break-all;
}

.yan-fitment-image-debug strong,
.yan-fitment-image-debug small,
.yan-fitment-image-debug code {
	display: block;
	margin: 2px 0;
	color: inherit;
	font-size: inherit;
}

.yan-fitment-empty {
	margin: 24px 0;
}

.yan-fitment-catalog ul.products li.product {
	position: relative;
}

.yan-fitment-product-badges {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	z-index: 8;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 5px;
	pointer-events: none;
}

.yan-fitment-product-badge {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: #4c983f;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
}

.yan-fitment-product-badge--overflow {
	font-weight: 700;
	letter-spacing: 0.02em;
}

.single-product .product {
	position: relative;
}

.yan-fitment-product-badges-single {
	top: 18px;
	left: 18px;
	right: auto;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: flex-start;
	max-width: 48%;
	justify-content: flex-start;
}

/* Логотип марки з того ж контексту, що й текстові бейджі — той самий блок «pill», низліво від картки */
.yan-fitment-product-badges-single.yan-fitment-product-badges--brand-logo {
	bottom: 1px;
	left: 18px;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	max-width: 48%;
	justify-content: flex-start;
}

.yan-fitment-product-badge--brand-logo {
    background: transparent;
}

.yan-fitment-product-badge--brand-logo img {
	display: block;
	max-height: 80px;
	width: auto;
	max-width: 120px;
	object-fit: contain;
	/* Білий фон PNG/JPEG зникає візуально (multiply: білий × підкладка ≈ підкладка) */
	mix-blend-mode: multiply;
}

/* Логотип марки поруч із таблицею атрибутів (?fitment / ?car): зліва від таблиці */
.yan-fitment-attributes-with-brand-logo {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 1.25rem;
	width: 100%;
	box-sizing: border-box;
}

.yan-fitment-attributes-table-col {
	flex: 1 1 auto;
	min-width: 0;
	order: 0;
}

.yan-fitment-attributes-logo-col {
	flex: 0 0 auto;
	align-self: center;
	order: -1;
}

.yan-fitment-product-badges--in-attributes .yan-fitment-product-badge--brand-logo img {
	max-width: 180px;
	max-height: none;
	height: auto;
}

.yan-fitment-product-badges--in-attributes {
	position: static;
	top: auto;
	left: auto;
	right: auto;
	bottom: auto;
	display: flex;
	justify-content: center;
	align-items: center;
	max-width: none;
	margin: 0;
	pointer-events: none;
}

.yan-fitment-product-badges--in-attributes.yan-fitment-product-badges--brand-logo {
	max-width: none;
}

.yan-fitment-usage {
	margin: 24px 0;
	overflow-x: auto;
	position: relative;
}

.yan-fitment-usage-viewport {
	position: relative;
}

.yan-fitment-usage--collapsed .yan-fitment-usage-viewport {
	max-height: 400px;
	overflow: hidden;
}

.yan-fitment-usage--collapsed:not(.yan-fitment-usage--no-expand) .yan-fitment-usage-viewport::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 120px;
	background: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 255, 255, 0.65) 42%,
		#fff 92%
	);
	pointer-events: none;
	z-index: 1;
}

.yan-fitment-usage--collapsed:not(.yan-fitment-usage--no-expand) .yan-fitment-usage-viewport::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 72px;
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	mask-image: linear-gradient(to bottom, transparent, #000 55%);
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 55%);
	pointer-events: none;
	z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
	.yan-fitment-usage--collapsed:not(.yan-fitment-usage--no-expand) .yan-fitment-usage-viewport::before {
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}
}

.yan-fitment-usage-expand {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 10px 0 0;
	position: relative;
	z-index: 2;
	margin-top: -28px;
}

.yan-fitment-usage--no-expand .yan-fitment-usage-expand,
.yan-fitment-usage--revealed .yan-fitment-usage-expand {
	display: none;
}

.yan-fitment-usage-toggle {
	margin: 0;
	padding: 6px 12px;
	background: none;
	border: none;
	cursor: pointer;
	font: inherit;
	line-height: 1.35;
	color: #4c983f;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-align: center;
}

.yan-fitment-usage-toggle:hover {
	opacity: 0.88;
}

.yan-fitment-usage-toggle:focus {
	outline: 2px solid #4c983f;
	outline-offset: 2px;
}

.yan-fitment-usage-table {
	width: 100%;
	border-collapse: collapse;
}

.yan-fitment-usage-table th,
.yan-fitment-usage-table td {
	padding: 10px 12px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	text-align: left;
}

.yan-fitment-usage-table th {
	font-weight: 700;
}

.yan-fitment-usage-table .yan-fitment-usage-current,
.yan-fitment-usage-table .yan-fitment-usage-current a {
	font-weight: 700;
}

.yan-fitment-pa-target-addon {
	margin-top: 2.5rem;
	padding-top: 1.75rem;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.yan-fitment-pa-target-addon__title {
	margin: 0 0 12px;
	font-size: 1.35em;
}

.yan-fitment-pa-target-addon__more {
	margin: 0 0 22px;
}

.yan-fitment-pa-target-addon__more-link {
	font-weight: 600;
}

@media (max-width: 999px) {
	.yan-fitment-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 690px) {
	.yan-fitment-attributes-with-brand-logo {
		flex-direction: column;
		align-items: stretch;
	}

	.yan-fitment-attributes-logo-col {
		align-self: center;
		order: 1;
	}

	.yan-fitment-attributes-table-col {
		order: 0;
	}

	.yan-fitment-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.yan-fitment-card {
		min-height: 126px;
	}
}

/**
 * Related-by-target cross-sells (child theme): Salient mobile rule uses ~47.8% width + margin-right 4%.
 * Floated .columns-* grid then wraps early — flex + gap keeps two tiles per row without horizontal margins.
 */
@media only screen and (min-width: 1px) and (max-width: 999px) {
	body .cross-sells.related-by-target ul.products[class*="columns-"],
	body.woocommerce .cross-sells.related-by-target ul.products[class*="columns-"],
	.woocommerce .cross-sells.related-by-target ul.products[class*="columns-"] {
		display: flex;
		flex-wrap: wrap;
		column-gap: 12px;
		row-gap: 0;
		margin: 0;
		padding: 0;
		list-style: none;
		clear: both;
	}

	/* WooCommerce clearfix ::before/::after become flex items and steal the first row slot. */
	body .cross-sells.related-by-target ul.products[class*="columns-"]::before,
	body .cross-sells.related-by-target ul.products[class*="columns-"]::after,
	body.woocommerce .cross-sells.related-by-target ul.products[class*="columns-"]::before,
	body.woocommerce .cross-sells.related-by-target ul.products[class*="columns-"]::after,
	.woocommerce .cross-sells.related-by-target ul.products[class*="columns-"]::before,
	.woocommerce .cross-sells.related-by-target ul.products[class*="columns-"]::after {
		content: none !important;
		display: none !important;
	}

	body .cross-sells.related-by-target ul.products li.product,
	body.woocommerce .cross-sells.related-by-target ul.products li.product,
	.woocommerce .cross-sells.related-by-target ul.products li.product,
	.woocommerce-page .cross-sells.related-by-target ul.products li.product {
		float: none !important;
		clear: none !important;
		flex: 0 0 calc((100% - 12px) / 2) !important;
		width: calc((100% - 12px) / 2) !important;
		max-width: calc((100% - 12px) / 2) !important;
		min-width: 0 !important;
		margin: 0 0 25px 0 !important;
	}
}

/* Fitment catalog: SEO copy after grid — дрібний шрифт, повний текст */
.yan-fitment-archive-seo {
	margin-top: 2em;
	padding-top: 1.25em;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	font-size: 0.75em;
	line-height: 1.55;
	color: rgba(0, 0, 0, 0.7);
}

.yan-fitment-archive-seo p {
	margin: 0 0 0.75em;
}

.yan-fitment-archive-seo__title {
	margin: 0 0 0.55em;
	font-size: 1.08em;
	font-weight: 600;
	line-height: 1.35;
	color: inherit;
}

.yan-fitment-archive-seo__list {
	margin: 0 0 1em 1.1em;
	padding: 0;
	list-style: disc;
}

.yan-fitment-archive-seo__list li {
	margin: 0 0 0.4em;
}
