/* Reusable product card (homepage merch, artist shop). */
.r3n-product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
	gap: clamp(1rem, 1.8vw, 1.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.r3n-product-grid > li { min-width: 0; margin: 0; }

.r3n-product { min-width: 0; }

.r3n-product a {
	display: block;
	color: var(--color-base-content, CanvasText) !important;
	text-decoration: none !important;
}

.r3n-product-media {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	overflow: hidden;
	border: 1px solid var(--color-base-300, #e5e5e5);
	border-radius: .35rem;
	background: #fff;
}

.r3n-product-img {
	display: block;
	width: 100%;
	height: 100%;
	padding: .5rem;
	object-fit: contain;
	transition: opacity .35s ease;
}

/* Second photo sits on top and fades in on hover or keyboard focus. */
.r3n-product-img--alt {
	position: absolute;
	inset: 0;
	opacity: 0;
}

.r3n-product--swap a:is(:hover, :focus-visible) .r3n-product-img--alt { opacity: 1; }
.r3n-product--swap a:is(:hover, :focus-visible) .r3n-product-img:not(.r3n-product-img--alt) { opacity: 0; }

.r3n-product-placeholder { font-size: 2rem; opacity: .4; }

.r3n-product-sale {
	position: absolute;
	inset-block-start: .5rem;
	inset-inline-start: .5rem;
	z-index: 1;
	padding: .15rem .45rem;
	border-radius: .25rem;
	background: #ff0086;
	color: #fff;
	font-size: .68rem;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.r3n-product-title {
	display: -webkit-box;
	margin: .65rem 0 0;
	overflow: hidden;
	font: inherit;
	font-size: .85rem;
	font-weight: 650;
	line-height: 1.3;
	overflow-wrap: anywhere;
	transition: color .15s ease;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.r3n-product a:hover .r3n-product-title { color: #ff0086; }

.r3n-product-price { margin: .3rem 0 0; font-size: 1rem; font-weight: 800; }
.r3n-product-price del { margin-right: .35em; opacity: .6; font-size: .8rem; font-weight: 500; }
.r3n-product-price ins { color: #ff0086; text-decoration: none; }

.r3n-product a:focus-visible { outline: 2px solid #ff0086; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
	.r3n-product-img, .r3n-product-title { transition: none; }
}
