/*
 * Product card — Blocksy card type-2 skinned to the design's .pcard (style.css 574-748).
 * Order (scripts/config/blocksy-shop.php): image 5:4 on beige → kicker (topic · form) → title →
 * claim (short description) → price (+ volume price popover, "ab … im Spar-Abo") + round add-to-cart
 * (1 piece; the drawer opens). Badge, family watermark, kicker and price parts: inc/commerce/product-card.php.
 * No rating (0.10).
 */

/* Grid gap like the design's .shop-grid (columns 4 / 2 / 1 come from the Customizer) */
[data-products] {
	--grid-columns-gap: var(--ll-gap-grid);
	--grid-rows-gap: var(--ll-gap-grid);
}

[data-products] .product {
	--horizontal-alignment: flex-start;
	--text-horizontal-alignment: start;
	--product-element-spacing: var(--ll-space-8);
	padding: 0 var(--ll-space-24) var(--ll-space-24);
	background: var(--ll-bg);
	border: 1px solid var(--ll-hairline);
	border-radius: var(--ll-r-lg);
	box-shadow: var(--ll-shadow-card);
	text-align: start;
	transition: transform var(--ll-t-slow) var(--ll-ease), box-shadow var(--ll-t-slow) var(--ll-ease);
}
[data-products] .product:hover {
	transform: translateY(var(--ll-card-lift));
	box-shadow: var(--ll-shadow-float);
}

/* Media: 5:4 beige area, packshot contained and standing on the bottom edge */
html [data-products] .product figure {
	--product-element-spacing: var(--ll-space-24);
	inline-size: calc(100% + 2 * var(--ll-space-24));
	margin-inline: calc(-1 * var(--ll-space-24));
	background: var(--ll-panel);
	border-radius: var(--ll-r-lg) var(--ll-r-lg) 0 0;
	overflow: hidden;
}
[data-products] .product figure img {
	aspect-ratio: var(--ll-ratio-card-media) !important; /* Blocksy writes the ratio inline */
	object-fit: contain;
	object-position: center bottom;
	/* design .pcard__media img.jar: 94% of the media height, 1% (of the width) above the bottom edge */
	scale: 0.94;
	translate: 0 -1.25%;
	transform-origin: center bottom;
	transition: transform var(--ll-t-slow) var(--ll-ease);
}
[data-products] .product:hover figure img {
	transform: translateY(var(--ll-card-lift));
}

/* Kicker: topic · form (design .pcard__kicker) */
html [data-products] .product .ll-pcard__kicker {
	display: block;
	margin-block-end: var(--ll-space-8);
	font-size: var(--ll-overline);
	font-weight: var(--ll-weight-bold);
	line-height: var(--ll-lh-tight);
	letter-spacing: var(--ll-tracking-caps);
	text-transform: uppercase;
	color: var(--ll-text-3);
}

/* Family watermark behind the packshot (design .pcard--gut/--joints/--heart, .pcard__media::before) */
[data-products] .ll-pcard--gut { --ll-pattern: url("../icons/products/gut.svg"); --ll-pattern-position: left -50% top 50%; }
[data-products] .ll-pcard--joints { --ll-pattern: url("../icons/products/joints.svg"); --ll-pattern-position: left 5% top 50%; --ll-pattern-size: auto 120%; }
[data-products] .ll-pcard--heart { --ll-pattern: url("../icons/products/heart.svg"); --ll-pattern-position: left 1020% top 50%; --ll-pattern-size: auto 110%; }
html [data-products] .product figure { position: relative; }
html [data-products] .product figure::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--ll-pattern, none);
	background-repeat: no-repeat;
	background-position: var(--ll-pattern-position, left 0 top 50%);
	background-size: var(--ll-pattern-size, auto 128%);
	opacity: var(--ll-pattern-opacity);
	mix-blend-mode: multiply;
	pointer-events: none;
	z-index: 0;
}
html [data-products] .product figure > .ct-media-container { position: relative; z-index: 1; }
/* The image box shows the image and our badge stack, nothing else: whatever Blocksy, WooCommerce or a plugin puts
   there now or later («Ausverkauft», «Angebot», «Neu», a ribbon) can neither cover nor push the image (Lena
   2026-11-24). Foreign badges elsewhere in the card go too: availability and saving are ours. */
html [data-products] .product figure > :not(.ct-media-container, .ll-pcard__badges),
html [data-products] .product :is(.onsale, .out-of-stock-badge, .ct-woo-badges, [class*="badge"]:not([class*="ll-"])) {
	display: none !important;
}

/* Badges (design .pcard__badge): one stack in the corner, availability on top (ll_badge_stack()) */
html [data-products] .product .ll-pcard__badges {
	position: absolute;
	z-index: 2;
	top: var(--ll-badge-inset);
	left: var(--ll-badge-inset);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--ll-space-8);
	pointer-events: none;
}
html [data-products] .product .ll-pcard__badge {
	padding: var(--ll-space-8) var(--ll-space-16);
	border-radius: var(--ll-r-full);
	background: var(--ll-white);
	color: var(--ll-petrol);
	font-size: var(--ll-overline);
	font-weight: var(--ll-weight-bold);
	line-height: var(--ll-lh-tight);
	letter-spacing: var(--ll-tracking-caps);
	text-transform: uppercase;
	white-space: nowrap;
	transform: rotate(var(--ll-tilt));
}
html [data-products] .product .ll-pcard__badge--acc { background: var(--ll-cyan); color: var(--ll-petrol-deep); }
/* WooCommerce's product grid blocks shown as our cards (inc/commerce/product-grids.php): in the content column like
   the shop grid, also inside the wide cart block («Neu im Shop» of the empty cart) */
.ll-product-grid { max-inline-size: var(--ll-content); margin-inline: auto; }

/* Saving of an additional discount («Spare 10 %», design canvas «Sale product cards») */
html [data-products] .product .ll-pcard__badge--sale { background: var(--ll-petrol); color: var(--ll-white); }

/* Title + claim */
html [data-products] .woocommerce-loop-product__title {
	--theme-font-size: var(--ll-h4);
	--theme-font-weight: var(--ll-weight-bold);
	--theme-line-height: var(--ll-lh-tight);
	--theme-letter-spacing: 0;
	--theme-link-initial-color: var(--ll-text-1);
	--theme-link-hover-color: var(--ll-text-1);
	/* the card title is an h2: the heading ramp (body h2) would win over Blocksy's variable */
	font-size: var(--ll-h4);
	line-height: var(--ll-lh-tight);
	letter-spacing: 0;
	margin-block-start: 0;
}
/* As Blocksy's main stylesheet sets it on the frontend; the editor canvas (ll/xsell preview) has only this file */
html [data-products] .woocommerce-loop-product__title a {
	text-decoration: none;
}
html [data-products] .product .entry-excerpt {
	--product-element-spacing: var(--ll-space-16);
	font-size: var(--ll-small);
	line-height: var(--ll-lh-relaxed);
	color: var(--ll-text-2);
}

/* Foot: price left, round add-to-cart right, hairline above */
html [data-products="type-2"] .product .ct-woo-card-actions {
	inline-size: 100%;
	margin: auto 0 0;
	padding-block-start: var(--ll-space-16);
	justify-content: space-between;
	gap: var(--ll-space-12);
	border-block: 0;
	border-block-start: 1px solid var(--ll-hairline-soft);
}
html [data-products="type-2"] .product .ct-woo-card-actions > * {
	flex: 0 0 auto;
	min-block-size: 0;
	padding: 0;
}
/* The price column takes the room left of the button and wraps its lines there («from CHF 21.90 with Subscribe & Save»,
   longer euro prices, narrow 4-column cards); the button keeps its size and stays inside the card. */
html [data-products="type-2"] .product .ct-woo-card-actions .price {
	flex: 1 1 auto;
	min-inline-size: 0;
	--theme-font-size: var(--ll-h4);
	--theme-font-weight: var(--ll-weight-bold);
	justify-content: flex-start;
	font-size: var(--ll-h4);
	font-weight: var(--ll-weight-bold);
	line-height: var(--ll-lh-tight);
	letter-spacing: var(--ll-tracking-tight);
	color: var(--ll-text-1);
}
html [data-products="type-2"] .product .ct-woo-card-actions .price::after {
	content: none;
}

/* Round add-to-cart; the visible label is replaced by the cart icon (::after — Blocksy uses ::before
   for its hover glow), aria-label stays */
html [data-products] .product .ct-woo-card-actions .add_to_cart_button {
	inline-size: var(--ll-card-cta);
	block-size: var(--ll-card-cta);
	min-block-size: var(--ll-card-cta);
	padding: 0;
	border-radius: var(--ll-r-full);
	background-color: var(--ll-brand);
	color: var(--ll-brand-ink);
	font-size: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: background-color var(--ll-t-base) var(--ll-ease-pop), transform var(--ll-t-base) var(--ll-ease-pop);
}
html [data-products] .product .ct-woo-card-actions .add_to_cart_button::after {
	content: "";
	display: block;
	inline-size: var(--ll-icon-m);
	block-size: var(--ll-icon-m);
	background: currentColor;
	-webkit-mask: var(--ll-icon-cart) center / contain no-repeat;
	mask: var(--ll-icon-cart) center / contain no-repeat;
}
html [data-products] .product .ct-woo-card-actions .add_to_cart_button:hover {
	background-color: var(--ll-brand-hover);
	color: var(--ll-brand-ink);
	transform: translateY(var(--ll-card-cta-lift));
}
/* A product that cannot be ordered: the bell as a ghost button (design .pcard.is-soon .pcard__cta,
   strong border), so «benachrichtigen» does not read as «In den Warenkorb»; it opens the sign-up (notify.js) */
html [data-products] .product .ct-woo-card-actions .ll-pcard__soon {
	inline-size: var(--ll-card-cta);
	block-size: var(--ll-card-cta);
	min-block-size: var(--ll-card-cta);
	padding: 0;
	border: 0;
	border-radius: var(--ll-r-full);
	background: transparent;
	box-shadow: inset 0 0 0 var(--ll-border-w-strong) var(--ll-border-strong);
	color: var(--ll-ink);
	font-size: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: box-shadow var(--ll-t-base) var(--ll-ease-pop), transform var(--ll-t-base) var(--ll-ease-pop);
}
html [data-products] .product .ct-woo-card-actions .ll-pcard__soon:hover {
	background: transparent;
	color: var(--ll-ink);
	box-shadow: inset 0 0 0 var(--ll-border-w-strong) var(--ll-ink);
	transform: translateY(var(--ll-card-cta-lift));
}
html [data-products] .product .ct-woo-card-actions .ll-pcard__soon::before { content: none; }
html [data-products] .product .ct-woo-card-actions .ll-pcard__soon::after {
	content: "";
	display: block;
	inline-size: var(--ll-icon-m);
	block-size: var(--ll-icon-m);
	background: currentColor;
	-webkit-mask: var(--ll-icon-bell) center / contain no-repeat;
	mask: var(--ll-icon-bell) center / contain no-repeat;
}
/* Blocksy's type-2 hides the button until hover; the design always shows it */
html [data-products] [data-add-to-cart="auto-hide"] .add_to_cart_button {
	opacity: 1;
	visibility: visible;
}
/* After adding, Blocksy hides the button and expects WooCommerce's "view cart" link (removed:
   the drawer is the cart). Keep the button so more pieces can be added. */
html [data-products] [data-add-to-cart="auto-hide"] .add_to_cart_button.added {
	display: inline-flex;
}

/* Price: one-time price + volume price popover, "ab … im Spar-Abo" below (design .pcard__price) */
html [data-products="type-2"] .product .ct-woo-card-actions .ll-pcard__price { display: block; }
.ll-pcard__price-line { position: relative; display: inline-flex; align-items: center; gap: var(--ll-space-4); }
/* With a saving: the price before it small and struck through above the price, out of the flow so that the price row
   stays level with the cards next to it */
.ll-pcard__price-line del {
	position: absolute;
	inset-block-end: calc(100% + var(--ll-space-2));
	inset-inline-start: 0;
	font-size: var(--ll-tiny);
	font-weight: var(--ll-weight-medium);
	line-height: var(--ll-lh-tight);
	color: var(--ll-text-3);
	white-space: nowrap;
}
.ll-pcard__price-line del .amount { font-size: inherit; font-weight: inherit; color: inherit; }
.ll-pcard__price-line ins { text-decoration: none; }
/* The addon's own saving badge, should it still reach the price: the badge on the image names the saving */
.ll-pcard__price .trafficflow-savings-badge { display: none; }
.ll-pcard__price small {
	display: block;
	margin-top: var(--ll-space-4);
	font-size: var(--ll-overline);
	line-height: var(--ll-lh-tight);
	font-weight: var(--ll-weight-medium);
	letter-spacing: var(--ll-tracking-button);
	color: var(--ll-text-3);
	text-wrap: balance; /* two even lines when it wraps, no «& Save» alone on the second */
}
.ll-pcard__price small .amount { font-size: inherit; font-weight: inherit; white-space: nowrap; }
.ll-pcard__tiers {
	position: relative;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--ll-space-8);
	margin: var(--ll-tiers-pull);
	color: var(--ll-text-3);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: color var(--ll-t-base) ease;
}
.ll-pcard__tiers:hover, .ll-pcard__tiers.is-open { color: var(--ll-petrol); }
.ll-pcard__tiers svg { width: var(--ll-icon-s); height: var(--ll-icon-s); display: block; }
/* Keyboard focus: a circle around the icon, clear of the price beside it. */
.ll-pcard__tiers:focus-visible {
	outline-offset: calc(-1 * var(--ll-space-4));
	border-radius: var(--ll-r-full);
}
/* Product image: its frame clips an outline, so the ring is drawn inside it, corners following the card's. */
li.product figure > a.ct-media-container:focus-visible {
	outline: none;
}
li.product figure > a.ct-media-container:focus-visible::after {
	content: "";
	position: absolute;
	inset: var(--ll-focus-offset);
	z-index: 2;
	border: var(--ll-focus-w) solid var(--ll-focus-color);
	border-radius: calc(var(--ll-r-lg) - var(--ll-focus-offset)) calc(var(--ll-r-lg) - var(--ll-focus-offset)) var(--ll-r-focus) var(--ll-r-focus);
	pointer-events: none;
}
.ll-pcard__tiers-pop {
	position: absolute;
	bottom: calc(100% + var(--ll-tiers-gap));
	left: 50%;
	transform: translateX(-50%) translateY(var(--ll-space-4));
	display: grid;
	grid-template-columns: repeat(3, auto);
	row-gap: var(--ll-space-4);
	padding: var(--ll-space-8) 0;
	background: var(--ll-white);
	border: 1px solid var(--ll-border);
	border-radius: var(--ll-r-md);
	box-shadow: var(--ll-shadow-float);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity var(--ll-t-base) ease, transform var(--ll-t-base) ease, visibility var(--ll-t-base) ease;
	z-index: 10;
}
.ll-pcard__tiers-cell {
	padding: 0 var(--ll-space-16);
	text-align: center;
	font-size: var(--ll-tiny);
	line-height: var(--ll-lh-relaxed);
	color: var(--ll-text-3);
	font-weight: var(--ll-weight-medium);
	letter-spacing: var(--ll-tracking-hair);
}
.ll-pcard__tiers-cell--qty { font-weight: var(--ll-weight-bold); color: var(--ll-ink); }
.ll-pcard__tiers-cell:not(:nth-child(3n+1)) { border-left: 1px solid var(--ll-border-soft); }
/* Rows (quantity, price) instead of three columns: trade tiers, and volume tiers other than the two designed ones. */
.ll-pcard__tiers-pop--rows { grid-template-columns: repeat(2, auto); }
.ll-pcard__tiers-pop--rows .ll-pcard__tiers-cell { text-align: left; }
.ll-pcard__tiers-pop--rows .ll-pcard__tiers-cell:not(:nth-child(3n+1)) { border-left: 0; }
.ll-pcard__tiers-pop--rows .ll-pcard__tiers-cell:nth-child(even) { border-left: 1px solid var(--ll-border-soft); text-align: right; }
.ll-pcard__tiers.is-open .ll-pcard__tiers-pop {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}
@media (hover: hover) {
	.ll-pcard__tiers:hover .ll-pcard__tiers-pop {
		opacity: 1;
		visibility: visible;
		transform: translateX(-50%) translateY(0);
		pointer-events: auto;
	}
}


/* TrafficFlow Dynamic Pricing Addon wraps the price (.final-price) and styles it for archives (smaller, its own
   colour); the card keeps the design's price type. Skinned here, the addon stays untouched. */
html [data-products] .ll-pcard__price .final-price .woocommerce-Price-amount {
	font-size: inherit;
	color: inherit;
}
