/*
 * Product card — exact replication of the Figma browse frame.
 *
 * Every number below came out of the prototype's Browse.dc.html, which was
 * itself decoded from the .fig archive. Treat them as specification: this card
 * is the single most repeated component on the site, and a 2px drift here is
 * visible across every grid on the storefront.
 *
 * @package Uloominate
 */

.ulm-pcard {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 390px;
	background: var(--ulm-surface);
	border: 1px solid var(--ulm-border);
	border-radius: 12px;
	overflow: hidden;
	transition:
		transform .22s cubic-bezier(.2, .7, .3, 1),
		box-shadow .22s ease,
		border-color .22s ease;
}

.ulm-pcard:hover {
	transform: translateY(-4px);
	box-shadow: 0 1px 2px rgba(18, 18, 18, .04), 0 18px 36px -20px rgba(41, 72, 60, .42);
	border-color: var(--ulm-border-strong);
}

/* ------------------------------------------------------------- media -- */

.ulm-pcard__media {
	position: relative;
	width: 100%;
	/* Not 4:3 — the frame draws 338 x 220. */
	aspect-ratio: 338 / 220;
	background: var(--ulm-surface-alt);
	overflow: hidden;
}

.ulm-pcard__media > a {
	display: block;
	width: 100%;
	height: 100%;
}

.ulm-pcard__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* --- badge: gold for a discount, green for free ---------------------- */

.ulm-pcard__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: var(--ulm-fw-semibold);
	line-height: 16px;
}

.ulm-pcard__badge--discount {
	background: var(--ulm-gold);
	color: var(--ulm-deep);
}

.ulm-pcard__badge--free {
	background: var(--ulm-primary);
	color: var(--ulm-ink-invert);
}

/* --- wishlist -------------------------------------------------------- */

.ulm-pcard__wish {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 18px;
	background: var(--ulm-surface);
	color: var(--ulm-ink-faint);
	box-shadow: 0 2px 8px rgba(18, 18, 18, .14);
	cursor: pointer;
	transition: transform .18s ease, color .18s ease;
}

.ulm-pcard__wish:hover {
	transform: scale(1.08);
	color: var(--ulm-danger);
}

.ulm-pcard__wish[aria-pressed="true"] {
	color: var(--ulm-danger);
}

.ulm-pcard__wish[aria-pressed="true"] svg {
	fill: currentColor;
}

/* -------------------------------------------------------------- body -- */

.ulm-pcard__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
}

.ulm-pcard__heading {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
}

.ulm-pcard__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	/* Reserves two lines so a one-line title does not shorten its card. */
	min-height: 48px;
	font-family: var(--ulm-font);
	font-weight: var(--ulm-fw-semibold);
	font-size: 16px;
	line-height: 1.5;
	/* Body ink, not heading green — the frame is explicit about this. */
	color: var(--ulm-ink);
	transition: color .16s ease;
}

.ulm-pcard__title:hover {
	color: var(--ulm-primary);
}

.ulm-pcard__vendor {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: var(--ulm-fw-regular);
	font-size: 14px;
	line-height: 21px;
	color: var(--ulm-ink);
	transition: color .16s ease;
}

.ulm-pcard__vendor:hover {
	color: var(--ulm-primary);
}

/* ------------------------------------------------------------ rating -- */

.ulm-rating {
	display: flex;
	align-items: center;
	gap: 4px;
}

.ulm-rating__stars {
	display: flex;
	gap: 2px;
	line-height: 0;
}

.ulm-rating__count {
	font-family: var(--ulm-font-numeric);
	font-size: 12px;
	line-height: 16px;
	color: var(--ulm-ink-faint);
}

/* ------------------------------------------------------------ footer -- */

.ulm-pcard__footer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 16px 16px;
}

.ulm-pcard__price {
	font-family: var(--ulm-font-numeric);
	font-weight: var(--ulm-fw-bold);
	font-size: 16px;
	line-height: 21px;
	color: var(--ulm-ink-alt);
}

.ulm-pcard__was {
	font-family: var(--ulm-font-numeric);
	font-weight: var(--ulm-fw-regular);
	font-size: 13px;
	line-height: 17px;
	color: var(--ulm-ink-faint);
}

.ulm-pcard__add {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	/* Pushed to the trailing edge, away from the price. */
	margin-inline-start: auto;
	height: 32px;
	padding: 0 12px;
	border: 1px solid var(--ulm-border-strong);
	border-radius: 8px;
	background: var(--ulm-surface);
	color: var(--ulm-primary);
	font-family: var(--ulm-font);
	font-size: 13px;
	font-weight: var(--ulm-fw-semibold);
	cursor: pointer;
	white-space: nowrap;
	transition: background .16s ease, border-color .16s ease;
}

.ulm-pcard__add:hover {
	background: var(--ulm-tint-mint);
	border-color: var(--ulm-primary);
}

.ulm-pcard__add[disabled] {
	opacity: .6;
	cursor: not-allowed;
}
