/* Vecas Katalog – style zgodne z projektem graficznym.
   Font dziedziczony z motywu (Divi / ustawienia globalne). Kolory jako zmienne. */

.vk-katalog {
	--vk-accent: #D60010;
	--vk-accent-hover: #B8000D;
	--vk-text: #1A1A1A;
	--vk-text-muted: #6B6B6B;
	--vk-card-bg: #F4F4F4;
	--vk-card-border: #FFFFFF;
	--vk-check-border: #C4C4C4;
	--vk-tile-from: #FFFFFF;
	--vk-tile-to: #E8E8E8;
	--vk-radius-card: 16px;
	--vk-radius-tile: 8px;
	--vk-radius-btn: 4px;
	--vk-sidebar: 300px;
	--vk-gap: 40px;

	font-family: inherit;
	color: var(--vk-text);
	line-height: 1.5;
	box-sizing: border-box;
}

.vk-katalog *,
.vk-katalog *::before,
.vk-katalog *::after {
	box-sizing: inherit;
}

/* ---------- Nagłówek sekcji ---------- */

.vk-katalog .vk-heading {
	margin: 0 0 32px;
	padding: 0;
	font-size: 32px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--vk-text);
}

/* ---------- Kafelki podkategorii ---------- */

.vk-subcats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin: 0 0 64px;
}

.vk-subcat {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 96px;
	padding: 12px 16px;
	border-radius: var(--vk-radius-tile);
	background: linear-gradient(90deg, var(--vk-tile-from) 0%, var(--vk-tile-to) 100%);
	color: var(--vk-text);
	text-decoration: none;
	transition: box-shadow .15s ease;
}

.vk-subcat:hover,
.vk-subcat:focus-visible {
	color: var(--vk-text);
	text-decoration: none;
	box-shadow: 0 0 0 2px var(--vk-accent);
	outline: none;
}

.vk-subcat__image {
	flex: 0 0 90px;
	width: 90px;
	height: 72px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vk-subcat__image img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.vk-subcat__name {
	font-size: 16px;
	line-height: 1.3;
}

/* ---------- Układ filtry + siatka ---------- */

.vk-layout {
	display: grid;
	grid-template-columns: var(--vk-sidebar) minmax(0, 1fr);
	gap: var(--vk-gap);
	align-items: start;
}

.vk-katalog--no-filters .vk-layout {
	grid-template-columns: minmax(0, 1fr);
}

/* ---------- Filtry ---------- */

.vk-filters {
	margin: 0;
	padding: 1rem;
	background-color: #F4F2F3;
	border: 1px solid var(--vk-card-border);
	border-radius: var(--vk-radius-card);
}

.vk-filters__head,
.vk-filters__foot,
.vk-filter-toggle,
.vk-drawer-overlay {
	display: none;
}

.vk-filter-group {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.vk-filter-group__label {
	display: block;
	margin: 0 0 12px;
	padding: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.3px;
	color: var(--vk-text);
}

.vk-check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 40px;
	margin: 0;
	padding: 0;
	cursor: pointer;
	font-size: 16px;
	font-weight: 400;
	color: var(--vk-text);
	user-select: none;
}

.vk-check input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
	white-space: nowrap;
}

.vk-check__box {
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	border: 1px solid var(--vk-check-border);
	border-radius: 6px;
	background: #fff;
	position: relative;
	transition: background .12s ease, border-color .12s ease;
}

.vk-check__box::after {
	content: "";
	position: absolute;
	left: 8px;
	top: 4px;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
}

.vk-check input:checked + .vk-check__box {
	background: var(--vk-accent);
	border-color: var(--vk-accent);
}

.vk-check input:checked + .vk-check__box::after {
	opacity: 1;
}

.vk-check input:focus-visible + .vk-check__box {
	box-shadow: 0 0 0 3px rgba(214, 0, 16, .25);
}

.vk-check:hover .vk-check__box {
	border-color: var(--vk-text-muted);
}

.vk-filters__clear {
	display: none;
	margin: 0 0 8px;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 14px;
	color: var(--vk-text-muted);
	text-decoration: underline;
	cursor: pointer;
}

.vk-filters.is-active .vk-filters__clear {
	display: inline-block;
}

.vk-filters__clear:hover,
.vk-filters__clear:focus-visible {
	color: var(--vk-accent);
	outline: none;
}

/* ---------- Siatka produktów ---------- */

.vk-grid-wrap {
	min-width: 0;
	transition: opacity .15s ease;
}

.vk-grid-wrap[aria-busy="true"] {
	opacity: .5;
	pointer-events: none;
}

.vk-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
}

.vk-grid--empty {
	grid-template-columns: minmax(0, 1fr);
}

.vk-empty {
	margin: 0;
	padding: 24px 0;
	font-size: 16px;
	color: var(--vk-text-muted);
}

.vk-card {
	display: flex;
	flex-direction: column;
	padding: 16px;
	border: 1px solid var(--vk-card-border);
	border-radius: var(--vk-radius-card);
	background: var(--vk-card-bg);
}

.vk-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	margin: 0 0 20px;
	overflow: hidden;
}

.vk-card__image img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.vk-card__title {
	margin: 0 0 8px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--vk-text);
}

.vk-card__title a {
	color: inherit;
	text-decoration: none;
}

.vk-card__title a:hover,
.vk-card__title a:focus-visible {
	color: var(--vk-accent);
	outline: none;
}

.vk-card__desc {
	margin: 0 0 20px;
	padding: 0;
	font-size: 16px;
	line-height: 1.5;
	color: var(--vk-text-muted);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.vk-card__btn {
	margin-top: auto;
}

/* ---------- Przycisk ---------- */

.vk-katalog .vk-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 12px 20px;
	border: 0;
	border-radius: var(--vk-radius-btn);
	background: var(--vk-accent);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background .12s ease;
}

.vk-katalog .vk-btn:hover,
.vk-katalog .vk-btn:focus-visible {
	background: var(--vk-accent-hover);
	color: #fff;
	outline: none;
}

.vk-katalog .vk-btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(214, 0, 16, .3);
}

/* ---------- Responsywność ---------- */

@media (max-width: 980px) {
	.vk-subcats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin-bottom: 48px;
	}

	.vk-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}

	.vk-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	/* Przycisk otwierający wysuwany panel filtrów. */
	.vk-filter-toggle {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		margin: 0 0 20px;
		padding: 10px 16px;
		border: 1px solid var(--vk-check-border);
		border-radius: var(--vk-radius-btn);
		background: #fff;
		color: var(--vk-text);
		font: inherit;
		font-size: 16px;
		line-height: 1.2;
		cursor: pointer;
	}

	.vk-filter-toggle:focus-visible {
		outline: none;
		box-shadow: 0 0 0 3px rgba(214, 0, 16, .25);
	}

	.vk-filter-toggle__icon {
		width: 18px;
		height: 14px;
		background:
			linear-gradient(var(--vk-text), var(--vk-text)) 0 0 / 100% 2px no-repeat,
			linear-gradient(var(--vk-text), var(--vk-text)) 50% 6px / 60% 2px no-repeat,
			linear-gradient(var(--vk-text), var(--vk-text)) 50% 12px / 25% 2px no-repeat;
	}

	.vk-filter-toggle__count:not(:empty) {
		min-width: 22px;
		padding: 2px 7px;
		border-radius: 11px;
		background: var(--vk-accent);
		color: #fff;
		font-size: 13px;
		text-align: center;
	}

	/* Panel wysuwany z lewej. */
	.vk-filters {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 100000;
		width: min(360px, 88vw);
		padding: 0 24px 24px;
		overflow-y: auto;
		background: #fff;
		box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
		transform: translateX(-105%);
		transition: transform .25s ease;
		visibility: hidden;
	}

	.vk-filters.is-open {
		transform: translateX(0);
		visibility: visible;
	}

	.vk-filters__head {
		position: sticky;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0 -24px 24px;
		padding: 20px 24px;
		background: #fff;
		border-bottom: 1px solid #EDEDED;
	}

	.vk-filters__title {
		font-size: 18px;
		font-weight: 700;
	}

	.vk-filters__close {
		position: relative;
		width: 32px;
		height: 32px;
		padding: 0;
		border: 0;
		background: none;
		cursor: pointer;
	}

	.vk-filters__close::before,
	.vk-filters__close::after {
		content: "";
		position: absolute;
		left: 50%;
		top: 50%;
		width: 18px;
		height: 2px;
		background: var(--vk-text);
		transform: translate(-50%, -50%) rotate(45deg);
	}

	.vk-filters__close::after {
		transform: translate(-50%, -50%) rotate(-45deg);
	}

	.vk-filters__foot {
		display: block;
		position: sticky;
		bottom: 0;
		margin: 16px -24px -24px;
		padding: 16px 24px;
		background: #fff;
		border-top: 1px solid #EDEDED;
	}

	.vk-drawer-overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 99999;
		background: rgba(0, 0, 0, .45);
		opacity: 0;
		visibility: hidden;
		transition: opacity .25s ease;
	}

	.vk-drawer-overlay.is-open {
		opacity: 1;
		visibility: visible;
	}

	body.vk-drawer-open {
		overflow: hidden;
	}
}

@media (max-width: 600px) {
	.vk-subcats,
	.vk-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.vk-katalog .vk-heading {
		font-size: 26px;
		margin-bottom: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vk-katalog *,
	.vk-katalog *::before,
	.vk-katalog *::after {
		transition: none !important;
	}
}
