/*
 * Product card — shared by the home bestsellers carousel and the shop grid.
 * Lives on its own because both pages load it; keep it free of anything
 * page-specific (sizing for a carousel item vs a grid cell is a modifier).
 */

.product-card {
	display: flex;
	flex: 0 0 245px;
	flex-direction: column;
	align-items: center;
	padding: 24px 16px 18px;
	border-radius: 4px;
	background: var(--color-white);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
	text-align: center;
}

.product-card__image {
	display: grid;
	place-items: center;
	width: 100%;
	height: 130px;
	margin-bottom: 14px;
}

.product-card__image img {
	display: block;
	max-width: 100%;
	max-height: 130px;
	width: auto;
	object-fit: contain;
}

.product-card__meta {
	margin: 0 0 6px;
	font-family: var(--font-display);
	font-size: 13px;
	font-weight: 600;
	color: var(--color-primary);
}

.product-card__name {
	margin: 0 0 4px;
	font-family: var(--font-display);
	font-size: var(--fs-body);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.product-card__name a {
	color: inherit;
	text-decoration: none;
}

.product-stars {
	display: inline-flex;
	gap: 1px;
	margin-bottom: 8px;
}

.product-stars svg {
	width: 18px;
	height: 18px;
	fill: #f8be00;
}

.product-stars svg.is-off {
	fill: #d9d9d9;
}

.product-stars svg.is-half {
	fill: #d9d9d9;
}

.product-stars svg.is-half .product-stars__half {
	fill: #f8be00;
	clip-path: inset(0 50% 0 0);
}

.product-card__price {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 700;
}

.product-card__buy {
	margin-top: auto;
	padding: 9px 18px;
	border: 0;
	border-radius: 3px;
	background: #1a1a1a;
	color: var(--color-white);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.product-card__buy:hover,
.product-card__buy:focus-visible {
	background: #000;
}

@media (max-width: 599px) {
	.product-card {
		flex-basis: 200px;
		padding: 18px 12px 16px;
	}

	.product-card__image {
		height: 110px;
	}

	.product-card__image img {
		max-height: 110px;
	}
}

/* Diagonal SALE ribbon across the card's top-left corner. The card clips it,
   so the strip can run past the corner and still read as a folded band. */
.product-card {
	position: relative;
	overflow: hidden;
}

.product-card__ribbon {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	z-index: 2;
	width: 116px;
	height: 116px;
	pointer-events: none;
}

.product-card__ribbon span {
	position: absolute;
	inset-block-start: 26px;
	inset-inline-start: -34px;
	width: 150px;
	padding: 5px 0;
	background: #e0102b;
	color: #fff;
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-align: center;
	text-transform: uppercase;
	transform: rotate(-45deg);
}

/* Parts shared by every card, wherever it appears. Keeping these out of a
   page stylesheet matters: shop.css does not load on product pages, so a card
   rule living there renders unstyled in the recommendation carousels. */

.product-card__brand {
	margin: 0 0 2px;
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-text-muted);
}

.product-card__brand a {
	color: inherit;
	text-decoration: none;
}

.product-card__brand a:hover {
	color: var(--color-primary);
}

.product-card__price del {
	margin-inline-end: 6px;
	color: var(--color-text-muted);
	font-weight: 500;
}

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

.product-card__cta {
	margin-block-start: auto;
	padding-block-start: 12px;
	width: 100%;
}

/* Quick Buy is a <button> on the home page and an <a> in the carousels. */
a.product-card__buy {
	display: inline-block;
	text-decoration: none;
}
