/**
 * Product Card — visual styles.
 *
 * @package PasionGift_App
 */

.pg-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
}

.pg-product-card__selection {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 1px solid var(--pg-color-border-subtle);
	border-radius: var(--pg-radius-full, 999px);
	background-color: var(--pg-color-surface);
	color: var(--pg-color-text);
	cursor: pointer;
	box-shadow: var(--pg-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
}

.pg-product-card__selection:focus-visible {
	outline: 2px solid var(--pg-color-brand-wine, var(--pg-color-accent));
	outline-offset: 2px;
}

.pg-product-card__selection[aria-pressed="true"] {
	color: var(--pg-color-brand-wine, var(--pg-color-accent));
	border-color: color-mix(in srgb, var(--pg-color-brand-wine, var(--pg-color-accent)) 35%, var(--pg-color-border-subtle));
}

.pg-product-card__selection[aria-pressed="true"] .pg-product-card__selection-icon path {
	fill: currentColor;
}

.pg-product-card__selection-icon {
	display: inline-flex;
	pointer-events: none;
}

.pg-product-card__selection-icon svg {
	display: block;
}

.pg-product-card__link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	height: 100%;
	text-decoration: none;
	color: inherit;
	border-radius: var(--pg-card-radius);
	overflow: hidden;
	border: 1px solid var(--pg-color-border-subtle);
	background-color: var(--pg-color-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pg-product-card__link:hover {
	border-color: var(--pg-color-border);
	box-shadow: var(--pg-shadow-md);
}

.pg-product-card__link:focus-visible {
	outline: 2px solid var(--pg-color-accent);
	outline-offset: 2px;
}

.pg-product-card__media {
	flex-shrink: 0;
	position: relative;
	aspect-ratio: var(--pg-product-media-ratio);
	background-color: var(--pg-color-interactive-bg);
	overflow: hidden;
}

.pg-product-card__badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	max-width: calc(100% - 1rem);
	padding: 0.1875rem 0.5rem;
	border-radius: var(--pg-radius-pill, 999px);
	font-family: var(--pg-font-family);
	font-size: 0.625rem;
	font-weight: var(--pg-font-weight-semibold);
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pg-product-card__badge--sale {
	background-color: var(--pg-color-accent);
	color: #fff;
}

.pg-product-card__badge--featured {
	background-color: var(--pg-color-surface);
	color: var(--pg-color-text);
	border: 1px solid var(--pg-color-border-subtle);
}

.pg-product-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pg-product-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background-color: var(--pg-color-interactive-bg);
}

.pg-product-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.125rem;
	padding: var(--pg-card-padding-compact);
	min-height: var(--pg-product-body-min-height);
	min-width: 0;
}

.pg-product-card__title {
	flex: 0 1 auto;
	margin: 0;
	font-family: var(--pg-font-family);
	font-size: var(--pg-type-product-name);
	font-weight: var(--pg-font-weight-medium);
	line-height: var(--pg-line-height-snug);
	color: var(--pg-color-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pg-product-card__benefit {
	flex: 1 1 auto;
	margin: 0;
	font-family: var(--pg-font-family);
	font-size: var(--pg-font-size-xs);
	font-weight: var(--pg-font-weight-regular);
	line-height: var(--pg-line-height-snug);
	color: var(--pg-color-text-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pg-product-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.125rem 0.25rem;
	flex-shrink: 0;
	max-width: 100%;
	margin-top: auto;
	font-family: var(--pg-font-family);
	font-size: var(--pg-type-product-price);
	font-weight: var(--pg-font-weight-semibold);
	line-height: var(--pg-line-height-tight);
	color: var(--pg-color-accent);
}

.pg-product-card__price .amount {
	font-weight: inherit;
}

.pg-product-card__price del {
	color: var(--pg-color-text-muted);
	font-size: var(--pg-font-size-xs);
	font-weight: var(--pg-font-weight-medium);
	line-height: var(--pg-line-height-tight);
}

.pg-product-card__price ins {
	text-decoration: none;
	line-height: var(--pg-line-height-tight);
}

@media (max-width: 359px) {
	.pg-product-card__price {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.0625rem;
		line-height: 1.15;
	}

	.pg-product-card__price del {
		font-size: 0.625rem;
	}
}

@media (min-width: 360px) {
	.pg-product-card__price {
		flex-direction: row;
		flex-wrap: wrap;
	}
}
