/*
 * Kahur Catalog — product filter.
 * Lives in Nest's slide-in panel (.filter_side_content, opened by the
 * "Filtrovat" button). Same tokens / WCAG choices as kahur-checkout:
 * navy text, #1E7A50 behind white button text, mint surfaces.
 */

.kcf,
.kcf-chips {
	--kcf-bg: #ffffff;
	--kcf-surface: var(--background-2, #f4f6fa);
	--kcf-soft: var(--background-3, #def9ec);
	--kcf-border: #e3e8ee;
	--kcf-field: #8a94a6;
	--kcf-text: var(--color-heading, #253d4e);
	--kcf-body: #3d4f5e;
	--kcf-muted: #5d6b78;
	--kcf-accent: var(--color-brand-dark, #29a56c);
	--kcf-strong: #1e7a50;
	--kcf-stronger: #17603f;
	--kcf-heading: var(--font-heading, "Quicksand", sans-serif);
}

.kcf *, .kcf *::before, .kcf *::after { box-sizing: border-box; }

/* ---- Panel shell (Nest's .filter_side_content) ------------------------- */

.filter_side_content:has(.kcf) {
	width: 420px;
	max-width: 100%;
	padding: 0 !important;
	overflow: hidden !important;
	box-shadow: -12px 0 40px rgba(37, 61, 78, .14);
}

.filter_side_content:has(.kcf) > .close-style { display: none !important; }
.filter_side_content:has(.kcf) .content { height: 100%; }
.filter_side_content:has(.kcf) .sidebar-widget { height: 100%; margin: 0 !important; }
.filter_side_content:has(.kcf) .sidebar-widget .widget_box { height: 100%; }

.kcf {
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	color: var(--kcf-body);
	font-size: 15px;
}

.kcf .kcf__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex: 0 0 auto;
	padding: 18px 20px 16px 24px;
	border-bottom: 1px solid var(--kcf-border);
}

.kcf .kcf__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-family: var(--kcf-heading);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--kcf-text);
}

.kcf .kcf__count,
.kcf-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	border-radius: 11px;
	background: var(--kcf-strong);
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
}

.kcf .kcf__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--kcf-surface);
	color: var(--kcf-text);
	cursor: pointer;
	transition: background-color .15s ease;
}

.kcf .kcf__close:hover { background: var(--kcf-border); }

.kcf .kcf__body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 24px 24px;
}

.kcf .kcf__foot {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	padding: 14px 20px 18px 24px;
	border-top: 1px solid var(--kcf-border);
	background: var(--kcf-bg);
}

/* ---- Sections ------------------------------------------------------- */

.kcf .kcf__section { padding: 20px 0; border-bottom: 1px solid var(--kcf-border); }
.kcf .kcf__section:last-child { border-bottom: 0; }

.kcf .kcf__label {
	margin: 0 0 12px;
	font-family: var(--kcf-heading);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--kcf-text);
}

.kcf .kcf__label small { font-family: inherit; font-size: 13px; font-weight: 500; color: var(--kcf-muted); }

.kcf .kcf__n {
	margin-left: auto;
	padding-left: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--kcf-muted);
	font-variant-numeric: tabular-nums;
}

/* Active chips (panel top + above the product grid) */
.kcf .kcf__active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 0 4px; }

.kcf-chip,
.kcf a.kcf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	padding: 4px 8px 4px 12px;
	border-radius: 999px;
	background: var(--kcf-soft);
	font-size: 13px !important;
	font-weight: 600;
	line-height: 1.3 !important;
	color: var(--kcf-text) !important;
	text-decoration: none !important;
	transition: background-color .15s ease;
}

.kcf-chip span { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(37, 61, 78, .08); font-size: 14px; line-height: 1; }
.kcf-chip:hover { background: #c9f0dc; }
.kcf .kcf__clear, .kcf-chips__clear { font-size: 13px; font-weight: 600; color: var(--kcf-strong) !important; text-decoration: underline; text-underline-offset: 3px; }

.kcf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; margin: 0 0 20px; }
.kcf-chips.kcf-chips--row { clear: both; margin: 16px 0 20px; }
.kcf .kcf__clear, .kcf-chips__clear { font-size: 13px !important; }

/* Subcategories */
.kcf .kcf__links { margin: 0; padding: 0; list-style: none; }

/* Nest styles every widget list (li padding/borders, inline links). */
.kcf ul li { margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; line-height: 1.35; }
.kcf ul li::before, .kcf ul li::after { content: none !important; display: none !important; }

.kcf .kcf__links a {
	display: flex !important;
	align-items: center;
	min-height: 40px;
	padding: 8px 10px;
	margin: 0 -10px;
	border-radius: 10px;
	color: var(--kcf-body);
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

.kcf .kcf__links a:hover { background: var(--kcf-surface); color: var(--kcf-text); }

/* Brand checkboxes */
.kcf .kcf__search {
	width: 100%;
	height: 40px;
	margin: 0 0 10px;
	padding: 0 12px;
	border: 1px solid var(--kcf-field);
	border-radius: 8px;
	font-size: 15px;
	color: var(--kcf-text);
}

.kcf .kcf__checks { margin: 0; padding: 0; list-style: none; }
.kcf .kcf__checks li { margin: 0; }
.kcf .kcf__checks .kcf__more-item { display: none; }
.kcf .kcf__checks.is-open .kcf__more-item,
.kcf .kcf__checks.is-searching .kcf__more-item { display: block; }
.kcf .kcf__checks li[hidden] { display: none !important; }

.kcf .kcf__check,
.kcf .kcf__switch {
	position: relative;
	display: flex !important;
	align-items: center;
	gap: 12px;
	min-height: 40px;
	margin: 0 -10px;
	padding: 8px 10px;
	border-radius: 10px;
	cursor: pointer;
	color: var(--kcf-body);
	transition: background-color .15s ease;
}

.kcf .kcf__check:hover,
.kcf .kcf__switch:hover { background: var(--kcf-surface); }
.kcf .kcf__check.is-empty { opacity: .55; }

.kcf .kcf__check input,
.kcf .kcf__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }

.kcf .kcf__box {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border: 1.5px solid var(--kcf-field);
	border-radius: 6px;
	background: var(--kcf-bg);
	transition: background-color .15s ease, border-color .15s ease;
}

.kcf .kcf__check input:checked + .kcf__box {
	border-color: var(--kcf-strong);
	background: var(--kcf-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.kcf .kcf__check input:checked ~ .kcf__name { font-weight: 700; color: var(--kcf-text); }
.kcf .kcf__check input:focus-visible + .kcf__box,
.kcf .kcf__switch input:focus-visible + .kcf__switch-ui { outline: 2px solid var(--kcf-accent); outline-offset: 2px; }

.kcf .kcf__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kcf .kcf__more {
	margin: 8px 0 0;
	padding: 6px 0;
	border: 0;
	background: none;
	font-size: 14px;
	font-weight: 700;
	color: var(--kcf-strong);
	cursor: pointer;
}

.kcf .kcf__more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Switches (skladem / akce) */
.kcf .kcf__switch-ui {
	position: relative;
	flex: 0 0 auto;
	width: 40px;
	height: 24px;
	border-radius: 12px;
	background: #c5cdd6;
	transition: background-color .15s ease;
}

.kcf .kcf__switch-ui::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	transition: transform .15s ease;
}

.kcf .kcf__switch input:checked + .kcf__switch-ui { background: var(--kcf-strong); }
.kcf .kcf__switch input:checked + .kcf__switch-ui::after { transform: translateX(16px); }
.kcf .kcf__switch input:checked ~ .kcf__switch-text { font-weight: 700; color: var(--kcf-text); }

/* Price */
.kcf .kcf__range { position: relative; height: 28px; margin: 4px 10px 12px; }

.kcf .kcf__track { position: absolute; top: 12px; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--kcf-border); }
.kcf .kcf__fill { position: absolute; top: 0; height: 100%; border-radius: 2px; background: var(--kcf-strong); }

.kcf input.kcf__thumb {
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	min-height: 0 !important;
	height: 28px !important;
	outline: none;
}

.kcf .kcf__thumb {
	position: absolute;
	top: 0;
	left: -10px;
	width: calc(100% + 20px);
	height: 28px;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.kcf .kcf__thumb::-webkit-slider-runnable-track { background: none; border: 0; }
.kcf .kcf__thumb::-moz-range-track { background: none; border: 0; }

.kcf .kcf__thumb::-webkit-slider-thumb {
	width: 22px;
	height: 22px;
	border: 2px solid var(--kcf-strong);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(37, 61, 78, .2);
	cursor: grab;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
}

.kcf .kcf__thumb::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border: 2px solid var(--kcf-strong);
	border-radius: 50%;
	background: #fff;
	cursor: grab;
	pointer-events: auto;
}

.kcf .kcf__prices { display: flex; align-items: flex-end; gap: 10px; }
.kcf .kcf__dash { padding-bottom: 12px; color: var(--kcf-muted); }

.kcf .kcf__price { position: relative; display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; margin: 0; font-size: 12px; font-weight: 600; color: var(--kcf-muted); }

.kcf .kcf__price input {
	width: 100%;
	height: 44px !important;
	min-height: 0 !important;
	line-height: 42px !important;
	box-shadow: none !important;
	padding: 0 34px 0 12px;
	border: 1px solid var(--kcf-field) !important;
	border-radius: 8px !important;
	background: var(--kcf-bg);
	font-size: 16px;
	font-weight: 600;
	color: var(--kcf-text);
	-moz-appearance: textfield;
}

.kcf .kcf__price input::-webkit-outer-spin-button,
.kcf .kcf__price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kcf .kcf__price input:focus { outline: none; border-color: var(--kcf-accent) !important; box-shadow: 0 0 0 3px rgba(41, 165, 108, .22); }
.kcf .kcf__cur { position: absolute; right: 12px; bottom: 0; height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--kcf-muted); }

/* Footer buttons */
.kcf .kcf__reset {
	flex: 0 0 auto;
	padding: 12px 6px;
	font-size: 15px;
	font-weight: 700;
	color: var(--kcf-text) !important;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.kcf .kcf__reset.is-hidden { visibility: hidden; }

.kcf .kcf__submit {
	flex: 1 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 12px 20px;
	border: 0;
	border-radius: 10px;
	background: var(--kcf-strong);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	transition: background-color .15s ease, opacity .15s ease;
}

.kcf .kcf__submit:hover { background: var(--kcf-stronger); }
.kcf .kcf__submit:disabled { background: #9aa6b2; cursor: not-allowed; }
.kcf .kcf__submit.is-loading { opacity: .75; }

/* Badge on Nest's toolbar "Filtrovat" button */
.nest_filter_btn.kcf-has-active { border-color: var(--color-brand-dark, #29a56c) !important; }
.nest_filter_btn .kcf-badge { margin-left: 6px; --kcf-strong: #1e7a50; }

@media (max-width: 575px) {
	.filter_side_content:has(.kcf) { width: 100%; }
	.kcf .kcf__head { padding: 14px 16px 12px 20px; }
	.kcf .kcf__body { padding: 0 20px 20px; }
	.kcf .kcf__foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)) 20px; }
}

/* Empty result with active filters */
.kcf-empty { margin: 8px 0 40px; padding: 28px; border: 1px dashed #c5cdd6; border-radius: 18px; background: var(--background-2, #f4f6fa); }
.kcf-empty .kcf-empty__text { margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--color-heading, #253d4e); }
.kcf-empty .kcf-empty__btn { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px; border-radius: 10px; background: #1e7a50; color: #fff !important; font-weight: 700; text-decoration: none !important; }
.kcf-empty .kcf-empty__btn:hover { background: #17603f; }
