.kk-frontend-foundation.woocommerce ul.products[class*="columns-"],
.kk-frontend-foundation .woocommerce ul.products[class*="columns-"] {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	gap: 18px !important;
	align-items: stretch;
}

.kk-frontend-foundation.woocommerce ul.products li.product,
.kk-frontend-foundation .woocommerce ul.products li.product {
	float: none !important;
	width: auto !important;
	min-width: 0;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 14px !important;
	align-items: stretch;
	text-align: left;
	border: 1px solid #eceef1;
	border-radius: 8px;
}

.kk-frontend-foundation .woocommerce ul.products li.product > a.woocommerce-LoopProduct-link,
.kk-frontend-foundation.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link {
	align-items: stretch;
}

.kk-frontend-foundation .woocommerce ul.products li.product img,
.kk-frontend-foundation.woocommerce ul.products li.product img {
	width: 100% !important;
	height: 190px !important;
	max-width: 240px;
	object-fit: contain;
	margin: 0 auto 12px !important;
}

.kk-frontend-foundation .woocommerce ul.products li.product .woocommerce-loop-product__title,
.kk-frontend-foundation.woocommerce ul.products li.product .woocommerce-loop-product__title {
	display: block;
	min-height: 0;
	max-height: none;
	overflow: visible;
	margin: 0 0 10px !important;
	padding: 0 !important;
	font-size: 1rem;
	line-height: 1.35;
	font-weight: 800;
}

.kk-product-card__specs {
	display: grid;
	gap: 6px;
	margin: 0 0 10px;
}

.kk-product-card__specs > div {
	display: grid;
	grid-template-columns: minmax(82px, 0.8fr) minmax(0, 1.4fr);
	gap: 8px;
	font-size: 0.875rem;
	line-height: 1.3;
}

.kk-product-card__specs dt {
	font-weight: 700;
	color: var(--kk-muted);
}

.kk-product-card__specs dd {
	min-width: 0;
	margin: 0;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.kk-product-card__stock {
	margin: 0 0 8px;
	font-size: 0.875rem;
	font-weight: 800;
}

.kk-product-card__stock .stock {
	margin: 0;
}

.kk-frontend-foundation .woocommerce ul.products li.product .price,
.kk-frontend-foundation.woocommerce ul.products li.product .price {
	min-height: 0;
	margin: 4px 0 12px !important;
	font-size: 1.1rem;
	font-weight: 900;
}

.kk-frontend-foundation .woocommerce ul.products li.product .custom-cart-btn,
.kk-frontend-foundation.woocommerce ul.products li.product .custom-cart-btn {
	justify-content: stretch !important;
}

.kk-frontend-foundation .woocommerce ul.products li.product .button,
.kk-frontend-foundation.woocommerce ul.products li.product .button {
	width: 100% !important;
	min-height: 48px;
	font-size: 0.9375rem !important;
	color: #111 !important;
}

.kk-frontend-foundation .woocommerce ul.products li.product .compare.button,
.kk-frontend-foundation.woocommerce ul.products li.product .compare.button,
.kk-frontend-foundation .woocommerce ul.products li.product .compare.button .label,
.kk-frontend-foundation.woocommerce ul.products li.product .compare.button .label {
	color: #111 !important;
}

.kk-frontend-foundation .woocommerce ul.products li.product .custom-cart-btn a.product_type_simple.add_to_cart_button.ajax_add_to_cart {
	font-size: 0.9375rem !important;
}

.kk-frontend-foundation .woocommerce ul.products li.product .custom-cart-btn a.product_type_simple.add_to_cart_button.ajax_add_to_cart::before {
	content: none !important;
}

/*
 * Compatibility product cards deliberately preserve the parent grid, images,
 * theme settings and Additional CSS. Only the approved card flow is corrected.
 */
.kk-product-cards.woocommerce ul.products li.product.type-product,
.kk-product-cards .woocommerce ul.products li.product.type-product {
	height: 100%;
	min-width: 0;
	align-items: stretch;
}

.kk-product-cards.woocommerce ul.products li.product.type-product > a.woocommerce-LoopProduct-link,
.kk-product-cards .woocommerce ul.products li.product.type-product > a.woocommerce-LoopProduct-link {
	min-width: 0;
	flex: 1 1 auto;
}

.kk-product-cards.woocommerce ul.products li.product.type-product .woocommerce-loop-product__title,
.kk-product-cards .woocommerce ul.products li.product.type-product .woocommerce-loop-product__title {
	display: -webkit-box;
	min-height: calc(4 * 1.25em);
	max-height: calc(4 * 1.25em);
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
}

.kk-product-cards .kk-product-card__status {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	font-size: 0.8125rem;
	line-height: 1.35;
	font-weight: 800;
	color: #205c28;
}

.kk-product-cards .kk-product-card__status .stock {
	display: inline;
	margin: 0;
}

.kk-product-cards.woocommerce ul.products li.product.type-product .custom-cart-btn,
.kk-product-cards .woocommerce ul.products li.product.type-product .custom-cart-btn {
	width: 100% !important;
	margin-top: auto;
	justify-content: stretch !important;
}

.kk-product-cards.woocommerce ul.products li.product.type-product .custom-cart-btn .button,
.kk-product-cards .woocommerce ul.products li.product.type-product .custom-cart-btn .button {
	width: 100% !important;
	min-height: 44px;
	margin: 0 !important;
	font-size: 0.8125rem !important;
	color: #111 !important;
}

/* Best Shop inserts a second, empty product link inside the CTA container. */
.kk-product-cards.woocommerce ul.products li.product.type-product .custom-cart-btn > a.woocommerce-LoopProduct-link,
.kk-product-cards .woocommerce ul.products li.product.type-product .custom-cart-btn > a.woocommerce-LoopProduct-link {
	display: none !important;
}

.kk-product-cards.woocommerce ul.products li.product.type-product .custom-cart-btn a.product_type_simple.add_to_cart_button.ajax_add_to_cart,
.kk-product-cards .woocommerce ul.products li.product.type-product .custom-cart-btn a.product_type_simple.add_to_cart_button.ajax_add_to_cart {
	font-size: 0.8125rem !important;
}

.kk-product-cards.woocommerce ul.products li.product.type-product .custom-cart-btn a.product_type_simple.add_to_cart_button.ajax_add_to_cart::before,
.kk-product-cards .woocommerce ul.products li.product.type-product .custom-cart-btn a.product_type_simple.add_to_cart_button.ajax_add_to_cart::before {
	content: none !important;
}

.kk-product-cards.woocommerce ul.products li.product.type-product .hover-area,
.kk-product-cards .woocommerce ul.products li.product.type-product .hover-area,
.kk-product-cards.woocommerce ul.products li.product.type-product .action-buttons,
.kk-product-cards .woocommerce ul.products li.product.type-product .action-buttons,
.kk-product-cards.woocommerce ul.products li.product.type-product .compare-button,
.kk-product-cards .woocommerce ul.products li.product.type-product .compare-button {
	display: block !important;
	position: static !important;
	width: 100% !important;
	height: auto !important;
	margin: 0 !important;
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
}

.kk-product-cards.woocommerce ul.products li.product.type-product a.compare.button,
.kk-product-cards .woocommerce ul.products li.product.type-product a.compare.button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	min-height: 44px;
	margin: 8px 0 0 !important;
	padding: 8px 10px !important;
	border: 1px solid #f47700 !important;
	border-radius: 3px;
	background: transparent !important;
	color: #a6480d !important;
	font-size: 0.8125rem !important;
	font-weight: 800;
	line-height: 1.2 !important;
}

.kk-product-cards.woocommerce ul.products li.product.type-product a.compare.button:hover,
.kk-product-cards .woocommerce ul.products li.product.type-product a.compare.button:hover,
.kk-product-cards.woocommerce ul.products li.product.type-product a.compare.button:focus-visible,
.kk-product-cards .woocommerce ul.products li.product.type-product a.compare.button:focus-visible {
	background: #fff4eb !important;
	color: #7f3509 !important;
}

.kk-product-cards.woocommerce ul.products li.product.type-product a.compare.button:focus-visible,
.kk-product-cards .woocommerce ul.products li.product.type-product a.compare.button:focus-visible {
	outline: 3px solid #111;
	outline-offset: 2px;
}

/* Keep YITH's comparison popup readable and removable on touch screens. */
@media (max-width: 480px) {
	.kk-product-cards .yith-woocompare-popup-container .DTFC_LeftWrapper,
	.kk-product-cards .yith-woocompare-popup-container .dataTables_scrollHead,
	.kk-product-cards .yith-woocompare-popup-container .dataTables_scrollFoot {
		display: none !important;
	}

	.kk-product-cards .yith-woocompare-popup-container .DTFC_ScrollWrapper,
	.kk-product-cards .yith-woocompare-popup-container .dataTables_scroll,
	.kk-product-cards .yith-woocompare-popup-container .dataTables_scrollBody {
		width: 100% !important;
		height: auto !important;
		overflow: visible !important;
	}

	.kk-product-cards #yith-woocompare table.dataTable.compare-list,
	.kk-product-cards #yith-woocompare table.dataTable.compare-list tbody {
		display: block !important;
		width: 100% !important;
	}

	.kk-product-cards #yith-woocompare table.dataTable.compare-list tbody tr {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100% !important;
	}

	.kk-product-cards #yith-woocompare table.dataTable.compare-list tbody th:not(.filler) {
		display: block !important;
		grid-column: 1 / -1;
		min-width: 0 !important;
		width: auto !important;
		max-width: none !important;
		font-size: 0.75rem !important;
	}

	.kk-product-cards #yith-woocompare table.dataTable.compare-list tbody td:not(.filler) {
		display: block !important;
		min-width: 0 !important;
		width: auto !important;
		max-width: none !important;
		padding-inline: 10px !important;
	}

	.kk-product-cards #yith-woocompare table.dataTable.compare-list tbody td:not(.filler):first-of-type:nth-last-child(2) {
		grid-column: 1 / -1;
	}

	.kk-product-cards #yith-woocompare table.compare-list .image-wrap .image-overlay {
		display: block !important;
		background: transparent !important;
		pointer-events: none;
	}

	.kk-product-cards #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a {
		display: block !important;
		position: absolute;
		top: 4px;
		right: 4px;
		bottom: auto;
		width: 32px;
		height: 32px;
		border: 1px solid #d7d7d7;
		border-radius: 50%;
		background: #fff;
		font-size: 0;
		line-height: 30px;
		pointer-events: auto;
	}

	.kk-product-cards #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a span {
		display: none !important;
	}

	.kk-product-cards #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::after {
		content: "\00D7";
		color: #333;
		font-size: 22px;
	}
}

@media (min-width: 600px) {
	.kk-frontend-foundation.woocommerce ul.products[class*="columns-"],
	.kk-frontend-foundation .woocommerce ul.products[class*="columns-"] {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (min-width: 960px) {
	.kk-frontend-foundation.woocommerce ul.products[class*="columns-"],
	.kk-frontend-foundation .woocommerce ul.products[class*="columns-"] {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

@media (min-width: 1440px) {
	.kk-frontend-foundation.woocommerce ul.products[class*="columns-"],
	.kk-frontend-foundation .woocommerce ul.products[class*="columns-"] {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}
}

/* Keep advisor recommendations aligned despite unequal title lengths and optional labels. */
body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products > li.product {
	display: flex !important;
	flex-direction: column;
	align-items: start;
	width: auto !important;
	min-width: 0;
	margin: 0 !important;
	padding: 32px 0 0;
	float: none !important;
	position: relative;
	text-align: center;
}

body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products > li.product > a {
	display: flex !important;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products .kk-product-advisor__result-label {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1;
	margin: 0;
}

body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products > li.product > a > img {
	display: block;
	width: 100% !important;
	height: 190px !important;
	margin: 0 !important;
	object-fit: contain;
}

body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products > li.product > a > h3 {
	min-height: 4.8em;
	margin: 0;
	color: #20242a;
	font-size: 0.9375rem;
	line-height: 1.35;
}

body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products > li.product > .price {
	align-self: center;
	margin: 8px 0 0;
}

@media (max-width: 959px) {
	body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 599px) {
	body.kk-frontend-foundation.woocommerce ul.kk-product-advisor-products {
		grid-template-columns: 1fr !important;
	}
}
