/* DKLens: category cards on the shop and category pages.
 * Loaded with dklens-catalog.css on catalog pages. 18.10.2026 */

/* --- Woodmart category cards in LIST view --------------------------------
 * The list view puts the loop in one column so product rows span the full
 * width. Category cards get caught by that too and become huge full-width
 * blocks. Keep them in a grid of their own; product rows still span the row. */
body.dklens-view-list .wd-products:has(> .category-grid-item) {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 20px !important;
}
body.dklens-view-list .wd-products:has(> .category-grid-item) > .wd-col {
	width: auto !important;
	max-width: none !important;
}
body.dklens-view-list .wd-products:has(> .category-grid-item) > .wd-col:not(.category-grid-item) {
	grid-column: 1 / -1;
}
@media (max-width: 768px) {
	body.dklens-view-list .wd-products:has(> .category-grid-item) {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 12px !important;
	}
}

/* --- DKLens tile template (woocommerce/content-product_cat.php) -----------
 * Used where WooCommerce renders category tiles through the child template. */
:is(ul, div).products:has(> li.dklens-tile) {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
	margin: 0 0 30px;
	padding: 0;
	list-style: none;
}

li.dklens-tile {
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
	width: auto !important;
	max-width: none !important;
	float: none !important;
}

.dklens-tile__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid #e8e8ec;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.dklens-tile__link:hover {
	border-color: var(--dklens-orange, #ff6a00);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
	transform: translateY(-2px);
}

.dklens-tile__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	padding: 16px;
	background: #f4f5f7;
}

.dklens-tile__media img,
.dklens-tile__img {
	width: 100% !important;
	height: 100% !important;
	max-height: none;
	object-fit: contain;
}

.dklens-tile__placeholder {
	width: 55%;
	aspect-ratio: 1;
	border-radius: 8px;
	background: #e8e8ec;
}

.dklens-tile__name {
	display: block;
	padding: 14px 16px;
	color: #1b1b1f;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .02em;
	text-transform: uppercase;
	transition: color .2s ease;
}

.dklens-tile__link:hover .dklens-tile__name {
	color: var(--dklens-orange, #ff6a00);
}

@media (max-width: 600px) {
	:is(ul, div).products:has(> li.dklens-tile) {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	.dklens-tile__media {
		padding: 10px;
	}
	.dklens-tile__name {
		padding: 10px 12px;
		font-size: 13px;
	}
}
