/* ==========================================================================
   DKLens catalog — Trodo-style category tiles + product list/grid rows
   Loaded on shop and product archives only (see functions.php).
   ========================================================================== */

:root {
	--dklens-orange: #FF5A00;
	--dklens-ink: #111111;
	--dklens-muted: #666666;
	--dklens-line: #E5E5E5;
	--dklens-bg: #F7F8F9;
}

/* --- Wrapper resets: neutralise the theme's own loop grid ---------------- */
.dklens-catalog ul.products,
.dklens-catalog .wd-products,
.dklens-catalog .products {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.dklens-catalog ul.products::before,
.dklens-catalog ul.products::after {
	display: none !important;
}

/* --- Category tiles ------------------------------------------------------ */
.dklens-catalog .products:has(.dklens-tile) {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.dklens-tile {
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
	width: auto !important;
	background: #fff;
	border: 1px solid var(--dklens-line);
	border-radius: 4px;
	transition: border-color .2s ease;
}

.dklens-tile:hover {
	border-color: #B5B5B5;
}

.dklens-tile__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	padding: 20px 16px 18px;
	text-decoration: none;
}

.dklens-tile__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 130px;
	overflow: hidden;
}

.dklens-tile__img,
.dklens-tile img {
	max-width: 100%;
	max-height: 130px;
	width: auto !important;
	height: auto;
	object-fit: contain;
	mix-blend-mode: multiply;
	transition: transform .4s ease;
}

.dklens-tile:hover .dklens-tile__img {
	transform: scale(1.03);
}

.dklens-tile__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--dklens-bg);
	border-radius: 4px;
}

.dklens-tile__name {
	margin-top: 16px;
	color: var(--dklens-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	text-align: center;
}

/* --- Toolbar ------------------------------------------------------------- */
.dklens-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.dklens-toolbar__count {
	font-size: 13px;
	color: var(--dklens-muted);
}

.dklens-toolbar__views {
	display: flex;
	margin-left: auto;
	border: 1px solid var(--dklens-line);
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
}

.dklens-toolbar__views a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 36px;
	color: var(--dklens-muted);
	text-decoration: none;
}

.dklens-toolbar__views a.is-active {
	background: var(--dklens-ink);
	color: #fff;
}

.dklens-toolbar__views svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* --- Product item: shared ------------------------------------------------ */
.dklens-item {
	position: relative;
	background: #fff;
	border: 1px solid var(--dklens-line);
	border-radius: 6px;
	padding: 20px;
	margin: 0 0 12px !important;
	width: auto !important;
	float: none !important;
	list-style: none;
}

.dklens-item__brand {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--dklens-line);
	border-radius: 3px;
	padding: 3px 7px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #444;
}

.dklens-item__thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 12px;
}

.dklens-item__thumb img {
	max-height: 160px;
	width: auto !important;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.dklens-item__title {
	display: block;
	color: var(--dklens-ink);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

.dklens-item__title:hover {
	color: var(--dklens-orange);
}

.dklens-item__oem {
	font-weight: 500;
	color: var(--dklens-muted);
}

.dklens-item__tags {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.dklens-tag {
	display: inline-flex;
	padding: 3px 7px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	background: #EFEFEF;
	color: #555;
}

.dklens-tag--best {
	background: #0F7B4F;
	color: #fff;
}

.dklens-item__id {
	font-size: 12px;
	color: #9A9A9A;
}

.dklens-item__specs {
	margin: 14px 0 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.dklens-item__specs li {
	margin: 0 0 5px;
	font-size: 13px;
	line-height: 1.4;
	list-style: none;
}

.dklens-item__specs li span {
	color: var(--dklens-muted);
}

.dklens-item__specs li strong {
	color: var(--dklens-ink);
	font-weight: 600;
}

.dklens-item__more {
	margin-top: 4px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--dklens-orange);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.dklens-item__price {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.1;
	color: var(--dklens-ink);
}

.dklens-item__price del {
	font-size: 15px;
	font-weight: 500;
	color: #9A9A9A;
}

.dklens-item__vat {
	margin: 6px 0 0 !important;
	font-size: 11.5px;
	color: #9A9A9A;
}

.dklens-item__stock {
	margin: 10px 0 0 !important;
	font-size: 12.5px;
	color: var(--dklens-muted);
}

.dklens-item__stock.is-in::before,
.dklens-item__stock.is-out::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 7px;
	border-radius: 50%;
	vertical-align: middle;
}

.dklens-item__stock.is-in::before {
	background: #16A34A;
}

.dklens-item__stock.is-out::before {
	background: #9CA3AF;
}

.dklens-item__cart {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}

.dklens-item__cart select {
	width: 66px;
	height: 42px;
	padding: 0 8px;
	border: 1px solid var(--dklens-line);
	border-radius: 4px;
	background: #fff;
	font-size: 13px;
}

.dklens-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	height: 42px;
	padding: 0 18px;
	border: 0;
	border-radius: 4px;
	background: var(--dklens-orange);
	color: #fff !important;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: filter .2s ease;
}

.dklens-btn:hover {
	filter: brightness(1.06);
}

.dklens-btn--ghost {
	background: #fff;
	border: 1px solid var(--dklens-line);
	color: var(--dklens-ink) !important;
}

.dklens-item__legal {
	display: inline-block;
	margin-top: 12px;
	font-size: 12px;
	color: #9A9A9A;
	text-decoration: none;
}

.dklens-item__legal:hover {
	color: var(--dklens-muted);
}

/* --- List view ----------------------------------------------------------- */
.dklens-view-list .dklens-item {
	display: grid;
	grid-template-columns: 210px minmax(0, 1fr) 250px;
	gap: 24px;
	align-items: start;
}

.dklens-view-list .dklens-item__buy {
	border-left: 1px solid #F0F0F0;
	padding-left: 20px;
}

/* --- Grid view ----------------------------------------------------------- */
.dklens-view-grid .products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.dklens-view-grid .dklens-item {
	display: flex;
	flex-direction: column;
	margin-bottom: 0 !important;
}

.dklens-view-grid .dklens-item__specs,
.dklens-view-grid .dklens-item__more,
.dklens-view-grid .dklens-item__legal,
.dklens-view-grid .dklens-item__vat {
	display: none !important;
}

.dklens-view-grid .dklens-item__buy {
	margin-top: auto;
	padding-top: 14px;
}

.dklens-view-grid .dklens-item__price {
	font-size: 19px;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1024px) {
	.dklens-catalog .products:has(.dklens-tile),
	.dklens-view-grid .products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.dklens-view-list .dklens-item {
		grid-template-columns: 160px minmax(0, 1fr);
	}

	.dklens-view-list .dklens-item__buy {
		grid-column: 1 / -1;
		border-left: 0;
		padding-left: 0;
		border-top: 1px solid #F0F0F0;
		padding-top: 16px;
	}
}

@media (max-width: 767px) {
	.dklens-catalog .products:has(.dklens-tile),
	.dklens-view-grid .products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.dklens-tile__media {
		height: 100px;
	}

	.dklens-tile__img,
	.dklens-tile img {
		max-height: 100px;
	}

	.dklens-view-list .dklens-item {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.dklens-item {
		padding: 16px;
	}
}

/* --- Small phones (<=480px) ---------------------------------------------- */
@media (max-width: 480px) {
	.dklens-catalog .products:has(.dklens-tile),
	.dklens-view-grid .products {
		gap: 10px;
	}

	.dklens-item {
		padding: 11px;
	}

	.dklens-item__title {
		font-size: 12.5px;
	}

	.dklens-item__oem {
		font-size: 11px;
	}

	.dklens-view-grid .dklens-item__price,
	.dklens-item__price {
		font-size: 16px;
	}

	.dklens-item__stock {
		font-size: 11px;
	}

	.dklens-view-grid .dklens-item__buy {
		padding-top: 10px;
	}

	.dklens-tile__media {
		height: 84px;
	}

	.dklens-tile__img,
	.dklens-tile img {
		max-height: 84px;
	}
}
