/* Related products: four-column desktop grid and touch-friendly mobile rail. */

[data-collection="woocommerce/product-collection/related"] {
	margin-block: clamp(4rem, 8vw, 7rem) 0;
}

[data-collection="woocommerce/product-collection/related"] > h2.wp-block-heading {
	color: var(--wp--preset--color--secondary);
	font-size: clamp(2rem, 3vw, 2.75rem);
	font-weight: 590;
	letter-spacing: -0.045em;
	line-height: 1.05;
	margin-block: 0 1.75rem !important;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-product-template {
	display: grid !important;
	gap: clamp(1rem, 2vw, 1.6rem);
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	margin: 0;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-product {
	background: var(--wp--preset--color--white);
	border: var(--ovio-border);
	border-radius: 18px;
	box-shadow: 0 8px 24px rgb(37 57 74 / 4%);
	cursor: pointer;
	display: flex !important;
	flex-direction: column;
	margin: 0 !important;
	min-width: 0;
	padding: 0.65rem 0.65rem 0.9rem;
	position: relative;
	width: auto !important;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-image {
	aspect-ratio: 1;
	background: #f3f1ed;
	border-radius: 13px;
	margin: 0 0 0.85rem;
	overflow: hidden;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-image > a {
	display: block;
	height: 100%;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-image > a::after {
	content: "";
	inset: 0;
	position: absolute;
	z-index: 1;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-image img {
	height: 100% !important;
	object-fit: cover;
	transition: transform 220ms ease;
	width: 100% !important;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-image:hover img {
	transform: scale(1.02);
}

[data-collection="woocommerce/product-collection/related"] .wp-block-post-title {
	font-size: clamp(1rem, 1.35vw, 1.2rem) !important;
	font-weight: 680;
	letter-spacing: -0.025em;
	line-height: 1.25;
	margin: 0 0.25rem !important;
	padding-inline: 0.25rem;
	position: relative;
	z-index: 2;
}

[data-collection="woocommerce/product-collection/related"] .wp-block-post-title a {
	text-decoration: none;
}

[data-collection="woocommerce/product-collection/related"] .wp-block-woocommerce-product-price {
	font-size: 0.9rem !important;
	margin-block-end: 0;
	padding-inline: 0.25rem;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-price del {
	color: var(--wp--preset--color--muted);
	opacity: 0.72;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-price ins {
	font-weight: 750;
	text-decoration: none;
}

[data-collection="woocommerce/product-collection/related"] .ovio-product-sale-badge {
	font-size: 0.68rem;
	margin-block-start: 0.35rem;
	padding: 0.25rem 0.5rem;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-sale-badge,
[data-collection="woocommerce/product-collection/related"] .ovio-product-sale-badge {
	pointer-events: none;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-sale-badge {
	font-size: 0.62rem !important;
	letter-spacing: 0.055em;
	line-height: 1;
	min-height: 0;
	padding: 0.38rem 0.55rem !important;
	right: 0.6rem;
	top: 0.6rem;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-sale-badge__text {
	line-height: 1;
}

[data-collection="woocommerce/product-collection/related"] .wp-block-woocommerce-product-button {
	display: none !important;
}

[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-button__button {
	font-size: 0.78rem !important;
	min-height: 44px;
	padding: 0.55rem 1rem;
}

@media (max-width: 781px) {

	[data-collection="woocommerce/product-collection/related"] {
		margin-block-start: 3rem;
		margin-inline: auto !important;
		overflow: visible;
		width: calc(100% - 2rem) !important;
	}

	[data-collection="woocommerce/product-collection/related"] > h2.wp-block-heading {
		font-size: clamp(1.65rem, 7vw, 2rem);
		margin-block-end: 1rem !important;
		padding-inline: 0;
	}

	[data-collection="woocommerce/product-collection/related"] .wc-block-product-template {
		display: grid !important;
		gap: 0.75rem;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		overflow: visible;
		padding: 0;
	}

	[data-collection="woocommerce/product-collection/related"] .wc-block-product {
		padding: 0.5rem 0.5rem 0.75rem;
		width: 100% !important;
	}

	[data-collection="woocommerce/product-collection/related"] .wc-block-components-product-image {
		border-radius: 12px;
		margin-block-end: 0.7rem;
	}

	[data-collection="woocommerce/product-collection/related"] .wp-block-post-title,
	[data-collection="woocommerce/product-collection/related"] .wp-block-woocommerce-product-price {
		margin-inline: 0.2rem;
		text-align: left !important;
	}

	[data-collection="woocommerce/product-collection/related"] .wp-block-post-title {
		font-size: 0.9rem !important;
		line-height: 1.25;
		min-height: 2.5em;
	}

	[data-collection="woocommerce/product-collection/related"] .wp-block-woocommerce-product-price {
		font-size: 0.8rem !important;
		line-height: 1.35;
		margin-block-end: 0.6rem;
	}

}
