/* Generated by astro-product/scripts/sync-core.mjs from packages/foundation/components/product-card. Do not edit. */
/**
 * product-card: WooCommerce product blocks (image, sale badge, stock indicator, add to cart button, title, price).
 * Measured in new-woocommerce.sketch, Shop Home V2: a 360×500 box, the photo centred in it, an 80×80 cart square in
 * the box's bottom right corner on hover, then the name (18, medium) and the price (16). Rules that win over the
 * WooCommerce block styles carry the card root as an extra class.
 * WP (the user's editor markup, no rt-* classes): a core/group with the Product card block style (theme
 * block-styles/product-card) around a surface core/group box and the product blocks; colours, type, spacing and the
 * image's ratio and padding are block settings. These rules style the HTML reference only.
 */
.rt-product-card {
	--rt-product-card-inset: 15%;
	--rt-product-card-action-size: clamp(2.75rem, 22.2%, 5rem);
	--rt-product-card-badge-offset: clamp(0.625rem, 5.5%, 1.25rem);
	--rt-product-card-bag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 8h14l-1 13H6L5 8z' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M9 8V6a3 3 0 0 1 6 0v2' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
	--rt-product-card-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 12h17M15 7l5 5-5 5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
	text-align: center;
}

.rt-product-card__media {
	position: relative;
	background: var(--rt-product-card-surface);
}

/* Product image: the photo is contained in an 18:25 box; white photo backgrounds melt into the surface. */
.rt-product-card .rt-product-card__image {
	margin: 0;
}

.rt-product-card .rt-product-card__image a {
	display: block;
}

.rt-product-card .rt-product-card__image img {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: auto;
	/* As the module's WordPress pattern: woocommerce/product-image aspectRatio 9/14 */
	aspect-ratio: 9 / 14;
	padding: var(--rt-product-card-inset);
	object-fit: contain;
	mix-blend-mode: multiply;
}

/* Sale badge (inside the image link) and out of stock badge, top left. */
.rt-product-card .rt-product-card__image .wc-block-components-product-image__inner-container {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.rt-product-card .rt-product-card__sale .wc-block-components-product-sale-badge,
.rt-product-card .rt-product-card__stock {
	position: absolute;
	inset-block-start: var(--rt-product-card-badge-offset);
	inset-inline-start: var(--rt-product-card-badge-offset);
	margin: 0;
	padding: 0.3125rem 0.625rem;
	border: 0;
	border-radius: 0;
	font-family: var(--rt-font-family-body);
	font-size: var(--rt-font-size-x-small);
	font-weight: var(--rt-font-weight-semibold);
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
}

.rt-product-card .rt-product-card__sale .wc-block-components-product-sale-badge {
	background: var(--rt-product-card-sale);
	color: var(--rt-product-card-sale-text);
	/* WooCommerce's sale badge prints its word in capitals; the stock badge keeps its case */
	text-transform: uppercase;
}

.rt-product-card .rt-product-card__stock {
	background: var(--rt-product-card-stock);
	color: var(--rt-product-card-stock-text);
}

/* Only "Out of stock" is shown; an out of stock product hides its sale badge. */
.rt-product-card .rt-product-card__stock:not(.wc-block-components-product-stock-indicator--out-of-stock) {
	display: none;
}

.rt-product-card__media:has(.rt-product-card__stock) .rt-product-card__sale {
	display: none;
}

/* Add to cart: a dark square in the corner; the label stays for screen readers (the button's aria-label names the
   product), a bag icon for products added right here, an arrow for those that open the product page. */
.rt-product-card .rt-product-card__cart {
	margin: 0;
}

.rt-product-card .rt-product-card__cart.wc-block-components-product-button .wc-block-components-product-button__button {
	position: absolute;
	inset-block-end: 0;
	inset-inline-end: 0;
	display: block;
	box-sizing: border-box;
	width: var(--rt-product-card-action-size);
	min-width: 0;
	height: auto;
	min-height: 0;
	aspect-ratio: 1;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 0;
	background: var(--rt-product-card-action);
	color: var(--rt-product-card-action-icon);
	font-size: 0;
	transition: opacity 0.2s ease;
}

.rt-product-card .screen-reader-text,
.rt-product-card .rt-product-card__cart.wc-block-components-product-button .wc-block-components-product-button__button > span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.rt-product-card .rt-product-card__cart.wc-block-components-product-button .wc-block-components-product-button__button::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 30%;
	height: 30%;
	background: currentColor;
	-webkit-mask: var(--rt-product-card-arrow) center / contain no-repeat;
	mask: var(--rt-product-card-arrow) center / contain no-repeat;
}

.rt-product-card .rt-product-card__cart.wc-block-components-product-button .ajax_add_to_cart::before {
	-webkit-mask-image: var(--rt-product-card-bag);
	mask-image: var(--rt-product-card-bag);
}

.rt-product-card .rt-product-card__cart.wc-block-components-product-button .wc-block-components-product-button__button:focus-visible {
	outline: 2px solid var(--rt-color-accent);
	outline-offset: 2px;
}

/* After adding, WooCommerce unhides its "View cart" link: a white tab beside the square, so the box keeps its size. */
.rt-product-card .rt-product-card__cart.wc-block-components-product-button .added_to_cart {
	position: absolute;
	inset-block-end: 0;
	inset-inline-end: var(--rt-product-card-action-size);
	display: flex;
	align-items: center;
	box-sizing: border-box;
	height: var(--rt-product-card-action-size);
	padding-inline: var(--rt-spacing-30);
	background: var(--rt-color-base);
	color: var(--rt-color-contrast);
	font-size: var(--rt-font-size-small);
	font-weight: var(--rt-font-weight-medium);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	white-space: nowrap;
}

/* With a mouse the square appears on hover or focus; touch screens always show it. */
@media (hover: hover) {
	.rt-product-card .rt-product-card__cart.wc-block-components-product-button .wc-block-components-product-button__button {
		opacity: 0;
	}

	.rt-product-card:hover .rt-product-card__cart.wc-block-components-product-button .wc-block-components-product-button__button,
	.rt-product-card:focus-within .rt-product-card__cart.wc-block-components-product-button .wc-block-components-product-button__button,
	.rt-product-card .rt-product-card__cart.wc-block-components-product-button:has(> span:not([hidden])) .wc-block-components-product-button__button {
		opacity: 1;
	}
}

.rt-product-card .rt-product-card__title {
	margin: 0;
	padding-block-start: 1.625rem;
	color: var(--rt-color-contrast);
	font-family: var(--rt-font-family-body);
	font-size: var(--rt-font-size-base-plus);
	font-weight: var(--rt-font-weight-medium);
	line-height: 1.3;
	letter-spacing: 0;
}

.rt-product-card .rt-product-card__title a {
	color: inherit;
	text-decoration: none;
	text-underline-offset: 0.2em;
}

.rt-product-card:hover .rt-product-card__title a,
.rt-product-card .rt-product-card__title a:focus-visible {
	text-decoration: underline;
}

.rt-product-card .rt-product-card__price {
	margin: 0;
	padding-block-start: 0.625rem;
	color: var(--rt-color-body);
	font-family: var(--rt-font-family-body);
	font-size: var(--rt-font-size-base);
	font-weight: var(--rt-font-weight-regular);
	line-height: 1.2;
}

.rt-product-card .rt-product-card__price .wc-block-components-product-price {
	margin: 0;
	font-size: inherit;
}

.rt-product-card .rt-product-card__price del {
	margin-inline-end: var(--rt-spacing-20);
	color: var(--rt-product-card-old-price);
}

.rt-product-card .rt-product-card__price ins {
	text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
	.rt-product-card .rt-product-card__cart.wc-block-components-product-button .wc-block-components-product-button__button {
		transition: none;
	}
}
