/**
 * Product card — image, brand, title, stock, price, CTA.
 * Brand color: Dinbunad #861d1d.
 */

.rr-product-card {
	/* Dinbunad — sass/custom/variables.scss */
	--color-brand: #861d1d;
	--color-brand-hover: #6e1717;
	--color-ink: #11100f;
	--color-sale: #861d1d;
	--color-stock: #16a34a;
	--color-border: #d8d2cb;
	--color-text-muted: #5c5752;
	--transition-fast: 150ms ease;
	/* GFS Didot — same as sass/custom/variables.scss ($body-font / $header-font) */
	--font-family: "GFS Didot", sans-serif;

	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: transparent;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: none;
	font-family: var(--font-family);
	transition:
		box-shadow var(--transition-fast),
		border-color var(--transition-fast);
}

.rr-product-card:hover {
	box-shadow: none;
	border-color: #c4bdb4;
}

.rr-product-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: transparent;
	border-radius: 12px 12px 0 0;
	border-bottom: 1px solid var(--color-border);
}

.rr-product-card__media-link {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 1rem;
	box-sizing: border-box;
}

.rr-product-card__image {
	position: relative;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: contain !important;
	object-position: center center !important;
	padding: 0 !important;
	margin: 0 auto !important;
	box-sizing: border-box;
	border: 0;
	background: transparent;
}

.rr-product-card__placeholder {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	background: transparent;
}

.rr-product-card__badges {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-start;
}

.rr-product-card__badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
}

.rr-product-card__badge--sale {
	background: var(--color-sale);
	letter-spacing: 0.02em;
}

.rr-product-card__badge--new {
	background: #0c0c0d;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.rr-product-card__badge--label {
	background: var(--color-brand);
	font-size: 0.6875rem;
	font-weight: 600;
}

.rr-product-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem 1rem 1.125rem;
	flex: 1 1 auto;
}

.rr-product-card__brand {
	display: block;
	min-height: 1.05rem;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.05rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-brand);
}

.rr-product-card__title {
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.3;
	color: var(--color-ink);
	text-decoration: none;
	min-height: 2.6em;
}

.rr-product-card__title:hover,
.rr-product-card__title:focus-visible {
	color: var(--color-brand);
	text-decoration: none;
}

.rr-product-card__stock {
	display: flex;
	align-items: center;
	gap: 0.4375rem;
	font-size: 0.75rem;
	color: var(--color-text-muted);
}

.rr-product-card__stock-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--color-stock);
}

.rr-product-card__stock--low .rr-product-card__stock-dot {
	background: var(--color-sale);
}

.rr-product-card__stock--out .rr-product-card__stock-dot {
	background: #b0aaa2;
}

.rr-product-card__price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.625rem;
	margin-top: 0.25rem;
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1.1;
	color: var(--color-ink);
	background: transparent !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
}

.rr-product-card__price .amount,
.rr-product-card__price .woocommerce-Price-amount,
.rr-product-card__price .woocommerce-Price-currencySymbol {
	font-weight: inherit;
	color: inherit !important;
	background: transparent !important;
}

.rr-product-card__price.is-sale,
.rr-product-card__price.is-sale .amount,
.rr-product-card__price.is-sale .woocommerce-Price-amount,
.rr-product-card__price:has(ins),
.rr-product-card__price:has(ins) .amount {
	color: var(--color-brand) !important;
}

.rr-product-card__price ins {
	order: 1;
	text-decoration: none;
	color: inherit;
	background: transparent !important;
}

.rr-product-card__price del {
	order: 2;
	font-size: 0.875rem;
	font-weight: 400;
	color: #a8a29b !important;
	text-decoration: line-through;
	background: transparent !important;
	opacity: 1;
}

.rr-product-card__price del .amount {
	color: inherit !important;
	font-weight: inherit;
}

/* Beat WooCommerce / theme `.button` chrome on product cards. */
.rr-product-card__add,
.woocommerce .rr-product-card a.rr-product-card__add,
.woocommerce a.button.rr-product-card__add,
.woocommerce-page a.button.rr-product-card__add,
.woocommerce .mint-shop a.button.rr-product-card__add {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	margin-top: auto;
	padding: 0.75rem 0.875rem !important;
	border: none !important;
	border-radius: 8px !important;
	background: var(--color-ink) !important;
	color: #fff !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.01em;
	line-height: 1.2 !important;
	text-decoration: none !important;
	text-align: center;
	box-shadow: none !important;
	transition: background-color var(--transition-fast);
}

.rr-product-card__add:hover,
.rr-product-card__add:focus-visible,
.woocommerce .rr-product-card a.rr-product-card__add:hover,
.woocommerce .rr-product-card a.rr-product-card__add:focus-visible,
.woocommerce a.button.rr-product-card__add:hover,
.woocommerce-page a.button.rr-product-card__add:hover {
	background: var(--color-brand) !important;
	color: #fff !important;
}

.rr-product-card__add-icon {
	font-size: 1rem;
	line-height: 1;
}

/* Avoid WC product float/width rules on card articles. */
.woocommerce .mint-shop .rr-product-card.product,
.woocommerce-page .mint-shop .rr-product-card.product,
.woocommerce .products .rr-product-card.product {
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	max-width: none !important;
}

/* Kill leftover Woo / theme chrome when nested incorrectly. */
.mint-shop .products .mint-shop__item > .woocommerce-LoopProduct-link,
.mint-shop .products .mint-shop__item > .onsale,
.mint-shop .products .mint-shop__item > .button,
.mint-shop .products .mint-shop__item > .price,
.mint-shop .products .mint-shop__item > .woocommerce-loop-product__title,
.mint-shop .products .mint-shop__item > .variant-prices,
.mint-shop .products .mint-shop__item > .add-to-cart-button {
	display: none !important;
}
