/* HamzaBG Mods - product card.
 *
 * One card, one file. Loaded on the four catalogue surfaces and on product
 * pages (related row), never on account, cart, auth or legal pages.
 *
 * Anatomy follows the escrow-storefront pattern: 16/10 art, corner badge,
 * 16px body padding, 12px rhythm, chip kicker, heavy title, oversized price,
 * full-width CTA. Colours read from the --hb-* tokens so light and dark both
 * land.
 *
 * Markup contract:
 *   <li><a class="hbg-card hbg-card-link">
 *     <span class="hbg-card-media"><img><span class="hbg-card-tag"></span></span>
 *     <span class="hbg-card-body">
 *       <span class="hbg-card-kicker"></span>
 *       <h3 class="hbg-card-title"></h3>
 *       <p class="hbg-card-desc"></p>          (optional)
 *       <span class="hbg-card-foot">
 *         <span class="hbg-card-price"></span>
 *         <span class="hbg-card-cta"></span>
 *       </span>
 *     </span>
 *   </a></li>
 *
 * Tokens (--hb-*) come from hbg-ui.css, which must load first.
 */

/* ------------------------------------------------------------------- grid */

.hbg-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hbg-card-grid > li {
	display: flex;
	min-width: 0;
}

/* page-tools.js / page-cars.js hide cards with [hidden]; the flex display
   above would otherwise win over the UA rule. */
.hbg-card-grid > li[hidden] {
	display: none;
}

/* ------------------------------------------------------------------- card */

.hbg-card {
	position: relative;
	display: flex;
	width: 100%;
	border: 1px solid var(--hb-line);
	border-radius: var(--hb-radius-lg);
	background: var(--hb-card);
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.hbg-card:hover {
	transform: translateY(-2px);
	border-color: var(--hb-accent-line);
	box-shadow: var(--hb-shadow-lift);
}

.hbg-card-link {
	display: flex;
	flex-direction: column;
	width: 100%;
	color: inherit;
	text-decoration: none;
}

.hbg-card-link:focus-visible {
	outline: 2px solid var(--hb-accent);
	outline-offset: -2px;
}

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

.hbg-card-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--hb-soft-2);
}

.hbg-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.hbg-card:hover .hbg-card-media img {
	transform: scale(1.03);
}

.hbg-card-tag {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 1;
	padding: 8px 15px;
	border-bottom-left-radius: 14px;
	background: var(--hb-ink);
	color: var(--hb-bg);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	line-height: 1.35;
}

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

.hbg-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 14px;
	padding: 20px;
}

.hbg-card-kicker {
	align-self: flex-start;
	padding: 6px 11px;
	border-radius: 9px;
	background: var(--hb-soft);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1.3;
	color: var(--hb-muted);
}

.hbg-card-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.03em;
	color: var(--hb-ink);
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s ease;
}

.hbg-card:hover .hbg-card-title {
	color: var(--hb-accent-ink);
}

.hbg-card-desc {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--hb-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ------------------------------------------------------------------- foot */

.hbg-card-foot {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: flex-end;
	gap: 14px;
	padding-top: 4px;
}

.hbg-card-price {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.035em;
	font-variant-numeric: tabular-nums;
	color: var(--hb-ink);
	white-space: nowrap;
}

/* Card action: the primary variant from the hbg-ui system, stretched to the
   card width. Card hover owns the lift, so the button itself only shifts its
   shadow and the arrow. */
.hbg-card-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: var(--hb-btn-radius);
	background-color: var(--hb-btn-primary);
	background-image: linear-gradient(180deg, var(--hb-btn-primary-hi), var(--hb-btn-primary) 55%, var(--hb-btn-primary-lo));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(33, 38, 120, 0.18),
		0 1px 2px rgba(16, 18, 24, 0.1), 0 8px 18px -10px rgba(101, 113, 255, 0.65);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.005em;
	color: var(--hb-btn-primary-ink);
	white-space: nowrap;
	transition: box-shadow 0.18s ease, filter 0.18s ease;
}

.hbg-card-cta svg {
	width: 16px;
	height: 16px;
	transition: transform 0.22s ease;
}

.hbg-card:hover .hbg-card-cta {
	filter: saturate(1.06) brightness(1.03);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(33, 38, 120, 0.18),
		0 3px 6px rgba(16, 18, 24, 0.12), 0 14px 26px -12px rgba(101, 113, 255, 0.75);
}

.hbg-card:hover .hbg-card-cta svg {
	transform: translateX(3px);
}

/* --------------------------------------------------------- related row */

.hbg-tp-related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hbg-tp-related-grid > li {
	display: flex;
}

.hbg-tp-related-grid a {
	display: flex;
	flex-direction: column;
	width: 100%;
	border: 1px solid var(--hb-line);
	border-radius: var(--hb-radius);
	background: var(--hb-card);
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.hbg-tp-related-grid a:hover {
	transform: translateY(-2px);
	border-color: var(--hb-accent-line);
	box-shadow: var(--hb-shadow-lift);
}

.hbg-tp-related-grid img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	background: var(--hb-soft);
}

.hbg-tp-related-grid a > span {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 13px 15px;
	border-top: 1px solid var(--hb-line);
}

.hbg-tp-related-grid a > span > span {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.012em;
	color: var(--hb-ink);
}

.hbg-tp-related-grid small {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--hb-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 820px) {
	.hbg-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}

	.hbg-tp-related-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 620px) {
	.hbg-card-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.hbg-card-body {
		gap: 12px;
		padding: 16px;
	}

	.hbg-card-title {
		font-size: 19px;
	}

	.hbg-card-desc {
		font-size: 13px;
	}

	.hbg-card-price {
		font-size: 22px;
	}

	.hbg-card-cta {
		padding: 0 14px;
		font-size: 13.5px;
	}

	.hbg-tp-related-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
