/**
 * Lafka product card — mobile-first list-row layout.
 *
 * Mobile (default):  1-col list, 92px image-left + body-right.
 * Desktop (>=768px): 2-col grid, 120px image-left + body-right per card.
 *
 * @package Lafka
 * @since   5.17.0
 */

.products.columns-1,
.products.columns-2,
.products.columns-3,
.products.columns-4,
.products.columns-5,
.products.columns-6,
ul.products {
	display: flex;
	flex-direction: column;
	gap: 10px;
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}

.lafka-product-card {
	display: grid;
	grid-template-columns: 92px 1fr;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	transition: box-shadow 0.15s ease;
	width: 100%;
	margin: 0;
}

.lafka-product-card:hover,
.lafka-product-card:focus-within {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.lafka-product-card__link {
	display: contents;
	color: inherit;
	text-decoration: none;
}

.lafka-product-card__img-wrap {
	width: 92px;
	height: 92px;
	background: #f5f5f5;
	overflow: hidden;
	position: relative;
}

.lafka-product-card__img {
	width: 92px;
	height: 92px;
	object-fit: cover;
	display: block;
}

.lafka-product-card__img--fallback {
	object-fit: contain;
	padding: 16px;
}

.lafka-product-card__body {
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 92px;
	min-width: 0; /* allow text-overflow inside grid cell */
}

.lafka-product-card__head {
	min-width: 0;
}

.lafka-product-card__title {
	margin: 0 0 2px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: #1a1a1a;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.lafka-product-card__desc {
	margin: 0;
	font-size: 12px;
	line-height: 1.3;
	color: #6a6a6a;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.lafka-product-card__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 6px;
}

.lafka-product-card__price {
	font-size: 15px;
	font-weight: 700;
	color: var(--lafka-primary, currentColor);
	white-space: nowrap;
}

.lafka-product-card__price del {
	color: #999;
	font-weight: 500;
	margin-right: 4px;
	font-size: 13px;
}

.lafka-product-card__price ins {
	text-decoration: none;
}

/* Sale flash positioning inside the image wrap. */
.lafka-product-card__img-wrap .onsale {
	position: absolute;
	top: 6px;
	left: 6px;
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 8px;
	z-index: 1;
}

/* Desktop: switch to a multi-column grid of cards (cards still list-row internally). */
@media (min-width: 768px) {
	.products.columns-1,
	.products.columns-2,
	.products.columns-3,
	.products.columns-4,
	.products.columns-5,
	.products.columns-6,
	ul.products {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
		gap: 16px;
	}

	.lafka-product-card {
		grid-template-columns: 120px 1fr;
	}

	.lafka-product-card__img-wrap,
	.lafka-product-card__img {
		width: 120px;
		height: 120px;
	}

	.lafka-product-card__body {
		min-height: 120px;
	}
}
