/* =========================================================
   Product Card
   ========================================================= */

.product-card {
	--product-card-radius: 4px;
	--product-card-badge-radius: 4px;
	--product-card-text: #4c4d4f;
	--product-card-line: #d6baeb;
	--product-card-score: #4b5563;
	--product-card-price: #626b74;
	--product-card-star-empty: #d8d8d8;
	--product-card-star-filled: #383e44;

	background: #fff;
	border-radius: var(--product-card-radius);
	border: 1px solid transparent;
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
	.product-card:hover {
		box-shadow:
			0 8px 5px rgba(0, 0, 0, 0.1),
			0 20px 12.5px rgba(0, 0, 0, 0.1);
	}
}

/* ---- Image area --------------------------------------- */

.product-card__image-link {
	display: block;
	text-decoration: none;
}

.product-card__image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: var(--product-card-radius);
	overflow: hidden;
	background: #f7f7f7;
	margin-bottom: 8px;
}

.product-card__image-stack {
	position: relative;
	width: 100%;
	height: 100%;
}

.product-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.product-card__image--default {
	position: relative;
	z-index: 0;
	transition: opacity 0.2s ease;
}

.product-card__image--hover {
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0;
	transition: opacity 0.45s ease;
}

@media (hover: hover) {
	.product-card--has-hover-image:hover .product-card__image--default {
		opacity: 0;
	}

	.product-card--has-hover-image:hover .product-card__image--hover {
		opacity: 1;
	}
}

.product-card__image-placeholder {
	width: 100%;
	height: 100%;
	background: #efefef;
}

/* ---- Badge (white chip, top-left of image) ------------ */

.product-card__badge {
	position: absolute;
	top: 4px;
	left: 4px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	background: #fff;
	border-radius: var(--product-card-badge-radius);
	padding: 0 8px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.25rem;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--product-card-text);
	white-space: nowrap;
	box-shadow: none;
	transition: box-shadow 0.2s ease;
}

@media (hover: hover) {
	.product-card:hover .product-card__badge {
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
	}
}

/* ---- Body --------------------------------------------- */

.product-card__body {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 0 8px 16px;
	flex: 1;
}

/* ---- Info: title + product line ----------------------- */

.product-card__info {
	display: flex;
	flex-direction: column;
	min-height: 5rem;
}

.product-card__title-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.product-card__title {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.25rem;
	text-transform: uppercase;
	color: var(--product-card-text);
}

@media (hover: hover) {
	.product-card__title-link:hover .product-card__title {
		text-decoration: underline;
	}
}

.product-card__line {
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.25rem;
	text-transform: uppercase;
	color: var(--product-line-color, var(--product-card-text));
}

/* ---- Benefits ----------------------------------------- */

.product-card__benefits {
	display: flex;
	flex-direction: column;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.25rem;
	color: var(--product-card-text);
	min-height: 2.5rem;
}

.product-card__benefit-line {
	display: block;
}

/* ---- Stars + price ------------------------------------ */

.product-card__review-price {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-top: auto;
}

.product-card__stars-row {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 28px;
	padding: 1.5px 0;
}

/*
 * Two-layer star widget using assets/svgs/star.svg inlined via PHP.
 * Grey layer underneath, gold layer on top clipped to (score/5 * 100%) width.
 */
.product-card__stars {
	position: relative;
	display: inline-flex;
	line-height: 1;
}

.product-card__stars-empty,
.product-card__stars-filled {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0;
	line-height: 1;
}

.product-card__stars svg {
	width: 14px;
	height: 14px;
	display: block;
	flex-shrink: 0;
}

.product-card__stars-empty {
	color: var(--product-card-star-empty);
}

.product-card__stars-filled {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	color: var(--product-card-star-filled);
}

.product-card__score {
	font-size: 0.875rem;
	color: var(--product-card-score);
	line-height: 1;
}

/* ---- Price -------------------------------------------- */

.product-card__price {
	display: block;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.75rem;
	color: var(--product-card-price);
}

/* ---- Listing CTA -------------------------------------- */

.product-card__cta {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	width: 100%;
	margin-top: auto;
	padding: 0.85rem 1rem;
	border: 1px solid #1a2340;
	border-radius: 0.5rem;
	background: #fff;
	color: #1a2340;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	text-decoration: none;
}

.product-card__cta::before {
	content: "";
	position: absolute;
	top: -1px;
	right: -1px;
	bottom: -1px;
	left: -1px;
	background: #1a2340;
	transition: transform 0.25s ease;
	transform: translateX(-100%);
}

.product-card__cta-label {
	position: relative;
	z-index: 1;
	transition: color 0.25s ease;
}

@media (hover: hover) {
	.product-card__cta:hover::before {
		transform: translateX(0);
	}

	.product-card__cta:hover {
		color: #fff;
	}

	.product-card__cta:hover .product-card__cta-label {
		color: #fff;
	}
}

.product-card__cta:focus-visible::before {
	transform: translateX(0);
}

.product-card__cta:focus-visible {
	color: #fff;
	outline: 2px solid #1a2340;
	outline-offset: 2px;
}

.product-card__cta:focus-visible .product-card__cta-label {
	color: #fff;
}
