/*
 * Product page: «Похожие» (related) and up-sells as a wide showcase, same geometry as the catalog grid:
 * full-width white band, grid up to 1632px with 64px side fields, 4 per row (2 below 1025px), 3:4 image tiles.
 * The main product block above is not touched.
 */

body.single-product #page {
	overflow-x: clip; /* the band below is 100vw wide */
}

/* Solid white page (like the catalog), so the full-width band does not cut through a grey frame. */
body.single-product,
body.single-product.ast-separate-container,
body.single-product #content {
	background-color: #fff;
}

body.single-product div.product > section.related.products,
body.single-product div.product > section.up-sells.products {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: 0;
	padding: 56px 64px 72px;
	box-sizing: border-box;
	background: #fff;
	clear: both;
}

body.single-product section.related.products > h2,
body.single-product section.up-sells.products > h2,
body.single-product section.related.products > ul.products,
body.single-product section.up-sells.products > ul.products {
	max-width: 1632px;
	margin-left: auto;
	margin-right: auto;
}

body.single-product section.related.products > h2,
body.single-product section.up-sells.products > h2 {
	margin-top: 0;
	margin-bottom: 32px;
	font-size: clamp(26px, 2.2vw, 40px);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* grid */
body.single-product section.related.products ul.products,
body.single-product section.up-sells.products ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	column-gap: 20px !important;
	row-gap: 40px !important;
	padding: 0;
}

body.single-product section.related.products ul.products::before,
body.single-product section.related.products ul.products::after,
body.single-product section.up-sells.products ul.products::before,
body.single-product section.up-sells.products ul.products::after {
	display: none !important;
}

body.single-product section.related.products ul.products li.product,
body.single-product section.up-sells.products ul.products li.product {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	clear: none !important;
	display: flex;
	flex-direction: column;
}

/* 3:4 image tile, whole photo visible */
body.single-product section.related.products li.product .astra-shop-thumbnail-wrap,
body.single-product section.up-sells.products li.product .astra-shop-thumbnail-wrap {
	position: relative;
	margin: 0 0 14px;
	background: #f4f4f4;
	aspect-ratio: 3 / 4;
	overflow: hidden;
}

body.single-product section.related.products li.product .astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link,
body.single-product section.up-sells.products li.product .astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

body.single-product section.related.products li.product .astra-shop-thumbnail-wrap img,
body.single-product section.up-sells.products li.product .astra-shop-thumbnail-wrap img {
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 8%;
	box-sizing: border-box;
	object-fit: contain;
	mix-blend-mode: multiply;
	transition: transform 0.35s ease;
}

body.single-product section.related.products li.product:hover .astra-shop-thumbnail-wrap img,
body.single-product section.up-sells.products li.product:hover .astra-shop-thumbnail-wrap img {
	transform: scale(1.03);
}

/* card text — same as catalog */
body.single-product section.related.products li.product .astra-shop-summary-wrap,
body.single-product section.up-sells.products li.product .astra-shop-summary-wrap {
	padding: 0;
	text-align: left;
}

body.single-product section.related.products li.product .woocommerce-loop-product__title,
body.single-product section.up-sells.products li.product .woocommerce-loop-product__title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: 0.02em;
}

body.single-product section.related.products li.product .pcm-loop-collection,
body.single-product section.up-sells.products li.product .pcm-loop-collection {
	margin: 0 0 6px;
	font-size: 12px;
}

body.single-product section.related.products li.product .price,
body.single-product section.up-sells.products li.product .price {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

body.single-product section.related.products li.product .pcm-stock,
body.single-product section.up-sells.products li.product .pcm-stock {
	font-size: 12px;
}

/* tablet: 2 per row */
@media (max-width: 1024px) {
	body.single-product div.product > section.related.products,
	body.single-product div.product > section.up-sells.products {
		padding: 48px 32px 56px;
	}

	body.single-product section.related.products ul.products,
	body.single-product section.up-sells.products ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

/* mobile: 2 per row */
@media (max-width: 767px) {
	body.single-product div.product > section.related.products,
	body.single-product div.product > section.up-sells.products {
		padding: 40px 20px 48px;
	}

	body.single-product section.related.products > h2,
	body.single-product section.up-sells.products > h2 {
		margin-bottom: 20px;
	}

	body.single-product section.related.products ul.products,
	body.single-product section.up-sells.products ul.products {
		column-gap: 12px !important;
		row-gap: 28px !important;
	}

	body.single-product section.related.products li.product .woocommerce-loop-product__title,
	body.single-product section.up-sells.products li.product .woocommerce-loop-product__title {
		font-size: 13px;
	}

	body.single-product section.related.products li.product .price,
	body.single-product section.up-sells.products li.product .price {
		font-size: 14px;
	}
}
