/**
 * Product card component.
 *
 * Shared by the Custom Shop section, product archives and the Related Products
 * section. Figma card frame 1:269 — 301×421, 12px radius, #f2f2f2 surface.
 */

.product-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 26.3125rem; /* 421px — desktop frame */
	padding: 0.75rem; /* 12px — Figma card inset */
	border: 1px solid transparent;
	border-radius: 0.75rem;
	background: var(--color-neutral-100);
	color: inherit;
	text-decoration: none;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.product-card__link:hover,
.product-card__link:focus-visible {
	outline: none;
	border-color: var(--color-neutral-950);
}

.product-card__link:hover .product-card__action,
.product-card__link:focus-visible .product-card__action {
	opacity: 1;
}

.product-card__media {
	position: relative;
	margin-bottom: var(--space-md);
	border-radius: 0.3125rem;
	overflow: hidden;
	background: #cecece; /* Default when no product image. */
}

.product-card__image,
.product-card__placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 278 / 238;
	object-fit: cover;
}

.product-card__placeholder {
	background: #cecece;
}

.product-card__badge {
	position: absolute;
	top: 0.625rem;
	left: 0.625rem;
	padding: 0.3125rem 0.6875rem;
	border-radius: 0.65625rem;
	background: var(--color-neutral-950);
	color: #ffffff;
	font-size: 0.625rem;
	font-weight: var(--font-weight-regular);
	line-height: 1.3;
	letter-spacing: 0.0625em;
	text-transform: uppercase;
}

.product-card__title {
	margin: 0;
	padding-inline: 0.25rem;
	color: #242424;
	font-size: 1.125rem;
	font-weight: var(--font-weight-regular);
	line-height: 1.3;
}

.product-card__price {
	margin: auto 0 0;
	padding-top: var(--space-sm); /* 12px minimum above the price */
	padding-inline: 0.25rem;
	color: var(--color-brand-primary);
	font-size: 1rem;
	font-weight: var(--font-weight-bold);
	line-height: 1.3;
	text-align: right;
}

.product-card__price .woocommerce-Price-amount {
	color: inherit;
}

.product-card__price .woocommerce-price-suffix {
	display: inline-block;
	margin-left: 0.35em;
	color: inherit;
	font-size: 0.75em;
	font-weight: var(--font-weight-regular);
	line-height: 1.3;
	opacity: 0.75;
}

.product-card__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	gap: var(--btn-pill-gap);
	margin-top: var(--space-sm);
	padding: 0.625rem 1rem;
	border-radius: 0.5rem;
	background: var(--color-neutral-950);
	opacity: 0;
	color: #ffffff;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.49;
	letter-spacing: 0.0625em;
	transition: opacity 0.2s ease;
}

.product-card__action-icon {
	flex-shrink: 0;
	display: block;
	width: 1.125rem;
	height: 1.125rem;
	transform: rotate(var(--btn-pill-icon-rotate, 135deg));
	filter: brightness(0) invert(1);
	transition: transform var(--btn-pill-slide-duration, 0.45s) var(--btn-pill-slide-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.product-card:hover .product-card__action-icon,
.product-card:focus-within .product-card__action-icon {
	transform: rotate(var(--btn-pill-icon-rotate-hover, 90deg));
}

/*
 * Touch layouts have no hover, so the CTA stays visible.
 * Drop the 421px frame so the title-to-price gap stays 12px
 * unless a grid row stretches to match a taller neighbour.
 */
@media (max-width: 64rem), (hover: none) {
	.product-card__link {
		min-height: 0;
	}

	.product-card__action {
		opacity: 1;
	}
}
