/* Recommendations on the product page (src/Reco/Front.php). The blocks keep their height while they load, so the
   page doesn't jump; an empty answer hides them. */

.wb-reco[hidden] {
	display: none !important;
}
.wb-reco--similar {
	min-height: 560px;
	margin-top: 60px;
}
.wb-reco--style {
	min-height: 480px;
	margin-top: 60px;
}
/* "Recently viewed": one row of 4; shown only once her history has other products. */
.wb-reco--viewed {
	min-height: 480px;
	margin-top: 60px;
}
.wb-reco__heading:empty {
	min-height: 1.4em;
}

/* The PLP's cached cards, in a grid: 4 across on desktop ("Style it with" one row, "Similar styles" two). */
.wb-reco--grid .wb-reco__list,
.wb-reco--cart .wb-reco__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.wb-reco--grid .wb-reco__list > li.product,
.wb-reco--cart .wb-reco__list > li.product {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
}

/* Tablets and phones: one row that scrolls sideways, two cards in view. */
@media (max-width: 1024px) {
	.wb-reco--style,
	.wb-reco--similar,
	.wb-reco--viewed {
		min-height: 460px;
		margin-top: 40px;
	}
	.wb-reco--grid .wb-reco__list,
	.wb-reco--cart .wb-reco__list {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 42%; /* the next card peeks in: the row says it scrolls */
		gap: 15px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.wb-reco--grid .wb-reco__list::-webkit-scrollbar,
	.wb-reco--cart .wb-reco__list::-webkit-scrollbar {
		display: none;
	}
	.wb-reco--grid .wb-reco__list > li.product,
	.wb-reco--cart .wb-reco__list > li.product {
		scroll-snap-align: start;
	}
}

/* The cart page's block (in place of the theme's cross-sells): the shop's cards, four across in the cart's column, a
   little tighter than the product page's rows; the sideways row on tablets and phones, as above. */
.wb-reco--cart {
	margin-top: 40px;
	max-width: 100%;
	overflow: hidden; /* never under the totals sidebar */
}
.wb-reco--cart .wb-reco__list {
	gap: 20px;
}
@media (max-width: 1024px) {
	.wb-reco--cart .wb-reco__list {
		gap: 15px;
	}
}
