/**
 * Styles for woo-sil7en/product-card — warm boutique, cover-forward.
 *
 * Gallery aesthetic: the book cover is the hero (portrait, generous rounding,
 * soft warm-tinted shadow, gentle lift + zoom on hover). Minimal chrome, clean
 * Manrope title, accent price. All values from design tokens; every motion is
 * compositor-only (transform/opacity) and gated by prefers-reduced-motion.
 *
 * @package woo-sil7en-blocks-commerce
 * @since   0.1.0
 */

.woo-sil7en-product-card {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xs, 0.75rem);
	background: transparent;
	border: 0;
	width: 100%;
	height: 100%;
}

/* ---- Media: the cover ---- */
.woo-sil7en-product-card__media {
	position: relative;
	display: block;
	/* Book-cover ratio: real covers fill it; off-ratio/low-res covers show
		complete (letterboxed on the surface) instead of being hard-cropped. */
	aspect-ratio: var(--wsx-card-aspect, 2 / 3);
	overflow: hidden;
	border-radius: var(--wp--custom--radius--xl, 0.25rem);
	background: var(--wp--preset--color--surface, #f6f5f3);
	border: 1px solid var(--wp--preset--color--border, #e6e3de);
	box-shadow: none;
	transition:
		transform var(--wp--custom--motion--duration--base, 250ms) var(--wp--custom--motion--ease--soft, ease),
		box-shadow var(--wp--custom--motion--duration--base, 250ms) var(--wp--custom--motion--ease--soft, ease);
}

.woo-sil7en-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: var(--wsx-card-fit, contain);
	display: block;
	transition: transform var(--wp--custom--motion--duration--slow, 500ms) var(--wp--custom--motion--ease--soft, ease);
}

.woo-sil7en-product-card:hover .woo-sil7en-product-card__media {
	transform: translateY(-3px);
	box-shadow: var(--wp--custom--shadow--md, 0 6px 18px rgb(20 18 14 / 0.07));
}

.woo-sil7en-product-card:hover .woo-sil7en-product-card__media img {
	transform: scale(1.05);
}

/* ---- Sale badge: a small boutique gold tag, top-start of the cover ----
	Editorial, not loud: gold seal + ink text, soft shadow, slight tilt so it
	reads like a hand-placed price tag rather than a generic corner sticker. */
.woo-sil7en-product-card__sale-badge {
	position: absolute;
	inset-block-start: 0.5rem;
	inset-inline-start: 0.5rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.2rem 0.5rem 0.2rem 0.4rem;
	background: var(--wp--preset--color--accent, #ffc800);
	color: var(--wp--preset--color--accent-ink, #1a0800);
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.01em;
	border-radius: var(--wp--custom--radius--pill, 999px);
	box-shadow: var(--wp--custom--shadow--sm, 0 2px 6px rgb(17 24 28 / 0.08));
	transform: rotate(-3deg);
	transform-origin: top left;
	pointer-events: none;
}

.woo-sil7en-product-card__sale-icon {
	font-size: 0.9em;
	color: var(--wp--preset--color--accent-ink, #1a0800);
}

.woo-sil7en-product-card__sale-text {
	font-variant-numeric: tabular-nums;
}

/* Featured/bento tile: a touch larger + more prominent, matching its scale. */
.woo-sil7en-product-grid__item.is-featured .woo-sil7en-product-card__sale-badge {
	inset-block-start: 0.85rem;
	inset-inline-start: 0.85rem;
	padding: 0.3rem 0.7rem 0.3rem 0.55rem;
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	box-shadow: var(--wp--custom--shadow--md, 0 8px 24px rgb(17 24 28 / 0.10));
}

/* Subtle settle on card hover: the tag straightens, as if nudged. */
@media (prefers-reduced-motion: no-preference) {
	.woo-sil7en-product-card__sale-badge {
		transition: transform var(--wp--custom--motion--duration--base, 250ms) var(--wp--custom--motion--ease--standard, ease);
	}

	.woo-sil7en-product-card:hover .woo-sil7en-product-card__sale-badge {
		transform: rotate(0deg) scale(1.04);
	}
}

/* ---- Body ---- */
.woo-sil7en-product-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--3xs, 0.25rem);
	flex: 1;
	padding-inline: 0.125rem;
}

.woo-sil7en-product-card__name {
	font-family: var(--wp--preset--font-family--display, "Lora", Georgia, serif);
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.3;
	margin: 0;
	/* Full title — always readable. Grid row-stretch + the auto-margin CTA keep
		prices/buttons aligned across a row even when titles wrap to N lines. */
	text-wrap: pretty;
}

.woo-sil7en-product-card__name a {
	color: var(--wp--preset--color--contrast, #1c140d);
	text-decoration: none;
}

.woo-sil7en-product-card__name a:hover {
	color: var(--wp--preset--color--primary, #531099);
}

/* Subtitle — the recognition signal (authors / fit line): small, links clickable. */
.woo-sil7en-product-card__subtitle {
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	color: var(--wp--preset--color--muted, #6f6b64);
	line-height: 1.35;
	margin: 0;
}

.woo-sil7en-product-card__subtitle a {
	color: inherit;
	text-decoration: none;
	transition: color var(--wp--custom--motion--duration--fast, 150ms) ease;
}

.woo-sil7en-product-card__subtitle a:hover,
.woo-sil7en-product-card__subtitle a:focus-visible {
	color: var(--wp--preset--color--primary, #531099);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Quick-spec chips wrapper (chips themselves styled by core commerce.css). */
.woo-sil7en-product-card__specs {
	margin-block: 0.15rem 0.1rem;
}

.woo-sil7en-product-card__price {
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	font-weight: 600;
	color: var(--wp--preset--color--primary, #531099);
}

/* Old price: muted, smaller, struck through — clearly the "before". */
.woo-sil7en-product-card__price del {
	color: var(--wp--preset--color--muted, #6f6b64);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	font-weight: 400;
	text-decoration: line-through;
	margin-inline-end: 0.4rem;
}

/* Sale price: the hero — no underline, strong weight, brand accent in ink. */
.woo-sil7en-product-card__price ins {
	color: var(--wp--preset--color--danger, #c0362c);
	font-weight: 700;
	text-decoration: none;
}

.woo-sil7en-product-card__excerpt {
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	color: var(--wp--preset--color--muted, #6b6157);
	line-height: 1.6;
	margin-block-start: 0.25rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---- Add to cart: quiet ghost, fills on hover ---- */
.woo-sil7en-product-card__atc {
	margin-block-start: auto;
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.85rem;
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	font-weight: 500;
	color: var(--wp--preset--color--contrast, #1a1714);
	background: transparent;
	border: 1px solid var(--wp--preset--color--border, #e6e3de);
	border-radius: var(--wp--custom--radius--pill, 999px);
	text-decoration: none;
	transition:
		border-color var(--wp--custom--motion--duration--fast, 150ms) ease,
		color var(--wp--custom--motion--duration--fast, 150ms) ease;
}

.woo-sil7en-product-card__atc:hover,
.woo-sil7en-product-card__atc:focus-visible {
	border-color: var(--wp--preset--color--primary, #531099);
	color: var(--wp--preset--color--primary, #531099);
}

/* Add-to-cart dual state: default label ↔ "ya en el carrito" (+ qty pill). */
.woo-sil7en-product-card__atc-default,
.woo-sil7en-product-card__atc-incart {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.woo-sil7en-product-card__atc-incart {
	display: none;
}

.woo-sil7en-product-card__atc.is-in-cart .woo-sil7en-product-card__atc-default {
	display: none;
}

.woo-sil7en-product-card__atc.is-in-cart .woo-sil7en-product-card__atc-incart {
	display: inline-flex;
}

.woo-sil7en-product-card__atc-qty {
	display: inline-grid;
	place-items: center;
	min-width: 1.3rem;
	height: 1.3rem;
	padding-inline: 0.35rem;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--primary-ink, #06302f);
	background: var(--wp--preset--color--primary, #00b8bf);
	border-radius: var(--wp--custom--radius--pill, 999px);
}

@media (prefers-reduced-motion: reduce) {
	.woo-sil7en-product-card__media,
	.woo-sil7en-product-card__media img,
	.woo-sil7en-product-card__atc {
		transition: none;
	}
	.woo-sil7en-product-card:hover .woo-sil7en-product-card__media {
		transform: none;
	}
	.woo-sil7en-product-card:hover .woo-sil7en-product-card__media img {
		transform: none;
	}
}
