/*
 * The product card. Site-wide — it renders in the home page's rails and
 * lookbook, and on the shop and category archives once those exist.
 *
 * Sampled from the reference: serif name at 18px, sans price at 18px, both
 * centred under a square photograph with a row of colour dots between them.
 */

.product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	text-align: center;
}

/*
 * Saved items. Sits over the photograph's top-right corner, as the design
 * draws it — outside the photo's <a> so that clicking it never navigates.
 */
.product-card__save {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-end: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-ink);
	cursor: pointer;
}

.product-card__save .icon {
	width: 21px;
	height: 21px;
}

.product-card__save[aria-pressed="true"] .icon {
	fill: var(--color-ink);
}

.product-card__save:hover .icon {
	transform: scale(1.08);
}

.product-card__photo {
	position: relative;
	display: block;
	/* The catalogue's photography is square and shot on white; the card keeps
	   that rather than cropping to a shape of its own. */
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--product-card-bg);
}

.product-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

@media (hover: hover) {
	.product-card__photo:hover .product-card__image {
		transform: scale(1.03);
	}
}

/* One badge, never two — see homeware_product_badge(). */
.product-card__badge {
	position: absolute;
	z-index: 1;
	padding: 4px 9px;
	color: var(--color-white);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
}

/* Both sit in the same top-left slot; only one is ever drawn — see
   homeware_product_badge(). */
.product-card__badge--sale,
.product-card__badge--new {
	inset-block-start: 12px;
	inset-inline-start: 0;
}

.product-card__badge--sale {
	background: var(--color-accent);
}

.product-card__badge--new {
	background: var(--color-navy);
}

.product-card__swatches {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

/*
 * A ring, not a filled dot: the catalogue has no colour values yet, so the
 * swatch says "this comes in more than one finish" and the product page says
 * which. When real swatch images land, this is the rule that gets a
 * background-image.
 */
.product-card__swatch {
	width: 18px;
	height: 18px;
	border: 1px solid var(--color-ink);
	border-radius: 50%;
	background: var(--color-surface);
}

.product-card__title {
	margin: 11px 0 0;
	font-family: var(--font-heading);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.3;
}

.product-card__title a {
	color: var(--color-ink);
	text-decoration: none;
}

.product-card__title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.product-card__price {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 5px 0 0;
	font-size: 17px;
	line-height: 1.35;
}

/*
 * The design prints both figures plain, side by side — no strikethrough. The
 * discounted one is the one that matters, so it takes the ink and the full
 * price steps back to the muted grey.
 */
.product-card__was {
	color: var(--color-text-muted);
}

.product-card__now {
	color: var(--color-ink);
}

/* WooCommerce renders a price range as `del`/`ins`; keep it in the same key. */
.product-card__price del {
	color: var(--color-text-muted);
	text-decoration: none;
}

.product-card__price ins {
	background: none;
	color: var(--color-ink);
	text-decoration: none;
}

@media (max-width: 899px) {
	.product-card__title,
	.product-card__price {
		font-size: 15px;
	}

	.product-card__swatch {
		width: 16px;
		height: 16px;
	}
}
