.product-card {
	--product-card-media-height: auto;
	--product-card-media-aspect: 296 / 365;
	--product-card-media-radius: var(--radius-md, 20px);
	--product-card-content-gap: var(--space-sm, 8px);
	--product-card-bottom-gap: var(--space-md, 16px);
	--product-card-title-size: clamp(var(--font-size-base, 16px), calc(15.257px + 0.19vw), var(--font-size-md, 18px));
	--product-card-title-row-height: clamp(24px, calc(22.886px + 0.286vw), 27px);
	--product-card-category-size: clamp(var(--font-size-xs, 12px), calc(11.257px + 0.19vw), var(--font-size-sm, 14px));
	--product-card-category-row-height: clamp(18px, calc(16.886px + 0.286vw), 21px);
	--product-card-price-regular-size: clamp(var(--font-size-xs, 12px), calc(11.257px + 0.19vw), var(--font-size-sm, 14px));
	--product-card-price-current-size: clamp(20px, calc(18.514px + 0.381vw), var(--font-size-lg, 24px));
	--product-card-badge-size: clamp(var(--font-size-sm, 14px), calc(13.257px + 0.19vw), var(--font-size-base, 16px));
	--product-card-stock-size: clamp(var(--font-size-xs, 12px), calc(11.257px + 0.19vw), var(--font-size-sm, 14px));
	--product-card-badge-gap: 5px;
	--product-card-badge-padding: var(--space-xs, 4px) 12px;
	--product-card-badge-min-height: calc(var(--space-md, 16px) * 2);
	--product-card-stock-padding: 2px var(--space-sm, 8px);
	--product-card-price-gap: clamp(var(--space-xs, 4px), calc(1.029px + 0.762vw), 12px);
	--product-card-transition-duration: 180ms;
	--product-card-skeleton-background: var(--color-surface-control);
	--product-card-skeleton-highlight: var(--color-background);
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--product-card-bottom-gap);
	height: 100%;
	min-width: 0;
	color: var(--color-text);
	font-family: var(--font-family-base, "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif);
	user-select: none;
}

.woocommerce ul.products li.product.paltaja-product-loop-item {
	float: none;
	width: auto;
	margin: 0;
}

.product-card,
.product-card *,
.product-card *::before,
.product-card *::after {
	box-sizing: border-box;
}

.product-card__media-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: var(--product-card-media-aspect);
	height: var(--product-card-media-height);
	min-height: 0;
	container-type: inline-size;
	overflow: hidden;
	background: transparent;
	border: var(--stroke-border-width, 1px) solid var(--color-border);
	border-radius: var(--product-card-media-radius);
	transition:
		border-color var(--product-card-transition-duration) ease,
		box-shadow var(--product-card-transition-duration) ease;
}

.product-card__media-wrap::before {
	position: absolute;
	z-index: 1;
	inset: 0;
	background:
		linear-gradient(
			90deg,
			var(--product-card-skeleton-background) 0%,
			var(--product-card-skeleton-highlight) 50%,
			var(--product-card-skeleton-background) 100%
		);
	background-size: 200% 100%;
	content: "";
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--product-card-transition-duration) ease;
}

.product-card--loading .product-card__media-wrap::before {
	opacity: 1;
	animation: product-card-skeleton 1200ms ease-in-out infinite;
}

.product-card__media-link {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.product-card__media-link:focus-visible,
.product-card__title-link:focus-visible {
	outline: var(--stroke-border-width, 1px) solid var(--color-secondary);
	outline-offset: var(--space-xs, 4px);
}

.product-card__image {
	display: block;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	opacity: 1;
	transition:
		opacity var(--product-card-transition-duration) ease,
		transform var(--product-card-transition-duration) ease;
}

.product-card__image--placeholder {
	flex: 0 0 50%;
	width: 50%;
	height: 50%;
	object-fit: contain;
	background: transparent;
}

.product-card__media-wrap--placeholder {
	background: var(--color-background);
}

.product-card--loading .product-card__image {
	opacity: 0;
}

.product-card--loading .product-card__title-link,
.product-card--loading .product-card__category,
.product-card--loading .product-card__price-regular,
.product-card--loading .product-card__price-current {
	color: transparent;
	text-decoration-color: transparent;
	background:
		linear-gradient(
			90deg,
			var(--product-card-skeleton-background) 0%,
			var(--product-card-skeleton-highlight) 50%,
			var(--product-card-skeleton-background) 100%
		);
	background-size: 200% 100%;
	border-color: transparent;
	box-shadow: none;
	animation: product-card-skeleton 1200ms ease-in-out infinite;
}

.product-card--loading .product-card__title-link,
.product-card--loading .product-card__category,
.product-card--loading .product-card__price-regular,
.product-card--loading .product-card__price-current {
	display: block;
	max-width: 100%;
	border-radius: var(--radius-sm, 8px);
}

.product-card--loading .product-card__title-link {
	min-height: calc(var(--product-card-title-row-height) + var(--product-card-title-row-height));
}

.product-card--loading .product-card__category {
	width: 60%;
	min-height: var(--product-card-category-row-height);
}

.product-card--loading .product-card__price-regular {
	width: 54px;
}

.product-card--loading .product-card__price-current {
	width: 92px;
}

.product-card--loading .product-card__badges,
.product-card--loading .product-card__stock,
.product-card--loading .product-card__cart {
	visibility: hidden;
}

.product-card__badges {
	position: absolute;
	z-index: 2;
	top: 14px;
	left: 13px;
	display: flex;
	flex-wrap: wrap;
	gap: var(--product-card-badge-gap);
	max-width: calc(100% - 88px);
}

.product-card__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--product-card-badge-min-height);
	padding: var(--product-card-badge-padding);
	color: var(--color-background);
	font-size: var(--product-card-badge-size);
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
	background: var(--color-badge-accent);
	border-radius: var(--radius-md, 20px);
}

.product-card__cart {
	position: absolute;
	z-index: 3;
	top: 14px;
	right: var(--space-sm, 8px);
}

.product-card__stock {
	position: absolute;
	z-index: 2;
	bottom: var(--space-sm, 8px);
	left: 12px;
	display: inline-flex;
	gap: var(--space-xs, 4px);
	align-items: center;
	max-width: calc(100% - 24px);
	min-height: 25px;
	padding: var(--product-card-stock-padding);
	color: var(--color-text);
	font-size: var(--product-card-stock-size);
	font-weight: 400;
	line-height: 1.5;
	white-space: nowrap;
	background: var(--color-stock-in-background);
	border-radius: var(--radius-md, 20px);
}

.product-card__stock--out {
	background: var(--color-stock-out-background);
}

.product-card__stock-dot {
	flex: 0 0 9px;
	width: 9px;
	height: 9px;
	background: var(--color-stock-in-dot);
	border-radius: 50%;
}

.product-card__stock--out .product-card__stock-dot {
	background: var(--color-stock-out-dot);
}

.product-card__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--product-card-content-gap);
	min-width: 0;
}

.product-card__header {
	display: grid;
	gap: 0;
	min-width: 0;
	min-height: calc(var(--product-card-title-row-height) + var(--product-card-title-row-height) + var(--product-card-category-row-height));
}

.product-card__footer {
	display: flex;
	gap: var(--space-sm, 8px);
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-width: 0;
	margin-top: auto;
	container-type: inline-size;
}

.product-card__title,
.product-card__category,
.product-card__price {
	margin: 0;
}

.product-card__title {
	color: var(--color-text);
	font-size: var(--product-card-title-size);
	font-weight: 600;
	line-height: var(--product-card-title-row-height);
	min-height: calc(var(--product-card-title-row-height) + var(--product-card-title-row-height));
}

.product-card__title-link {
	display: -webkit-box;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.product-card__category {
	color: var(--color-text-muted);
	font-size: var(--product-card-category-size);
	font-weight: 400;
	line-height: var(--product-card-category-row-height);
	min-height: var(--product-card-category-row-height);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.product-card__price {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--product-card-price-gap);
	align-items: center;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	color: var(--color-text);
	line-height: 1.5;
	white-space: nowrap;
}

.product-card__price-regular {
	flex: 0 0 auto;
	color: var(--color-text-muted);
	font-size: var(--product-card-price-regular-size);
	font-weight: 300;
	text-decoration: line-through;
	white-space: nowrap;
}

.product-card__price-regular .amount,
.product-card__price-current .amount {
	white-space: nowrap;
}

.product-card__price-current {
	flex: 0 0 auto;
	min-width: 0;
	overflow: visible;
	color: var(--color-text);
	font-size: var(--product-card-price-current-size);
	font-weight: 600;
	text-decoration: none;
	text-overflow: clip;
	white-space: nowrap;
}

.product-card__price-current--compact-md {
	font-size: var(--font-size-md, 18px);
}

.product-card__price-current--compact-base {
	font-size: var(--font-size-base, 16px);
}

.product-card__price-current--compact-sm {
	font-size: var(--font-size-sm, 14px);
}

.product-card__price-current--compact-xs {
	font-size: var(--font-size-xs, 12px);
}

.product-card__price-current .woocommerce-Price-currencySymbol,
.product-card__price-regular .woocommerce-Price-currencySymbol {
	margin-left: 2px;
}

.product-card:active .product-card__media-wrap {
	border-color: var(--color-card-hover-border);
	box-shadow: var(--shadow-card-hover);
}

@media (hover: hover) {
	.product-card:hover .product-card__media-wrap,
	.product-card:focus-within .product-card__media-wrap {
		border-color: var(--color-card-hover-border);
		box-shadow: var(--shadow-card-hover);
	}

	.product-card__media-link:hover .product-card__image {
		transform: scale(1.1);
	}

	.product-card__cart-toggle:not([disabled]):hover {
		box-shadow: none;
	}

	.product-card__title-link:hover {
		color: var(--color-secondary);
	}
}

@supports (font-size: 1cqi) {
	.product-card__media-wrap {
		--product-card-badge-size: clamp(var(--font-size-xs, 12px), 6cqi, var(--font-size-base, 16px));
		--product-card-badge-min-height: clamp(var(--space-lg, 24px), 14cqi, calc(var(--space-md, 16px) * 2));
		--product-card-badge-padding:
			clamp(calc(var(--space-xs, 4px) * 0.5), 1cqi, var(--space-xs, 4px))
			clamp(var(--space-sm, 8px), 5cqi, calc(var(--space-sm, 8px) + var(--space-xs, 4px)));
	}

	.product-card__footer {
		--product-card-price-regular-size: clamp(var(--font-size-xs, 12px), 6cqi, var(--font-size-sm, 14px));
		--product-card-price-current-size: clamp(var(--font-size-md, 18px), 10cqi, var(--font-size-lg, 24px));
	}
}

@media (max-width: 767px) {
	.product-card {
		--product-card-title-size: var(--font-size-md, 18px);
		--product-card-title-row-height: 27px;
		--product-card-category-size: var(--font-size-sm, 14px);
		--product-card-category-row-height: 21px;
		--product-card-price-regular-size: var(--font-size-sm, 14px);
		--product-card-price-current-size: var(--font-size-lg, 24px);
		--product-card-price-gap: var(--space-xs, 4px);
		--product-card-badge-size: var(--font-size-base, 16px);
		--product-card-stock-size: var(--font-size-sm, 14px);
		--product-card-media-height: 270px;
		--product-card-media-aspect: auto;
		--product-card-bottom-gap: var(--space-sm, 8px);
		--product-card-content-gap: var(--space-xs, 4px);
		width: min(100%, 350px);
	}

	.product-card__badges {
		flex-direction: column;
	}

	.product-card__cart {
		position: absolute;
		top: 14px;
		right: var(--space-sm, 8px);
	}

	.product-card__cart-toggle.paltaja-cart-toggle {
		width: 48px;
		padding-right: 12px;
		padding-left: 12px;
	}

	.product-card__cart-toggle .paltaja-cart-toggle__icon {
		flex-basis: 24px;
		width: 24px;
		height: 24px;
	}

	.product-card__cart-toggle .paltaja-cart-toggle__label {
		display: none;
	}

	.product-card__footer {
		gap: var(--space-xs, 4px);
		align-items: center;
	}

	.product-card__price {
		flex: 1 1 auto;
	}
}

@media (max-width: 424px) {
	.product-card__footer {
		--product-card-price-regular-size: clamp(var(--font-size-xs, 12px), 3.5vw, var(--font-size-sm, 14px));
		--product-card-price-current-size: clamp(var(--font-size-md, 18px), 5.5vw, var(--font-size-lg, 24px));
	}

	.product-card__cart {
		position: static;
		flex: 0 0 auto;
	}

	.product-card__cart-toggle.paltaja-cart-toggle {
		gap: clamp(6px, calc(2.952px + 0.762vw), 10px);
		display: grid;
		grid-template-columns: 24px minmax(0, 1fr);
		justify-content: flex-start;
		align-content: center;
		align-items: center;
		width: 132px;
		min-width: 132px;
		height: 36px;
		padding: var(--space-xs, 4px) 12px;
	}

	.product-card__cart-toggle .paltaja-cart-toggle__label {
		flex: 1 1 auto;
		display: inline;
		font-size: var(--font-size-sm, 14px);
		line-height: 1;
		text-align: center;
	}

	.product-card__header,
	.product-card__title {
		min-height: 0;
	}
}

@media (max-width: 350px) {
	.product-card__footer {
		flex-direction: column;
		gap: 12px;
		align-items: stretch;
	}

	.product-card__cart {
		width: 100%;
	}

	.product-card__cart-toggle.paltaja-cart-toggle {
		grid-template-columns: 24px auto;
		justify-content: center;
		width: 100%;
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.product-card__media-wrap::before,
	.product-card__media-wrap,
	.product-card__image {
		animation: none;
		transition: none;
	}
}

/* Opacity pulse – composited on the GPU (animating background-position is not). */
@keyframes product-card-skeleton {
	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.55;
	}
}
