/**
 * Kittels shop — Filter / Sort drawers (Figma reference).
 */

/* ——— Hide legacy Elementor filter column (content moved to custom drawer) ——— */
body.kittels-shop-archive-ui .elementor-element-7393410,
body.kittels-shop-archive-ui .elementor-element-70c3c27 {
	display: none !important;
}

/* ——— Toolbar: only Filter + Sort buttons ——— */
body.kittels-shop-archive-ui .wd-content-area .elementor-element-8f8486a {
	display: flex !important;
	align-items: center !important;
	width: 100% !important;
	gap: 0 !important;
}

body.kittels-shop-archive-ui .wd-content-area .elementor-element-8f8486a {
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 0 !important;
}

body.kittels-shop-archive-ui .kittels-shop-toolbar {
	display: flex !important;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 16px;
	padding: 8px 0 20px;
	box-sizing: border-box;
}

body.kittels-shop-archive-ui .wd-content-area .elementor-element-e408112 {
	flex: 0 0 auto !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	position: absolute !important;
	clip: rect(0, 0, 0, 0);
	pointer-events: none;
	opacity: 0;
}

body.kittels-shop-archive-ui .wd-content-area .elementor-element-e408112 select.orderby {
	pointer-events: auto;
}

body.kittels-shop-archive-ui .elementor-element-afa474f {
	display: none !important;
}

body.kittels-shop-archive-ui .elementor-element-6e7b4c6 {
	flex: 0 0 auto !important;
	width: auto !important;
	margin-left: auto !important;
}

/* Tool buttons (icon + label, no chevron) */
body.kittels-shop-archive-ui .kittels-shop-tool-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	color: #1d1f1e;
	-webkit-appearance: none;
	appearance: none;
}

body.kittels-shop-archive-ui .kittels-shop-tool-btn__icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

body.kittels-shop-archive-ui .kittels-shop-tool-btn--filter .kittels-shop-tool-btn__icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 18 18'%3E%3Cpath stroke='%231d1f1e' stroke-linecap='round' stroke-width='1.2' d='M3 5h12M5 9h8M7 13h4'/%3E%3C/svg%3E");
}

body.kittels-shop-archive-ui .kittels-shop-tool-btn--sort .kittels-shop-tool-btn__icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 18 18'%3E%3Cpath stroke='%231d1f1e' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.2' d='M4 3v12M4 14l-2.5-2.5M4 14l2.5-2.5M14 15V3M14 4l2.5 2.5M14 4L11.5 6.5'/%3E%3C/svg%3E");
}

body.kittels-shop-archive-ui .elementor-element-e408112 select.orderby,
body.kittels-shop-archive-ui .elementor-element-e408112 .woocommerce-ordering::before,
body.kittels-shop-archive-ui .elementor-element-e408112 .woocommerce-ordering::after {
	display: none !important;
}

body.kittels-shop-archive-ui .elementor-element-6e7b4c6 .woocommerce-ordering {
	position: relative;
	margin: 0 !important;
	width: auto !important;
	min-height: 0 !important;
	background: transparent !important;
	border: 0 !important;
}

body.kittels-shop-archive-ui .elementor-element-6e7b4c6 select.orderby {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	clip: rect(0, 0, 0, 0);
}

/* ——— Overlay ——— */
body.kittels-shop-archive-ui .kittels-shop-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	z-index: 510;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

body.kittels-shop-archive-ui .kittels-shop-overlay.is-visible {
	opacity: 1;
	visibility: visible;
}

/* ——— Shared panel head ——— */
body.kittels-shop-archive-ui .kittels-panel-head,
body.kittels-shop-archive-ui .kittels-filter-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	padding: 0 0 16px;
	margin: 0 0 8px;
	border-bottom: 1px solid #e8e8e8;
}

body.kittels-shop-archive-ui .kittels-panel-title {
	font-family: inherit;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.02em;
	color: #1d1f1e;
}

body.kittels-shop-archive-ui .kittels-panel-close {
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	cursor: pointer;
	position: relative;
	padding: 0;
}

body.kittels-shop-archive-ui .kittels-panel-close::before,
body.kittels-shop-archive-ui .kittels-panel-close::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 18px;
	height: 1.5px;
	background: #1d1f1e;
	transform: translate(-50%, -50%) rotate(45deg);
}

body.kittels-shop-archive-ui .kittels-panel-close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

/* ——— Filter drawer (left) ——— */
body.kittels-shop-archive-ui .kittels-filter-drawer {
	position: fixed;
	top: 0;
	left: 0;
	width: min(480px, 94vw);
	height: 100%;
	max-height: 100dvh;
	background: #fff;
	z-index: 520;
	padding: 32px 32px 28px;
	font-family: inherit;
	box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
	transform: translateX(-100%);
	transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	overflow: hidden;
}

body.kittels-shop-archive-ui .kittels-filter-drawer.is-open {
	transform: translateX(0);
}

body.kittels-shop-archive-ui .kittels-filter-drawer__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	scroll-behavior: smooth;
}

body.kittels-shop-archive-ui.kittels-filter-open,
body.kittels-shop-archive-ui.kittels-sort-open {
	overflow: hidden;
}

/* WoodMart nested scroll: лише поза нашим скрол-контейнером */
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-scroll:not(.kittels-filter-panel-scroll),
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-scroll-content {
	max-height: none !important;
	height: auto !important;
	overflow: visible !important;
}

/* Без hover-dropdown WoodMart у drawer (лише акордеон) */
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes .wd-pf-dropdown.wd-dropdown {
	position: static !important;
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	transform: none !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-product-filters {
	display: block !important;
	width: 100%;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes {
	display: block !important;
	width: 100% !important;
	border-bottom: 1px solid #e5e5e5;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-title {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	padding: 22px 0 !important;
	margin: 0 !important;
	cursor: pointer;
	font-family: inherit;
	font-size: 17px;
	font-weight: 500;
	color: #1d1f1e;
	text-transform: none !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-title::after {
	content: "+";
	font-size: 22px;
	font-weight: 300;
	line-height: 1;
	border: 0 !important;
	position: static !important;
	transform: rotate(0deg);
	transition: transform 0.32s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.2s ease;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .kittels-acc-open > .wd-pf-title::after {
	content: "+";
	transform: rotate(45deg);
}

/* Плавне відкриття акордеона (без display:none) */
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-dropdown {
	display: grid !important;
	grid-template-rows: 0fr;
	position: static !important;
	box-shadow: none !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	transform: none !important;
	overflow: hidden;
	transition: grid-template-rows 0.38s cubic-bezier(0.19, 1, 0.22, 1), padding 0.38s cubic-bezier(0.19, 1, 0.22, 1);
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-dropdown > .wd-scroll:not(.kittels-filter-panel-scroll) {
	min-height: 0;
	overflow: hidden;
}

/* Матеріал — прибрано з каталогу (п.13), лишається на картці товару */
body.kittels-shop-archive-ui .wd-pf-checkboxes:has(input[name="filter_material"]),
body.kittels-shop-archive-ui .wd-product-filters .wd-pf-checkboxes:has(input[name="filter_material"]) {
	display: none !important;
}

/* Єдиний внутрішній скрол для Розмір / Колір */
body.kittels-shop-archive-ui .kittels-filter-drawer .kittels-acc-open > .wd-pf-dropdown > .wd-scroll.kittels-filter-panel-scroll {
	min-height: 0 !important;
	max-height: min(300px, 46vh) !important;
	height: auto !important;
	overflow-x: hidden !important;
	overflow-y: scroll !important;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: rgba(29, 31, 30, 0.22) rgba(0, 0, 0, 0.06);
	padding-right: 4px;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .kittels-acc-open > .wd-pf-dropdown > .kittels-filter-panel-scroll .wd-scroll-content {
	overflow: visible !important;
	max-height: none !important;
	height: auto !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .kittels-acc-open > .wd-pf-dropdown > .kittels-filter-panel-scroll::-webkit-scrollbar {
	width: 5px;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .kittels-acc-open > .wd-pf-dropdown > .kittels-filter-panel-scroll::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.06);
}

body.kittels-shop-archive-ui .kittels-filter-drawer .kittels-acc-open > .wd-pf-dropdown > .kittels-filter-panel-scroll::-webkit-scrollbar-thumb {
	background: rgba(29, 31, 30, 0.22);
	border-radius: 4px;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .kittels-acc-open > .wd-pf-dropdown > .kittels-filter-panel-scroll::-webkit-scrollbar-thumb:hover {
	background: rgba(29, 31, 30, 0.35);
}

body.kittels-shop-archive-ui .kittels-filter-drawer .kittels-acc-open > .wd-pf-dropdown {
	grid-template-rows: 1fr;
	padding: 4px 0 28px !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-title .wd-pf-results {
	display: none !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-swatches-filter.wd-layout-list {
	display: flex !important;
	flex-direction: column;
	gap: 12px;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_material"]) .wd-swatches-filter > li {
	margin: 0 !important;
	list-style: none;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_material"]) a.pf-value {
	display: block;
	padding: 2px 0;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.45;
	color: #1d1f1e;
	text-decoration: none;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_material"]) a.pf-value .wd-filter-lable {
	white-space: normal;
	word-break: break-word;
}

/* Колір + Розмір: 4 колонки, квадрати як на картці товару / PDP */
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) .wd-swatches-filter,
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) .wd-swatches-filter {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px 10px;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) .wd-swatches-filter > li,
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) .wd-swatches-filter > li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) .wd-swatches-filter > li > a.pf-value {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	gap: 8px;
	text-decoration: none;
	color: #1d1f1e;
}

/* ——— Колір: квадрат заливки + назва знизу ——— */
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) .wd-swatch.wd-bg {
	width: 28px !important;
	height: 28px !important;
	min-width: 28px !important;
	min-height: 28px !important;
	padding: 0 !important;
	border-radius: 0 !important;
	border: 1px solid #1d1f1e !important;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
	overflow: hidden;
	display: inline-flex !important;
	box-sizing: border-box;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) .wd-swatch-bg {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	border-radius: 0 !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) .wd-swatch.wd-bg .wd-swatch-text {
	display: none !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) a.pf-value .wd-filter-lable.layer-term-lable {
	display: block !important;
	font-size: 11px;
	font-weight: 400;
	line-height: 1.25;
	color: #1d1f1e;
	max-width: 100%;
	white-space: normal;
	word-break: break-word;
	margin: 0;
	padding: 0;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) a.pf-value:not(:has(.wd-swatch))::before {
	content: "";
	display: block;
	width: 28px;
	height: 28px;
	border-radius: 0;
	background: #d4d4d4;
	border: 1px solid #1d1f1e;
	flex-shrink: 0;
	box-sizing: border-box;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) a.pf-value.wd-active .wd-swatch.wd-bg,
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_kolir"]) li.wd-active a.pf-value .wd-swatch.wd-bg {
	outline: 1px solid #1d1f1e;
	outline-offset: 2px;
}

/* ——— Розмір: рівна сітка 4×, квадрат з підписом всередині ——— */
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) .wd-swatches-filter > li {
	display: flex;
	justify-content: center;
	align-items: flex-start;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) .wd-swatches-filter > li > a.pf-value {
	display: inline-flex !important;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 54px;
	height: 54px;
	min-height: 54px;
	margin: 0;
	padding: 4px;
	border: 1px solid #e3e3e3;
	background: #fff;
	box-sizing: border-box;
	text-decoration: none;
	color: #1d1f1e;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.15;
	text-align: center;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) .wd-swatch.wd-text {
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	display: inline !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) .wd-swatch.wd-text .wd-swatch-text {
	display: inline !important;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
	padding: 0 !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) a.pf-value:has(.wd-swatch) .wd-filter-lable.layer-term-lable {
	display: none !important;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) a.pf-value:not(:has(.wd-swatch)) .wd-filter-lable.layer-term-lable {
	display: block !important;
	margin: 0;
	padding: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.wd-active > a.pf-value,
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) a.pf-value.wd-active {
	border-color: #1d1f1e !important;
	box-shadow: inset 0 0 0 1px #1d1f1e !important;
}

/* Універсальний — текст на всю ширину, без квадрата */
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.kittels-filter-size--text,
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.wd-pf-universalnyj {
	grid-column: 1 / -1;
	justify-content: flex-start;
	margin-top: 4px;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.kittels-filter-size--text > a.pf-value,
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.wd-pf-universalnyj > a.pf-value {
	width: auto;
	max-width: none;
	height: auto;
	min-height: 0;
	padding: 10px 0 2px;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	justify-content: flex-start;
	font-size: 15px;
	font-weight: 400;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.kittels-filter-size--text > a.pf-value .wd-filter-lable,
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.wd-pf-universalnyj > a.pf-value .wd-filter-lable {
	display: block !important;
}

/* Довгі позначки (ХXL) — трохи менший шрифт у квадраті */
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.wd-pf-hxl > a.pf-value,
body.kittels-shop-archive-ui .kittels-filter-drawer .wd-pf-checkboxes:has(input[name="filter_rozmir"]) li.wd-pf-hhxl > a.pf-value {
	font-size: 12px;
	padding: 2px;
}

body.kittels-shop-archive-ui .kittels-filter-drawer .pf-value {
	font-size: 15px;
	font-weight: 400;
	color: #1d1f1e;
}

/* ——— Sort drawer (right) ——— */
body.kittels-shop-archive-ui .kittels-sort-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: min(480px, 94vw);
	height: 100%;
	max-height: 100dvh;
	background: #fff;
	z-index: 520;
	padding: 32px 32px 28px;
	font-family: inherit;
	box-shadow: -4px 0 32px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	overflow: hidden;
}

body.kittels-shop-archive-ui .kittels-sort-panel.is-open {
	transform: translateX(0);
}

body.kittels-shop-archive-ui .kittels-sort-options {
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

body.kittels-shop-archive-ui .kittels-sort-options label {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 0;
	cursor: pointer;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	color: #1d1f1e;
	border-bottom: 1px solid #efefef;
}

body.kittels-shop-archive-ui .kittels-sort-options input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: #1d1f1e;
}
