/* ------------------------------------------------------------------ */
/* Product card v2 – category mockup 2026-10 (docs/mockups/kategoria.html) */
/* Loaded only when dbp_card_v2_enabled(). Compact layout is driven by    */
/* the card's own width (container query), so it works in every grid and */
/* carousel, not just on category pages.                                  */
/* ------------------------------------------------------------------ */

.dbp-product-card--v2 {
	--pc2-tile: #f1f5f4;
	--pc2-accent: var(--dbp-color-accent, #00665e);
	--pc2-accent-strong: var(--dbp-color-accent-strong, #00514b);
	--pc2-accent-soft: var(--dbp-color-accent-soft, #e6f3f2);
	--pc2-heading: var(--dbp-color-heading, #1f2937);
	--pc2-text: var(--dbp-color-text, #334155);
	--pc2-muted: #556477;
	--pc2-border: var(--dbp-color-border, #e2e8f0);
	--pc2-border-strong: var(--dbp-color-border-strong, #cbd5e1);
	--pc2-sale: #b4233c;
	--pc2-sale-soft: #fdecef;
	--pc2-gold: #b7791f;
	--pc2-accent-900: #003b37;

	container-type: inline-size;
	list-style: none;
	min-width: 0;
	height: 100%;
}

.dbp-pc2 {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid var(--pc2-border);
	border-radius: 14px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dbp-product-card--v2:hover .dbp-pc2,
.dbp-product-card--v2:focus-within .dbp-pc2 {
	border-color: var(--pc2-border-strong);
	box-shadow: 0 12px 28px rgba(2, 6, 23, 0.08);
}

/* Media: square tile in one mint tone, packshot blended into it. */
.dbp-pc2__media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: var(--pc2-tile);
	overflow: hidden;
}

.dbp-product-card--v2 .dbp-pc2__media-link {
	/* shared.css gives .dbp-product-card__media-link a 1.2rem radius with overflow hidden –
	   it clipped the hover photo into a rounded tile inside the card. */
	position: absolute;
	inset: 0;
	display: block;
	padding: 0;
	border: 0;
	border-radius: 0;
	overflow: visible;
	background: transparent;
}

.dbp-product-card--v2 .dbp-pc2__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 2px;
	border-radius: 0; /* shared.css rounds .dbp-product-card__image (1.2rem) – visible on the lifestyle hover photo */
	object-fit: contain;
	mix-blend-mode: multiply;
	transition: opacity 0.3s ease, transform 0.5s ease;
}

.dbp-product-card--v2 .dbp-product-card__image--secondary {
	opacity: 0;
}

@media (hover: hover) {
	.dbp-product-card--v2.dbp-product-card--has-secondary:hover .dbp-product-card__image--secondary {
		opacity: 1;
	}

	.dbp-product-card--v2.dbp-product-card--has-secondary:hover .dbp-product-card__image--primary {
		opacity: 0;
	}

	.dbp-product-card--v2:not(.is-oos):hover .dbp-pc2__media img {
		transform: scale(1.03);
	}
}

.dbp-product-card--v2.is-oos .dbp-product-card__image--primary {
	opacity: 0.55;
	filter: grayscale(0.4);
}

/* Badges: one family, at most two (one in the compact layout). */
.dbp-pc2__badges {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
	max-width: calc(100% - 20px);
	pointer-events: none;
}

.dbp-pc2__badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 24px;
	padding: 0 9px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	background: rgba(255, 255, 255, 0.92);
	color: var(--pc2-heading);
	box-shadow: inset 0 0 0 1px var(--pc2-border);
}

.dbp-pc2__badge svg {
	flex: none;
	width: 12px;
	height: 12px;
}

.dbp-pc2__badge--sale {
	background: var(--pc2-sale);
	color: #fff;
	box-shadow: none;
}

.dbp-pc2__badge--product-month,
.dbp-pc2__badge--brand {
	background: var(--pc2-accent);
	color: #fff;
	box-shadow: none;
}

.dbp-pc2__badge--dark,
.dbp-pc2__badge--low-stock {
	background: #334155;
	color: #fff;
	box-shadow: none;
}

/* Body */
.dbp-pc2__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 10px 14px 12px;
	min-width: 0;
	line-height: 1.5;
}

.dbp-pc2__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 18px;
}

.dbp-pc2__tags {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--pc2-accent-strong);
}

.dbp-pc2__rating {
	flex: none;
	margin-left: auto;
	font-size: 12px;
	color: var(--pc2-muted);
	white-space: nowrap;
}

.dbp-pc2__rating i {
	font-style: normal;
	color: var(--pc2-gold);
}

.dbp-product-card--v2 .dbp-pc2__title {
	margin: 0;
	font-family: var(--dbp-font-heading);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--pc2-heading);
	overflow-wrap: anywhere;
}

.dbp-pc2__title a {
	color: inherit;
	text-decoration: none;
}

.dbp-pc2__title a::after {
	/* Whole card clickable through the title link (one link for screen readers). */
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
}

.dbp-pc2__title a:focus-visible {
	outline: none;
}

.dbp-pc2__title a:focus-visible::after {
	outline: 3px solid var(--pc2-accent);
	outline-offset: -3px;
	border-radius: 14px;
}

.dbp-product-card--v2:hover .dbp-pc2__title a {
	color: var(--pc2-accent-strong);
}

.dbp-pc2__sub {
	margin: 0;
	min-height: 2.8em;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--pc2-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Price block */
.dbp-pc2__buy {
	margin-top: auto;
	padding-top: 6px;
	display: grid;
	gap: 2px;
}

.dbp-pc2__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
}

.dbp-pc2__price ins,
.dbp-pc2__price del {
	line-height: 1.5;
}

.dbp-pc2__price ins {
	text-decoration: none;
	font-size: 17px;
	font-weight: 700;
	color: var(--pc2-heading);
}

.dbp-pc2__price.is-sale ins {
	color: var(--pc2-sale);
}

.dbp-pc2__price del {
	font-size: 13px;
	color: var(--pc2-muted);
}

.dbp-pc2__unit,
.dbp-pc2__omni {
	margin: 0;
	font-size: 11.5px;
	line-height: 1.5;
	color: var(--pc2-muted);
}

.dbp-pc2__omni .wc-price-history-shortcode {
	/* The price-history plugin wraps the amount in a block <div>; keep it on the label's line. */
	display: inline;
}

.dbp-pc2__omni .woocommerce-Price-amount,
.dbp-pc2__omni bdi {
	font-weight: 500;
}

.dbp-pc2__pair {
	margin: 6px 0 0;
	padding: 7px 10px;
	border-radius: 10px;
	background: var(--pc2-sale-soft);
	font-size: 12.5px;
	color: var(--pc2-heading);
}

.dbp-pc2__pair b {
	font-size: 14px;
	color: var(--pc2-sale);
}

/* CTA: soft by default, full colour on hover; keeps Woo AJAX classes.
   The old card hides .dbp-product-card__actions until hover – v2 shows it all the time. */
.dbp-product-card--v2 .dbp-product-card__actions {
	inset: auto;
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
}

.dbp-pc2__actions {
	position: relative;
	z-index: 1;
	margin-top: 8px;
}

.dbp-product-card.dbp-product-card--v2 .dbp-pc2__actions a.dbp-product-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 40px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-radius: 10px;
	background: var(--pc2-accent-soft);
	/* shared.css forces #fff with !important on .dbp-product-card__cta */
	color: var(--pc2-accent-900) !important;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.dbp-product-card.dbp-product-card--v2 .dbp-pc2__actions a.dbp-product-card__cta:hover,
.dbp-product-card.dbp-product-card--v2 .dbp-pc2__actions a.dbp-product-card__cta:focus-visible {
	background: var(--pc2-accent);
	color: #fff !important;
}

.dbp-product-card--v2 .dbp-product-card__cta--notify,
.dbp-product-card--v2 .dbp-product-card__cta--pro {
	background: #fff !important;
	color: var(--pc2-heading) !important;
	box-shadow: inset 0 0 0 1px var(--pc2-border-strong) !important;
}

.dbp-product-card--v2 .dbp-product-card__ctaText {
	color: inherit;
}

.dbp-product-card--v2 .dbp-product-card__cta svg {
	flex: none;
	width: 16px;
	height: 16px;
}

.dbp-product-card--v2 .dbp-pc2__actions .added_to_cart {
	display: block;
	margin-top: 6px;
	font-size: 12.5px;
	font-weight: 600;
	text-align: center;
	color: var(--pc2-accent);
}

/* Corner cart button – compact layout only. */
.dbp-pc2__corner {
	display: none;
}

/* ---------- Compact card (phone grid, narrow carousels) ---------- */
@container (max-width: 230px) {
	.dbp-pc2 {
		border-radius: 12px;
	}

	.dbp-pc2__badge:nth-child(n + 2) {
		display: none;
	}

	.dbp-pc2__badges {
		top: 7px;
		left: 7px;
	}

	.dbp-pc2__badge {
		height: 22px;
		padding: 0 7px;
		font-size: 11px;
	}

	.dbp-pc2__body {
		padding: 9px 10px 10px;
		gap: 3px;
	}

	.dbp-pc2__tags {
		display: none;
	}

	.dbp-pc2__rating {
		margin-left: 0;
		font-size: 11px;
	}

	.dbp-pc2__top {
		order: 3;
		min-height: 0;
	}

	.dbp-pc2__title,
	.dbp-pc2__sub {
		order: 1;
	}

	.dbp-pc2__sub {
		order: 2;
		min-height: 32px;
		font-size: 11.5px;
	}

	.dbp-pc2__buy {
		order: 4;
	}

	.dbp-product-card--v2 .dbp-pc2__title {
		font-size: 13.5px;
	}

	.dbp-pc2__price ins {
		font-size: 15px;
	}

	.dbp-pc2__price del {
		font-size: 11.5px;
	}

	.dbp-pc2__unit,
	.dbp-pc2__omni {
		font-size: 11px;
	}

	.dbp-pc2__pair {
		padding: 6px 8px;
		font-size: 11.5px;
	}

	.dbp-pc2__pair b {
		font-size: 13px;
	}

	.dbp-pc2__actions {
		display: none;
	}

	.dbp-product-card--v2 .dbp-pc2__corner {
		display: block;
		position: absolute;
		top: auto;
		left: auto;
		right: 8px;
		bottom: 8px;
		z-index: 2;
	}

	.dbp-product-card.dbp-product-card--v2 .dbp-pc2__corner a.dbp-product-card__cta {
		display: grid;
		place-items: center;
		position: relative;
		width: 40px;
		height: 40px;
		min-height: 0; /* shared.css sets 2.75rem on .dbp-product-card__cta */
		touch-action: manipulation;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: var(--pc2-accent);
		color: #fff;
		box-shadow: 0 4px 10px rgba(0, 81, 75, 0.25);
	}

	.dbp-product-card.dbp-product-card--v2.is-oos .dbp-pc2__corner a.dbp-product-card__cta {
		background: #fff;
		color: var(--pc2-muted) !important;
	}

	.dbp-product-card.dbp-product-card--v2 .dbp-pc2__corner .dbp-product-card__ctaText {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.dbp-product-card--v2 .dbp-pc2__corner .added_to_cart {
		display: none;
	}

	.dbp-product-card--v2 .dbp-pc2__corner .dbp-product-card__cta svg {
		width: 18px;
		height: 18px;
	}

	/* 48 px touch target around the 40 px circle (Android guideline). */
	.dbp-product-card--v2 .dbp-pc2__corner .dbp-product-card__cta::after {
		content: '';
		position: absolute;
		inset: -4px;
		border-radius: 50%;
	}
}

/* Very narrow phones (≈320 px screens) – mockup values. */
@container (max-width: 160px) {
	.dbp-pc2__body {
		padding: 8px 8px 9px;
	}

	.dbp-product-card--v2 .dbp-pc2__title {
		font-size: 13px;
	}

	.dbp-pc2__price ins {
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dbp-product-card--v2 *,
	.dbp-pc2 {
		transition: none !important;
	}
}

/* ---------- Category grid on phones (cards were squeezed to ~148 px on 360 px screens) ----------
   The list sat 1rem narrower than the page container and had 16 px gaps; with card v2 it uses the
   container's full width and the mockup's 10 px gap, so a card is ~159 px wide on a 360 px screen. */
@media (max-width: 720px) {
	.dbp-archive__layout {
		width: 100%;
	}

	.woocommerce .dbp-archive__products ul.products,
	.woocommerce ul.products,
	.dbp-archive__products .products {
		gap: 10px;
	}
}

@media (max-width: 340px) {
	.woocommerce .dbp-archive__products ul.products,
	.woocommerce ul.products,
	.dbp-archive__products .products {
		gap: 8px;
	}
}