/**
 * Atlas Labs — Card Foundation
 *
 * A generic, content-agnostic card container: background, border,
 * radius, padding, and the optional hover-lift treatment shared by
 * every card-like surface in DESIGN_SYSTEM.md (e.g. the resting/hover
 * pattern in #section-10-product-card-tokens). This is deliberately
 * NOT the product card itself — no image slot, title, price, or badge
 * placement is defined here. Those are product-catalog concerns for
 * the sprint that builds the shop/product templates; this file gives
 * that future component (and any other future card — a COA card, a
 * trust-badge card) the same base to extend rather than each
 * reinventing background/border/radius/shadow independently.
 */

.al-card {
	background-color: var(--color-card-background);
	border: var(--border-width-standard) solid var(--color-border-primary);
	border-radius: var(--radius-md);
	padding: var(--space-16);
}

.al-card--elevated {
	background-color: var(--color-card-background-elevated);
}

.al-card--interactive {
	transition:
		transform var(--duration-standard) var(--easing-standard),
		box-shadow var(--duration-standard) var(--easing-standard),
		border-color var(--duration-standard) var(--easing-standard);
}

.al-card--interactive:hover {
	transform: translateY(-2px);
	border-color: var(--color-border-secondary);
	box-shadow: var(--shadow-md);
}

/* ---------------------------------------------------------------
 * Product Card
 * Implements DESIGN_SYSTEM.md#section-10-product-card-tokens.
 *
 * The full card is a single focusable link target "where possible"
 * while the Add to Cart button remains independently focusable — two
 * interactive elements can't nest validly in HTML, so the title link
 * is stretched over the entire card with a ::after overlay
 * (the standard "stretched link" pattern) and the button sits above
 * it in stacking order, keeping both independently operable.
 * ------------------------------------------------------------- */

.al-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: var(--color-card-background);
	border: var(--border-width-standard) solid var(--color-border-primary);
	border-radius: var(--radius-md);
	padding: var(--space-16);
	transition:
		transform var(--duration-standard) var(--easing-standard),
		box-shadow var(--duration-standard) var(--easing-standard),
		border-color var(--duration-standard) var(--easing-standard);
}

@media (any-hover: hover) {
	.al-product-card:hover {
		transform: translateY(-2px);
		border-color: var(--color-border-secondary);
		box-shadow: var(--shadow-md);
	}
}

.al-product-card__image-wrap {
	position: relative;
	aspect-ratio: 1 / 1;
	background-color: var(--color-bg-primary);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

/* radius-sm edge treatment per DESIGN_SYSTEM.md#section-5-border-radius-tokens
   ("product images (edge treatment)"). */
.al-product-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--radius-sm);
}

/* Wraps one or more badges (e.g. Research Use Only + Out of Stock) as
   a single top-left group, per DESIGN_SYSTEM.md's "maximum of 2-3
   badges" allowance — badges stack vertically so neither is cropped
   on narrow cards. */
.al-product-card__badges {
	position: absolute;
	top: var(--space-8);
	left: var(--space-8);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-4);
}

.al-product-card__body {
	display: flex;
	flex-direction: column;
	margin-top: var(--space-12);
}

.al-product-card__price--unset {
	color: var(--color-text-muted);
	font-weight: var(--weight-regular);
}

.al-product-card__title {
	position: relative;
	font-family: var(--font-family-base);
	font-size: var(--type-h4-size);
	font-weight: var(--type-h4-weight);
	letter-spacing: var(--type-h4-letter-spacing);
	line-height: var(--type-h4-line-height);
	color: var(--color-text-primary);
}

.al-product-card__title::after {
	content: "";
	position: absolute;
	inset: calc(var(--space-16) * -1) calc(var(--space-16) * -1) 0 calc(var(--space-16) * -1);
	z-index: 0;
}

.al-product-card__strength {
	margin-top: var(--space-4);
	font-family: var(--font-family-base);
	font-size: var(--type-caption-size);
	line-height: var(--type-caption-line-height);
	color: var(--color-text-secondary);
}

.al-product-card__price {
	margin-top: var(--space-8);
	font-family: var(--font-family-base);
	font-size: var(--type-body-size);
	font-weight: var(--weight-semibold);
	color: var(--color-text-primary);
}

.al-product-card__cta {
	position: relative;
	z-index: 1;
	width: 100%;
	margin-top: var(--space-16);
}

/* Product grid — the responsive column behavior DESIGN_SYSTEM.md
   specifies for product cards (mobile 1-2 col, tablet/desktop fixed
   grid) isn't covered by the generic .al-grid--cols-* utilities in
   layout.css, which don't collapse column count responsively. */
.al-product-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-16);
}

@media (min-width: 768px) {
	.al-product-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.al-product-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: var(--space-24);
	}
}
