/* Category archive — filters sidebar + toolbar chips */

.kd-filters-sidebar {
	padding-right: 24px;
	border-right: 1px solid var(--line);
}

.kd-filters-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 20px;
}

.kd-filters-head-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.kd-filters-clear {
	color: var(--accent);
	font-size: 12px;
	text-decoration: underline;
}

.kd-filters-close {
	display: none;
	width: 32px;
	height: 32px;
	border: 1px solid var(--line);
	background: var(--paper);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
}

.kd-filter-group {
	padding-bottom: 20px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--line);
}

.kd-filter-group-label { color: var(--ink); margin-bottom: 12px; }

.kd-filter-price-row {
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
	font-size: 13px;
}

.kd-filter-price-num { font-size: 18px; }

.kd-filter-range { width: 100%; accent-color: var(--accent); }

.kd-filter-range-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	font-family: var(--mono);
	font-size: 10px;
	color: var(--muted);
	letter-spacing: .08em;
}

.kd-color-swatches {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 6px;
}

.kd-color-swatch {
	position: relative;
	aspect-ratio: 1;
	cursor: pointer;
}

.kd-color-swatch input { position: absolute; opacity: 0; pointer-events: none; }

.kd-color-swatch-dot {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 1px solid var(--line-2, var(--line));
	transition: border-color .15s, outline .15s;
}

.kd-color-swatch.is-active .kd-color-swatch-dot {
	border: 2px solid var(--ink);
	outline: 2px solid var(--bg);
	outline-offset: -4px;
}

.kd-color-swatch.is-disabled { opacity: .45; cursor: default; }

.kd-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.kd-filter-chip { cursor: pointer; }

.kd-filter-chip input { display: none; }

.kd-filter-chip span {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--ink);
	font-size: 12px;
	transition: background .12s, border-color .12s, color .12s;
}

.kd-filter-chip.is-active span,
.kd-filter-chip input:checked + span {
	border-color: var(--ink);
	background: var(--ink);
	color: var(--bg);
}

.kd-filter-checks { display: grid; gap: 6px; }

.kd-filter-brand-search {
	width: 100%;
	margin: 0 0 10px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	background: var(--paper);
	font-size: 13px;
	color: var(--ink);
}
.kd-filter-brand-search:focus {
	outline: 1px solid var(--accent);
	border-color: var(--accent);
}
.kd-filter-check-row.is-brand-collapsed { display: none; }
.kd-filter-group--brand.is-expanded .kd-filter-check-row.is-brand-collapsed { display: flex; }
.kd-filter-check-row.is-brand-nomatch { display: none !important; }
.kd-filter-brand-more {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 8px 0;
	background: none;
	border: 0;
	border-top: 1px dashed var(--line);
	cursor: pointer;
	color: var(--accent);
	text-align: left;
}
.kd-filter-group--brand.is-expanded .kd-filter-brand-more { display: none; }

.kd-filter-check-row {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	cursor: pointer;
	padding: 3px 0;
	color: var(--ink-2);
}

.kd-filter-check-row input { position: absolute; opacity: 0; pointer-events: none; }

.kd-filter-check-box {
	width: 16px;
	height: 16px;
	border: 1px solid var(--line-2, var(--line));
	background: transparent;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 3px;
	font-size: 10px;
	color: var(--bg);
}

.kd-filter-check-row input:checked + .kd-filter-check-box {
	background: var(--ink);
	border-color: var(--ink);
}

.kd-filter-check-row input:checked + .kd-filter-check-box::after {
	content: '✓';
}

.kd-filter-check-label { flex: 1; }

.kd-filters-submit,
.kd-filters-ai {
	width: 100%;
	justify-content: center;
	margin-top: 8px;
	display: flex;
}

.kd-category-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 0 20px;
	border-bottom: 1px solid var(--line);
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 16px;
}

.kd-category-toolbar-left {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}

.kd-category-count {
	font-family: var(--display);
	font-size: 24px;
	font-weight: 600;
	letter-spacing: -.03em;
}

.kd-filter-toggle {
	display: none;
	padding: 8px 14px;
	border: 1px solid var(--line);
	background: var(--paper);
	font-family: var(--sans);
	font-size: 13px;
	cursor: pointer;
	border-radius: 999px;
}

.kd-active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 16px;
}

.kd-active-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid var(--line);
	background: var(--bg-2);
	font-size: 12px;
	border-radius: 999px;
}

.kd-active-filter-chip button {
	border: none;
	background: transparent;
	cursor: pointer;
	color: var(--muted);
	font-size: 14px;
	line-height: 1;
	padding: 0;
}

.kd-filters-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(20, 17, 13, .45);
	z-index: 80;
}

.kd-filters-backdrop.is-open { display: block; }

#kd-product-grid {
	scroll-margin-top: 88px;
}
#kd-product-grid.is-loading { opacity: .5; pointer-events: none; }

@media (max-width: 1024px) {
	.kd-filter-toggle { display: inline-flex; }

	.kd-filters-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 90;
		width: min(320px, 88vw);
		background: var(--paper);
		padding: 24px 20px 32px;
		border-right: 1px solid var(--line);
		overflow-y: auto;
		transform: translateX(-105%);
		transition: transform .25s ease;
		box-shadow: 8px 0 32px rgba(0, 0, 0, .12);
	}

	.kd-filters-sidebar.is-open { transform: translateX(0); }

	.kd-filters-close { display: inline-flex; align-items: center; justify-content: center; }

	.kd-category-layout { grid-template-columns: 1fr !important; }
}

/* Recently viewed + poradnik */
.kd-cat-recent {
	padding: 56px 0;
	border-top: 1px solid var(--line);
}

.kd-cat-recent-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 20px;
	gap: 16px;
	flex-wrap: wrap;
}

.kd-cat-recent-title {
	font-size: 32px;
	margin: 8px 0 0;
}

.kd-cat-recent-clear {
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--accent);
	font-size: 13px;
	text-decoration: underline;
	font-family: var(--sans);
	padding: 0;
}

.kd-cat-recent-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.kd-cat-recent-card {
	display: flex;
	gap: 14px;
	padding: 12px;
	border: 1px solid var(--line);
	text-decoration: none;
	color: var(--ink);
	background: var(--paper);
}

.kd-cat-recent-thumb {
	width: 64px;
	height: 64px;
	flex-shrink: 0;
	background: var(--bg-2);
	overflow: hidden;
}

.kd-cat-recent-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kd-cat-recent-name {
	font-weight: 600;
	font-size: 14px;
	margin-top: 2px;
}

.kd-cat-recent-price {
	color: var(--accent);
	font-size: 18px;
	margin-top: 4px;
}

.kd-cat-guide {
	padding: 56px 0;
	background: var(--bg-2);
	border-top: 1px solid var(--line);
}

.kd-cat-guide-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	align-items: flex-start;
}

.kd-cat-guide-faq-more {
	margin: 24px 0 0;
	font-size: 13px;
}

.kd-cat-guide-faq-more a {
	color: var(--accent);
	text-decoration: none;
}

.kd-cat-guide-faq-more a:hover {
	text-decoration: underline;
}

/* Contact banner (non-AI categories) */
.kd-cat-contact {
	padding: 48px 0;
	background: var(--ink);
	color: #e0d8c4;
}

.kd-cat-contact-inner {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	gap: 48px;
	align-items: center;
}

.kd-cat-contact-label {
	color: var(--accent);
}

.kd-cat-contact-title {
	font-size: clamp(32px, 5vw, 52px);
	color: #f4efe6;
	margin: 12px 0 16px;
	line-height: 0.98;
	letter-spacing: -0.03em;
}

.kd-cat-contact-title em {
	color: var(--accent);
	font-style: italic;
}

.kd-cat-contact-lead {
	color: #9d977f;
	max-width: 42ch;
	font-size: 15px;
	line-height: 1.6;
	margin: 0;
}

.kd-cat-contact-card {
	background: #1f1c17;
	border: 1px solid #3a3630;
	padding: 28px 28px 24px;
}

.kd-cat-contact-card-head {
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.06em;
	color: #9d977f;
	margin-bottom: 20px;
}

.kd-cat-contact-rows {
	display: grid;
	gap: 16px;
	margin-bottom: 22px;
}

.kd-cat-contact-row {
	display: grid;
	grid-template-columns: 88px 1fr;
	gap: 12px;
	align-items: baseline;
	padding-bottom: 14px;
	border-bottom: 1px solid #2e2a24;
}

.kd-cat-contact-row:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.kd-cat-contact-row-label {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #9d977f;
}

.kd-cat-contact-row-value {
	font-size: 15px;
	color: #e0d8c4;
	text-decoration: none;
}

.kd-cat-contact-phone {
	font-size: 22px;
	font-weight: 600;
	color: #f4efe6;
	letter-spacing: -0.02em;
}

.kd-cat-contact-mail {
	color: var(--accent);
}

.kd-cat-contact-mail:hover {
	text-decoration: underline;
}

.kd-cat-contact-actions {
	display: flex;
	gap: 8px;
}

.kd-cat-contact-btn {
	flex: 1;
	justify-content: center;
	padding: 14px 18px;
	font-family: var(--sans);
}

.kd-cat-contact-btn--ghost {
	background: #2a2722;
	color: #e0d8c4;
	border: 1px solid #3a3630;
}

.kd-cat-contact-btn--ghost:hover {
	border-color: #5a554c;
	color: #f4efe6;
}

@media (max-width: 1024px) {
	.kd-cat-contact-inner {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}

@media (max-width: 480px) {
	.kd-cat-contact-row {
		grid-template-columns: 1fr;
		gap: 4px;
	}

	.kd-cat-contact-actions {
		flex-direction: column;
	}
}

.kd-cat-guide-title {
	font-size: 48px;
	margin: 12px 0 16px;
	line-height: 0.94;
	letter-spacing: -0.04em;
}

.kd-cat-guide-intro,
.kd-cat-guide-extra {
	color: var(--ink-2);
	font-size: 15px;
	line-height: 1.65;
}

.kd-cat-guide-extra {
	margin-top: 12px;
}

.kd-cat-guide-tips {
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 16px;
}

.kd-cat-guide-tips li {
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 16px;
}

.kd-cat-guide-tip-num {
	font-size: 28px;
	color: var(--accent);
	line-height: 1;
}

.kd-cat-guide-tip-title {
	font-family: var(--display);
	font-weight: 600;
	font-size: 17px;
	margin-bottom: 4px;
}

.kd-cat-guide-tip-text {
	color: var(--ink-2);
	font-size: 14px;
	line-height: 1.5;
}

.kd-cat-faq-list {
	margin-top: 16px;
	display: grid;
	gap: 1px;
	background: var(--line);
}

.kd-cat-faq-item {
	background: var(--paper);
	padding: 0;
}

.kd-cat-faq-item summary {
	padding: 16px 20px;
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	font-weight: 500;
	font-size: 14px;
}

.kd-cat-faq-item summary::-webkit-details-marker { display: none; }

.kd-cat-faq-plus {
	font-family: var(--mono);
	color: var(--accent);
	font-size: 18px;
	flex-shrink: 0;
}

.kd-cat-faq-answer {
	padding: 0 20px 16px;
	color: var(--ink-2);
	font-size: 13.5px;
	line-height: 1.6;
}

.kd-cat-guide-faq > .label {
	display: block;
}

.kd-cat-recent-price .label {
	font-size: 11px;
	letter-spacing: 0.12em;
	color: var(--muted);
}

/* Product cards — category grid */
.kd-cat-product-card {
	min-width: 0;
}

/* Stały kadr (ten sam dla cover i contain) — img absolute, żeby oryginał nie rozpychał rzędu. */
.kd-cat-product-media {
	aspect-ratio: 1 / 1.05;
	width: 100%;
	position: relative;
	overflow: hidden;
	background: #fff;
	box-sizing: border-box;
}

.kd-cat-product-media .kd-cat-product-img {
	position: absolute;
	inset: 12px;
	width: calc(100% - 24px);
	height: calc(100% - 24px);
	object-fit: contain;
	object-position: center;
	display: block;
}

/* Nawierzchnie (Polbruk / realizacje): wypełnij ten sam kadr */
.kd-cat-product-media.kd-media-cover {
	background: var(--bg-2);
}

.kd-cat-product-media.kd-media-cover .kd-cat-product-img {
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kd-cat-product-media .kd-media-placeholder {
	position: absolute;
	inset: 0;
	border: none;
}

.kd-cat-product-media .kd-media-placeholder.has-image {
	background: #fff;
}

.kd-cat-product-media.kd-media-cover .kd-media-placeholder.has-image {
	background: var(--bg-2);
}

.kd-cat-product-media .kd-media-placeholder-img {
	position: absolute;
	inset: 12px;
	width: calc(100% - 24px);
	height: calc(100% - 24px);
	object-fit: contain;
	object-position: center;
}

.kd-cat-product-media.kd-media-cover .kd-media-placeholder-img {
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kd-cat-product-rating {
	color: var(--accent-2);
	flex-shrink: 0;
}

.kd-omnibus-price,
.kd-cat-product-omnibus .kd-omnibus-price {
	font-family: var(--mono);
	font-size: 10px;
	line-height: 1.35;
	color: var(--muted);
	margin-top: 4px;
	text-align: right;
}

.kd-product-omnibus-wrap {
	margin: -12px 0 20px;
	max-width: 420px;
}

.kd-cat-product-card:hover .kd-product-hover {
	display: flex;
}

.kd-product-hover {
	display: none;
	position: absolute;
	inset: auto 12px 12px;
	gap: 6px;
	z-index: 2;
}

.kd-wishlist-toggle.is-active {
	color: var(--accent);
}

.kd-wishlist-toggle.is-active svg {
	fill: var(--accent);
	stroke: var(--accent);
}

.kd-wishlist-toggle svg {
	transition: fill 0.2s ease, stroke 0.2s ease, transform 0.2s ease;
}

.kd-product-hover-main {
	flex: 1;
	padding: 10px 12px;
	background: var(--ink);
	color: var(--bg);
	border: none;
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
}

.kd-product-hover-ai {
	width: 38px;
	height: 38px;
	border: 1px solid var(--line);
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--paper);
	color: var(--ink);
	text-decoration: none;
	font-size: 14px;
	flex-shrink: 0;
}

.kd-cat-product-footer {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px;
}

.kd-cat-product-swatches {
	display: flex;
	flex-direction: row;
	gap: 5px;
	align-items: center;
	flex-wrap: wrap;
	flex: 1 1 0;
	min-width: 0;
	overflow: hidden;
	padding-bottom: 2px;
}

.kd-cat-product-swatch {
	box-sizing: border-box;
	width: 28px;
	height: 28px;
	border-radius: 3px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	flex-shrink: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	background: transparent;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
}

.kd-cat-product-swatch-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 2px;
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
}

.kd-cat-product-omnibus {
	margin-top: 8px;
	text-align: right;
}

.kd-cat-product-omnibus-templates {
	display: none !important;
}

.kd-cat-product-swatch.is-active {
	border-color: var(--ink);
	box-shadow: 0 0 0 1px var(--ink);
}

.kd-cat-product-price-col {
	text-align: right;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-end;
	gap: 2px;
}

.kd-cat-product-price-val {
	font-size: 24px;
	color: var(--accent);
	line-height: 1;
}

.kd-cat-product-price-reg {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--muted);
	text-decoration: line-through;
}

.kd-cat-product-price-unit {
	font-size: 10px;
	color: var(--muted);
	font-family: var(--mono);
}

.kd-cat-product-swatch-more {
	align-self: center;
}

.kd-active-filter-chip {
	background: var(--ink);
	color: var(--bg);
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.06em;
	border-color: var(--ink);
}

@media (max-width: 900px) {
	.kd-cat-recent-grid { grid-template-columns: repeat(2, 1fr); }
	.kd-cat-guide-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 480px) {
	.kd-cat-recent-grid { grid-template-columns: 1fr; }
}

/* Archive pagination (shop / category) */
.kd-archive-pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}

.kd-archive-pagination-list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.kd-archive-pagination-item {
	margin: 0;
}

.kd-archive-pagination-list a,
.kd-archive-pagination-list span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--ink);
	text-decoration: none;
	font-family: var(--display);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	box-sizing: border-box;
}

.kd-archive-pagination-list a:hover {
	border-color: var(--ink);
}

.kd-archive-pagination-list span.current {
	background: var(--ink);
	color: var(--bg);
	border-color: var(--ink);
}

.kd-archive-pagination-list a.prev,
.kd-archive-pagination-list a.next {
	min-width: auto;
	padding: 0 14px;
	white-space: nowrap;
	font-family: var(--sans);
	font-size: 13px;
	font-weight: 500;
}
