/* Miele Customer 360 — storefront badges and recently viewed. */
.m360-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 6px 0;
}

.m360-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	line-height: 1.5;
	background: #f5f5f5;
	color: #333;
	border: 1px solid #e6e6e6;
}

.m360-badge--bought {
	background: #f7ecee;
	color: #8c0014;
	border-color: #ecd3d8;
}

.m360-recently-viewed:empty {
	display: none;
}

.m360-rv {
	clear: both;
	margin: 32px 0;
}

.m360-rv__title {
	margin: 0 0 16px;
	font-size: 1.25em;
}

.m360-rv__list {
	display: grid;
	/* As many columns as products (4–6, set by the template), so a row fills the width. */
	grid-template-columns: repeat(var(--m360-cols, 6), minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Each card is a column: square image, name (max 3 lines), then price and button pinned
   to the bottom, so every card in a row lines up whatever the image or name length. */
.m360-rv .m360-rv__item {
	display: flex;
	flex-direction: column;
	margin: 0;
	min-width: 0;
}

.m360-rv .m360-rv__link {
	display: flex;
	flex-direction: column;
	color: inherit;
	text-decoration: none;
}

.m360-rv .m360-rv__image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	width: 100%;
	overflow: hidden;
	background: #fff;
}

.m360-rv .m360-rv__image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	margin: 0;
	object-fit: contain;
}

.m360-rv .m360-rv__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	margin-top: 10px;
	font-size: 14px;
	line-height: 1.35;
	min-height: calc(1.35em * 3);
	overflow-wrap: anywhere;
}

.m360-rv .m360-rv__price {
	display: block;
	margin-top: auto;
	padding-top: 6px;
	font-size: 14px;
	font-weight: 600;
}

.m360-rv .m360-rv__price small,
.m360-rv .m360-rv__price .woocommerce-price-suffix {
	font-weight: 400;
	font-size: 11px;
}

.m360-rp .m360-buy-again {
	display: block;
	margin-top: 10px;
}

/* One row on wider screens: the best 6 (4 on tablets) are shown; phones swipe through all. */
@media (min-width: 601px) {
	.m360-rv__list > .m360-rv__item:nth-child(n+7) {
		display: none;
	}
}

@media (min-width: 601px) and (max-width: 1100px) {
	.m360-rv__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.m360-rv__list > .m360-rv__item:nth-child(n+5) {
		display: none;
	}
}

/* Site-wide "Văzute recent" slot above the footer. */
.m360-rv-footer {
	margin: 2.5em 0 0;
	padding: 2em 0;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.m360-rv-footer:not(:has(.m360-recently-viewed:not(:empty), .m360-recently-purchased:not(:empty))) {
	display: none;
}
.m360-rp + .m360-rv,
.m360-recently-purchased:not(:empty) + .m360-recently-viewed:not(:empty) {
	margin-top: 2em;
}
.m360-rp .m360-buy-again .button {
	width: 100%;
	font-size: 13px;
	padding-left: 0.5em;
	padding-right: 0.5em;
	white-space: normal;
}

/* Phones: product rows scroll sideways instead of stacking a long column. */
@media (max-width: 600px) {
	.m360-rv-footer {
		margin-top: 1.5em;
		padding: 1.25em 0;
	}
	.m360-rv {
		margin: 20px 0;
	}
	.m360-rv__title {
		font-size: 1.1em;
		margin-bottom: 12px;
	}
	.m360-rv__list {
		grid-auto-flow: column;
		grid-template-columns: none;
		grid-auto-columns: 42%;
		gap: 12px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 6px;
	}
	.m360-rv .m360-rv__item {
		scroll-snap-align: start;
	}
	.m360-rv .m360-rv__name {
		font-size: 13px;
	}
	.m360-rp .m360-buy-again .button {
		min-height: 44px;
	}
	.m360-badge {
		font-size: 11px;
	}
}
