/* =========================================================================
 * Invictus Style — Custom Filters
 * Fully integrated with Woodmart theme design tokens.
 *
 * Uses Woodmart CSS variables so the filters inherit brand colours, fonts,
 * radius and form styling automatically. Fallbacks match the current live
 * config: primary #ff0000, alt #fbbc34, Lato/Poppins, 0px radius, 42px form.
 * ========================================================================= */

.inv-filters {
	/* Bridge to Woodmart tokens */
	--inv-primary:  var(--wd-primary-color, #ff0000);
	--inv-accent:   var(--wd-alternative-color, #fbbc34);
	--inv-title:    var(--wd-title-color, #242424);
	--inv-text:     var(--wd-text-color, #767676);
	--inv-bg:       var(--wd-main-bgcolor, #fff);
	--inv-surface:  var(--color-gray-100, #f7f7f7);
	--inv-surface-2:var(--bgcolor-gray-200, #f1f1f1);
	--inv-border:   var(--wd-form-brd-color, rgba(0,0,0,0.1));
	--inv-border-2: var(--brdcolor-gray-500, rgba(0,0,0,0.2));
	--inv-border-focus: var(--wd-form-brd-color-focus, rgba(0,0,0,0.15));
	--inv-radius:   var(--wd-brd-radius, 0px);
	--inv-radius-form: var(--wd-form-brd-radius, 0px);
	--inv-form-h:   var(--wd-form-height, 42px);
	--inv-title-font: var(--wd-title-font, "Poppins", Arial, Helvetica, sans-serif);
	--inv-text-font:  var(--wd-text-font, "Lato", Arial, Helvetica, sans-serif);
	--inv-ease:     cubic-bezier(.2,.7,.2,1);
	--inv-ease-bounce: cubic-bezier(.34,1.56,.64,1);
	--inv-shadow:   0 24px 60px -12px rgba(0,0,0,.22), 0 8px 20px -8px rgba(0,0,0,.12);
	--inv-shadow-sm: 0 2px 8px rgba(0,0,0,.06);
	--inv-primary-soft: color-mix(in srgb, var(--inv-primary) 10%, transparent);

	font-family: var(--inv-text-font);
	color: var(--inv-text);
	box-sizing: border-box;
}
.inv-filters *,
.inv-filters *::before,
.inv-filters *::after { box-sizing: inherit; }
.inv-filters__sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* -------- Kill Woodmart's native archive chrome when our filter is present -- */
/* Two hooks: (a) body.invictus-filtered-archive set from PHP body_class filter
 * (works everywhere), and (b) :has(.inv-filters) fallback for pages where the
 * shortcode is placed manually (e.g. a custom page). */
body.invictus-filtered-archive .shop-sidebar,
body.invictus-filtered-archive .widget-area.shop-sidebar,
body.invictus-filtered-archive aside.shop-sidebar,
body.invictus-filtered-archive .sidebar-container,
body.invictus-filtered-archive .wd-sticky-sidebar-opener,
body.invictus-filtered-archive .wd-sidebar-opener,
body.invictus-filtered-archive .off-canvas-sidebar-wrapper,
body.invictus-filtered-archive .wd-shop-tools,
body.invictus-filtered-archive .woodmart-woocommerce-layered-nav,
body.invictus-filtered-archive .wd-active-filters,
body.invictus-filtered-archive .wd-shop-tools-container,
body.invictus-filtered-archive .wd-products-with-shop-loop-item,
body.invictus-filtered-archive .woocommerce > .woocommerce-result-count,
body.invictus-filtered-archive .woocommerce > .woocommerce-ordering,
body.invictus-filtered-archive .woocommerce-notices-wrapper + .woocommerce-result-count,
body.invictus-filtered-archive .term-description,
body:has(.inv-filters) .shop-sidebar,
body:has(.inv-filters) .widget-area.shop-sidebar,
body:has(.inv-filters) aside.shop-sidebar,
body:has(.inv-filters) .sidebar-container,
body:has(.inv-filters) .wd-sticky-sidebar-opener,
body:has(.inv-filters) .wd-sidebar-opener,
body:has(.inv-filters) .off-canvas-sidebar-wrapper,
body:has(.inv-filters) .wd-shop-tools,
body:has(.inv-filters) .woodmart-woocommerce-layered-nav,
body:has(.inv-filters) .wd-active-filters {
	display: none !important;
}
/* Expand main content to full width once sidebar is gone */
body.invictus-filtered-archive .site-content > .container > .row > .content-area,
body.invictus-filtered-archive .site-content .content-area,
body.invictus-filtered-archive .content-area.sidebar-container,
body:has(.inv-filters) .site-content .content-area {
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 100% !important;
}
body.invictus-filtered-archive .site-content .row,
body:has(.inv-filters) .site-content .row {
	display: block;
}
/* Woodmart sometimes wraps the shop in a fixed grid — reset. */
body.invictus-filtered-archive .site-content .container {
	max-width: 1400px;
}
/* Make sure the archive main column takes the full container width and our
 * filter+grid can stretch. Woodmart often narrows main.site-main on category
 * pages via row-with-sidebar; kill any leftover flex-basis. */
body.invictus-filtered-archive .site-main,
body.invictus-filtered-archive main.site-main,
body.invictus-filtered-archive .site-content,
body.invictus-filtered-archive .content-area {
	width: 100% !important;
	max-width: 100% !important;
	flex: 1 1 100% !important;
	float: none !important;
}
body.invictus-filtered-archive .inv-filters {
	width: 100%;
	max-width: 100%;
	display: block;
}

/* ============================================================================
 * Optimized layout per device — e-commerce industry standards
 * Reference: Amazon, Zalando, eBay, ASOS, H&M — all use GRID at every breakpoint
 * ----------------------------------------------------------------------------
 *   ≤ 479   (small phone)      → 2-col grid, drawer filter, compact tiles
 *   480-767 (large phone)      → 2-col grid, drawer filter, larger tiles
 *   768-1023 (tablet)          → 3-col grid, drawer filter
 *   1024-1279 (small laptop)   → 240px sidebar + 3-col grid
 *   1280-1439 (laptop)         → 260px sidebar + 4-col grid
 *   1440-1919 (desktop)        → 280px sidebar + 4-col grid, container 1400
 *   1920+   (large desktop)    → 300px sidebar + 4-col grid, container 1600
 * ============================================================================ */

/* ---- Container widths per real-world screen size ------------------------- */
@media (min-width: 1024px) {
	body.invictus-filtered-archive .container,
	body.invictus-filtered-archive .site-content > .container,
	body.invictus-filtered-archive .site-main > .container {
		max-width: 100% !important;
		padding-left: 12px !important;
		padding-right: 12px !important;
	}
}
@media (min-width: 1280px) {
	body.invictus-filtered-archive .container,
	body.invictus-filtered-archive .site-content > .container,
	body.invictus-filtered-archive .site-main > .container {
		max-width: 100% !important;
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
}
@media (min-width: 1440px) {
	body.invictus-filtered-archive .container,
	body.invictus-filtered-archive .site-content > .container,
	body.invictus-filtered-archive .site-main > .container {
		max-width: 1820px !important;
	}
}
@media (min-width: 1920px) {
	body.invictus-filtered-archive .container,
	body.invictus-filtered-archive .site-content > .container,
	body.invictus-filtered-archive .site-main > .container {
		max-width: 1980px !important;
	}
}

/* ---- Results container basics -------------------------------------------- */
.inv-results {
	min-width: 0;
	width: 100%;
}
.inv-results .wd-products-element,
.inv-results .wd-products-holder {
	width: 100% !important;
	max-width: 100% !important;
}
.inv-results .inv-results__grid {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
}

/* ---- Phone (< 480): 1-col list-style grid -------------------------------- */
@media (max-width: 479px) {
	.inv-results .wd-products-element > .products.wd-products {
		--wd-col-lg: 1 !important;
		--wd-col-md: 1 !important;
		--wd-col-sm: 1 !important;
		--wd-gap-lg: 12px !important;
		--wd-gap-sm: 12px !important;
	}
	.inv-results .wd-product .wd-entities-title {
		font-size: 14px !important;
		line-height: 1.3 !important;
	}
	.inv-results .wd-product .price {
		font-size: 15px !important;
	}
	.inv-results__meta { font-size: 13px; }
}

/* ---- Large phone (480-767): 1-col grid ----------------------------------- */
@media (min-width: 480px) and (max-width: 767px) {
	.inv-results .wd-products-element > .products.wd-products {
		--wd-col-lg: 1 !important;
		--wd-col-md: 1 !important;
		--wd-col-sm: 1 !important;
		--wd-gap-lg: 14px !important;
		--wd-gap-sm: 14px !important;
	}
}

/* ---- Tablet (768-1023): 3-col grid --------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
	.inv-results .wd-products-element > .products.wd-products {
		--wd-col-lg: 3 !important;
		--wd-col-md: 3 !important;
		--wd-col-sm: 3 !important;
		--wd-gap-lg: 16px !important;
		--wd-gap-sm: 14px !important;
	}
}

/* ---- Small laptop (1024-1279): 245px sidebar + 3-col --------------------- */
@media (min-width: 1024px) and (max-width: 1279px) {
	.inv-filters__layout {
		grid-template-columns: 245px 1fr !important;
		gap: 20px !important;
	}
	.inv-results .wd-products-element > .products.wd-products {
		--wd-col-lg: 3 !important;
		--wd-col-md: 3 !important;
		--wd-col-sm: 3 !important;
		--wd-gap-lg: 20px !important;
	}
}

/* ---- Laptop (1280-1439): 255px sidebar + 4-col --------------------------- */
@media (min-width: 1280px) and (max-width: 1439px) {
	.inv-filters__layout {
		grid-template-columns: 255px 1fr !important;
		gap: 24px !important;
	}
	.inv-results .wd-products-element > .products.wd-products {
		--wd-col-lg: 4 !important;
		--wd-col-md: 4 !important;
		--wd-gap-lg: 16px !important;
	}
}

/* ---- Desktop (1440-1919): 265px sidebar + 4-col -------------------------- */
@media (min-width: 1440px) and (max-width: 1919px) {
	.inv-filters__layout {
		grid-template-columns: 265px 1fr !important;
		gap: 28px !important;
	}
	.inv-results .wd-products-element > .products.wd-products {
		--wd-col-lg: 4 !important;
		--wd-col-md: 4 !important;
		--wd-gap-lg: 18px !important;
	}
}

/* ---- Large desktop (1920+): 290px sidebar + 4-col ------------------------ */
@media (min-width: 1920px) {
	.inv-filters__layout {
		grid-template-columns: 290px 1fr !important;
		gap: 32px !important;
	}
	.inv-results .wd-products-element > .products.wd-products {
		--wd-col-lg: 4 !important;
		--wd-col-md: 4 !important;
		--wd-gap-lg: 20px !important;
	}
}

/* ---- Filter toggle button per device ------------------------------------- */
/* Desktop (>=1024px): sidebar inline, hide toggle */
@media (min-width: 1024px) {
	.inv-filters__toggle { display: none !important; }
}
/* Mobile/tablet (<1024px): full-width toggle */
@media (max-width: 1023px) {
	.inv-filters__toggle {
		width: 100%;
		justify-content: center;
	}
}

/* ---- Sticky sidebar on desktop only -------------------------------------- */
@media (min-width: 1024px) {
	.inv-filters .inv-drawer__panel {
		position: static !important;
		max-height: none !important;
		overflow: visible !important;
		padding-right: 0;
	}
}

/* -------- Pagination ------------------------------------------------- */
.inv-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px;
	padding: 32px 0 16px;
	margin-top: 12px;
}
.inv-pagination[hidden] { display: none; }
.inv-page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--inv-border);
	background: var(--inv-bg);
	color: var(--inv-title);
	font-family: var(--inv-title-font);
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	border-radius: var(--inv-radius-form);
	cursor: pointer;
	transition: background .2s var(--inv-ease), color .2s, border-color .2s, transform .15s, box-shadow .2s;
	user-select: none;
}
.inv-page:hover:not(.is-current):not(.is-disabled) {
	border-color: var(--inv-primary);
	color: var(--inv-primary);
	background: var(--inv-primary-soft, rgba(255,0,0,.06));
	transform: translateY(-1px);
	box-shadow: var(--inv-shadow-sm);
}
.inv-page.is-current {
	background: linear-gradient(135deg, var(--inv-primary), color-mix(in srgb, var(--inv-primary) 75%, #000));
	color: #fff;
	border-color: transparent;
	box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--inv-primary) 55%, transparent);
	cursor: default;
}
.inv-page.is-disabled {
	opacity: .35;
	cursor: not-allowed;
	pointer-events: none;
}
.inv-page.is-gap {
	border: 0;
	background: transparent;
	cursor: default;
	padding: 0 4px;
}
.inv-page:focus-visible {
	outline: 2px solid var(--inv-primary);
	outline-offset: 2px;
}

/* Kill legacy FAB button (we removed it from HTML). */
.inv-fab { display: none !important; }

/* -------- Layout: desktop sidebar + results -------------------------- */
.inv-filters__layout {
	display: block;
}
/* Highlight a preselected (archive-driven) category row */
.inv-check[data-preselected="true"] {
	background: var(--inv-primary-soft, rgba(255,0,0,.06));
	border-radius: var(--inv-radius);
}
.inv-check[data-preselected="true"] .inv-check__label {
	color: var(--inv-primary);
	font-weight: 700;
}
@media (min-width: 1024px) {
	.inv-filters__layout {
		display: grid;
		grid-template-columns: 240px 1fr;
		gap: 24px;
		align-items: start;
	}
	/* Turn drawer into a real sidebar on desktop */
	.inv-filters .inv-drawer {
		position: static;
		inset: auto;
		pointer-events: auto;
		opacity: 1;
		z-index: auto;
		transition: none;
	}
	.inv-filters .inv-drawer__scrim { display: none; }
	.inv-filters .inv-drawer__panel {
		position: static;
		width: 100%;
		max-width: none;
		transform: none;
		box-shadow: none;
		border: 1px solid var(--inv-border);
		border-radius: var(--inv-radius);
		background: var(--inv-bg);
		transition: none;
		max-height: none;
		overflow: visible;
	}
	.inv-filters .inv-drawer__close { display: none; }
	.inv-filters .inv-drawer__head {
		border-radius: var(--inv-radius) var(--inv-radius) 0 0;
	}
	.inv-filters .inv-drawer__foot {
		border-radius: 0 0 var(--inv-radius) var(--inv-radius);
	}
	/* Hide the mobile "Филтри" toggle and FAB on desktop */
	.inv-filters .inv-filters__toggle { display: none; }
	.inv-filters .inv-fab { display: none; }
	/* Body lock class must not apply on desktop */
	body.inv-drawer-open { overflow: auto; touch-action: auto; }
	/* Auto-apply — hide the manual Покажи button on desktop, keep Изчисти */
	.inv-filters .inv-drawer__foot [data-apply] { display: none; }
	.inv-filters .inv-drawer__foot [data-clear] { flex: 1; }
	/* Topbar: no sticky on desktop, tighter spacing */
	.inv-filters .inv-filters__topbar {
		position: static;
		border-bottom: 0;
		padding: 0 0 12px;
		margin-bottom: 12px;
	}
	.inv-filters .inv-filters__sort-wrap { margin-left: auto; }
	/* Sidebar flows fully expanded on desktop — no inner scroll */
	.inv-filters .inv-drawer__body {
		max-height: none;
		overflow: visible;
	}
}

/* -------- Layout end ---------------------------------------------------- */


.inv-filters__topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--inv-border);
	position: sticky;
	top: var(--wd-sticky-nav-w, 0);
	z-index: 20;
	background: var(--inv-bg);
}
.inv-filters__toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: calc(var(--inv-form-h) + 6px);
	padding: 0 26px;
	border: 0;
	background: linear-gradient(135deg, var(--inv-primary) 0%, color-mix(in srgb, var(--inv-primary) 75%, #000) 100%);
	border-radius: var(--inv-radius-form);
	font-family: var(--inv-title-font);
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: #fff;
	cursor: pointer;
	transition: transform .25s var(--inv-ease-bounce), box-shadow .25s var(--inv-ease), filter .25s;
	position: relative;
	overflow: hidden;
	box-shadow:
		0 6px 18px -4px color-mix(in srgb, var(--inv-primary) 55%, transparent),
		0 2px 6px rgba(0,0,0,.12),
		inset 0 1px 0 rgba(255,255,255,.18);
	isolation: isolate;
}
/* Animated shine sweep */
.inv-filters__toggle::before {
	content: '';
	position: absolute;
	top: 0;
	left: -80%;
	width: 60%;
	height: 100%;
	background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,.28) 50%, transparent 100%);
	transform: skewX(-20deg);
	transition: left .7s var(--inv-ease);
	pointer-events: none;
	z-index: 0;
}
/* Subtle darker inner glow on hover */
.inv-filters__toggle::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
	opacity: 0;
	transition: opacity .25s var(--inv-ease);
	pointer-events: none;
	z-index: 0;
}
.inv-filters__toggle:hover {
	transform: translateY(-2px);
	filter: saturate(1.1);
	box-shadow:
		0 12px 28px -6px color-mix(in srgb, var(--inv-primary) 65%, transparent),
		0 4px 10px rgba(0,0,0,.15),
		inset 0 1px 0 rgba(255,255,255,.25);
}
.inv-filters__toggle:hover::before { left: 130%; }
.inv-filters__toggle:hover::after { opacity: 1; }
.inv-filters__toggle:active {
	transform: translateY(0);
	box-shadow:
		0 4px 12px -4px color-mix(in srgb, var(--inv-primary) 55%, transparent),
		inset 0 2px 4px rgba(0,0,0,.15);
}
.inv-filters__toggle:focus-visible {
	outline: 2px solid var(--inv-primary);
	outline-offset: 3px;
}
.inv-filters__toggle svg {
	position: relative;
	z-index: 1;
	width: 20px;
	height: 20px;
	transition: transform .35s var(--inv-ease-bounce);
	stroke-width: 2.2;
}
.inv-filters__toggle:hover svg {
	transform: rotate(180deg);
}
.inv-filters__toggle span {
	position: relative;
	z-index: 1;
}
.inv-filters__count-badge {
	background: #fff;
	color: var(--inv-primary);
	font-size: 11px;
	font-weight: 800;
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	letter-spacing: 0;
	position: relative;
	z-index: 1;
	animation: inv-badge-pop .32s var(--inv-ease-bounce);
	box-shadow: 0 2px 8px rgba(0,0,0,.2);
	border: 1.5px solid rgba(255,255,255,.9);
}
@keyframes inv-badge-pop {
	0%   { transform: scale(.3); opacity: 0; }
	60%  { transform: scale(1.15); }
	100% { transform: scale(1); opacity: 1; }
}
.inv-filters__sort-wrap { margin-left: auto; }
.inv-filters__sort {
	height: var(--inv-form-h);
	padding: 0 36px 0 14px;
	border: 1px solid var(--inv-border);
	background: var(--inv-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
	border-radius: var(--inv-radius-form);
	font-family: var(--inv-text-font);
	font-size: 13px;
	color: var(--inv-title);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	min-width: 200px;
}
.inv-filters__sort:focus { border-color: var(--inv-border-focus); outline: none; }

/* -------- Chips (active filters) — Woodmart-style tags ------------------ */
.inv-filters__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 0 16px;
	min-height: 0;
}
.inv-filters__chips:empty { padding: 0; }
.inv-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 6px 7px 14px;
	background: var(--inv-title);
	color: #fff;
	border: 1px solid var(--inv-title);
	border-radius: var(--inv-radius-form);
	font-family: var(--inv-text-font);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .4px;
	animation: inv-chip-in .28s var(--inv-ease-bounce);
	box-shadow: var(--inv-shadow-sm);
	transition: background .15s, border-color .15s, transform .1s;
}
.inv-chip:hover {
	background: var(--inv-primary);
	border-color: var(--inv-primary);
}
.inv-chip__x {
	width: 20px; height: 20px;
	border-radius: 50%;
	background: rgba(255,255,255,.15);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
	border: 0;
	line-height: 1;
	padding: 0;
	transition: background .15s, transform .15s;
}
.inv-chip__x:hover { background: rgba(255,255,255,.4); transform: rotate(90deg); }
@keyframes inv-chip-in {
	from { transform: scale(.7) translateY(-4px); opacity: 0; }
	to   { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes inv-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* -------- Drawer (mimics Woodmart .wd-side-hidden) ---------------------- */
.inv-drawer {
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	opacity: 0;
	transition: opacity .2s var(--inv-ease);
}
.inv-drawer[aria-hidden="false"] {
	pointer-events: auto;
	opacity: 1;
}
.inv-drawer__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}
.inv-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--wd-side-hidden-w, 380px);
	max-width: 92vw;
	background: var(--inv-bg);
	box-shadow: var(--inv-shadow);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .38s var(--inv-ease);
	will-change: transform;
}
.inv-drawer[aria-hidden="false"] .inv-drawer__panel {
	transform: translateX(0);
}
.inv-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--inv-border);
	flex: 0 0 auto;
	background: linear-gradient(180deg, var(--inv-bg) 0%, var(--inv-surface) 100%);
}
.inv-drawer__head h2 {
	margin: 0;
	font-family: var(--inv-title-font);
	font-size: 18px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .6px;
	color: var(--inv-title);
	display: flex;
	align-items: center;
	gap: 10px;
}
.inv-drawer__head h2::before {
	content: '';
	width: 4px;
	height: 20px;
	background: var(--inv-primary);
	border-radius: 2px;
}
.inv-drawer__close {
	background: none;
	border: 0;
	padding: 8px;
	cursor: pointer;
	color: var(--inv-text);
	border-radius: var(--inv-radius);
	transition: color .15s, transform .2s var(--inv-ease), background .15s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.inv-drawer__close:hover { color: var(--inv-primary); transform: rotate(90deg); background: var(--inv-surface); }
.inv-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 6px 24px 20px;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: var(--inv-border-2) transparent;
}
.inv-drawer__body::-webkit-scrollbar { width: 6px; }
.inv-drawer__body::-webkit-scrollbar-track { background: transparent; }
.inv-drawer__body::-webkit-scrollbar-thumb { background: var(--inv-border-2); border-radius: 3px; }
.inv-drawer__body::-webkit-scrollbar-thumb:hover { background: var(--inv-primary); }
.inv-drawer__foot {
	flex: 0 0 auto;
	display: flex;
	gap: 10px;
	padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--inv-border);
	background: var(--inv-bg);
	position: sticky;
	bottom: 0;
	box-shadow: 0 -8px 20px -8px rgba(0,0,0,.08);
}

/* -------- Groups (collapsible sections, Woodmart-widget feel) ----------- */
.inv-group {
	border-bottom: 1px solid var(--inv-border);
	padding: 4px 0;
}
.inv-group:last-child { border-bottom: 0; }
.inv-group__title {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 2px;
	background: none;
	border: 0;
	font-family: var(--inv-title-font);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .6px;
	cursor: pointer;
	color: var(--inv-title);
	transition: color .15s;
}
.inv-group__title:hover { color: var(--inv-primary); }
.inv-group__title:hover .inv-group__chev { color: var(--inv-primary); }
.inv-group__chev {
	transition: transform .25s var(--inv-ease), color .15s;
	color: var(--inv-text);
}
.inv-group__title[aria-expanded="false"] .inv-group__chev { transform: rotate(-90deg); }
.inv-group__body {
	overflow: hidden;
	max-height: 1500px;
	transition: max-height .3s var(--inv-ease), opacity .2s;
	padding-bottom: 12px;
}
/* Long taxonomy groups (category + brand) get a scrollable inner cap so a
   50-brand list doesn't stretch the sidebar down 3 metres. Short groups
   (price, weight, availability) stay natural. */
.inv-group[data-group="category"] > .inv-group__body,
.inv-group[data-group="brand"] > .inv-group__body,
.inv-group__body[data-brand-list] {
	max-height: 280px;
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 4px;
	scrollbar-width: thin;
	scrollbar-color: var(--inv-border-2, rgba(0,0,0,.2)) transparent;
}
.inv-group[data-group="category"] > .inv-group__body::-webkit-scrollbar,
.inv-group[data-group="brand"] > .inv-group__body::-webkit-scrollbar,
.inv-group__body[data-brand-list]::-webkit-scrollbar { width: 5px; }
.inv-group[data-group="category"] > .inv-group__body::-webkit-scrollbar-thumb,
.inv-group[data-group="brand"] > .inv-group__body::-webkit-scrollbar-thumb,
.inv-group__body[data-brand-list]::-webkit-scrollbar-thumb {
	background: var(--inv-border-2, rgba(0,0,0,.2));
	border-radius: 3px;
}
/* Collapsed state overrides the cap (uses existing max-height:0 rule). */
.inv-group__title[aria-expanded="false"] + .inv-group__body,
.inv-group__title[aria-expanded="false"] + .inv-group__search + .inv-group__body {
	overflow: hidden;
}
.inv-group__title[aria-expanded="false"] + .inv-group__search,
.inv-group__title[aria-expanded="false"] + .inv-group__body,
.inv-group__title[aria-expanded="false"] + .inv-group__search + .inv-group__body {
	max-height: 0;
	opacity: 0;
	padding-bottom: 0;
}
.inv-group__search {
	padding: 0 2px 10px;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
	overflow: hidden;
}
.inv-search {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box !important;
	height: var(--inv-form-h);
	padding: 0 12px;
	margin: 0;
	border: 1px solid var(--inv-border);
	border-radius: var(--inv-radius-form);
	font-family: var(--inv-text-font);
	font-size: 13px;
	background: var(--inv-bg);
	color: var(--inv-title);
	transition: border-color .15s;
}
.inv-search:focus {
	outline: none;
	border-color: var(--inv-border-focus);
}
.inv-empty {
	color: var(--inv-text);
	font-size: 13px;
	margin: 8px 2px;
	font-style: italic;
}

/* -------- Custom checkbox (Woodmart-style square) ----------------------- */
.inv-check {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 8px;
	cursor: pointer;
	border-radius: var(--inv-radius);
	transition: background .18s var(--inv-ease), transform .12s;
	position: relative;
	margin: 0 -8px;
}
.inv-check:hover {
	background: var(--inv-surface);
}
.inv-check:hover .inv-check__label { color: var(--inv-primary); }
.inv-check:hover .inv-check__box { border-color: var(--inv-primary); }
.inv-check:active { transform: scale(.985); }
.inv-check input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.inv-check__box {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border: 1.5px solid var(--inv-border-2);
	border-radius: var(--inv-radius);
	position: relative;
	background: var(--inv-bg);
	transition: all .2s var(--inv-ease);
}
.inv-check input:checked + .inv-check__box {
	background: var(--inv-primary);
	border-color: var(--inv-primary);
	animation: inv-check-pop .32s var(--inv-ease-bounce);
}
.inv-check input:checked + .inv-check__box::after {
	content: '';
	position: absolute;
	inset: 0;
	background: 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/72% no-repeat;
	animation: inv-check-draw .28s var(--inv-ease) .04s both;
}
@keyframes inv-check-pop {
	0%   { transform: scale(1); }
	50%  { transform: scale(1.15); }
	100% { transform: scale(1); }
}
@keyframes inv-check-draw {
	from { opacity: 0; transform: scale(.6); }
	to   { opacity: 1; transform: scale(1); }
}
.inv-check__label {
	flex: 1;
	font-family: var(--inv-text-font);
	font-size: 13px;
	color: var(--inv-title);
	transition: color .12s;
}
.inv-check__count {
	font-size: 11px;
	color: var(--inv-text);
	background: var(--inv-surface);
	padding: 2px 8px;
	border-radius: var(--inv-radius-form);
	min-width: 26px;
	text-align: center;
	font-weight: 500;
}

/* -------- Pills (weight tags — squared to match Woodmart) --------------- */
.inv-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 6px 2px 4px;
}
.inv-pill {
	position: relative;
	cursor: pointer;
}
.inv-pill input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.inv-pill span {
	display: inline-block;
	padding: 9px 16px;
	border: 1.5px solid var(--inv-border-2);
	border-radius: var(--inv-radius-form);
	font-family: var(--inv-text-font);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .4px;
	color: var(--inv-title);
	transition: all .2s var(--inv-ease);
	background: var(--inv-bg);
}
.inv-pill:hover span {
	border-color: var(--inv-primary);
	color: var(--inv-primary);
	transform: translateY(-1px);
	box-shadow: var(--inv-shadow-sm);
}
.inv-pill input:checked + span {
	background: var(--inv-title);
	color: #fff;
	border-color: var(--inv-title);
	box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* -------- Toggle switch ------------------------------------------------- */
.inv-switch {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 4px;
	cursor: pointer;
	user-select: none;
	position: relative;
}
.inv-switch input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.inv-switch__slider {
	flex: 0 0 auto;
	width: 40px;
	height: 22px;
	background: var(--inv-surface-2);
	border-radius: 999px;
	position: relative;
	transition: background .18s var(--inv-ease);
}
.inv-switch__slider::before {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
	transition: transform .18s var(--inv-ease);
}
.inv-switch input:checked + .inv-switch__slider {
	background: var(--inv-primary);
	box-shadow: 0 0 0 4px var(--inv-primary-soft, rgba(255,0,0,.12));
}
.inv-switch input:checked + .inv-switch__slider::before {
	transform: translateX(18px);
}
.inv-switch:hover .inv-switch__slider { opacity: .9; }
.inv-switch:hover .inv-switch__label { color: var(--inv-primary); }
.inv-switch__label {
	font-family: var(--inv-text-font);
	font-size: 13px;
	color: var(--inv-title);
	font-weight: 500;
	transition: color .15s;
}

/* -------- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.inv-filters *,
	.inv-filters *::before,
	.inv-filters *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

/* -------- Dual-range price slider -------------------------------------- */
.inv-price { padding: 8px 4px 4px; }
.inv-price__track {
	position: relative;
	height: 30px;
	margin: 4px 8px 4px;
}
.inv-price__track::before {
	content: '';
	position: absolute;
	top: 50%;
	left: -8px;
	right: -8px;
	height: 3px;
	background: var(--inv-surface-2);
	border-radius: 2px;
	transform: translateY(-50%);
}
.inv-price__fill {
	position: absolute;
	top: 50%;
	height: 3px;
	background: var(--inv-primary);
	border-radius: 2px;
	transform: translateY(-50%);
	pointer-events: none;
}
.inv-price__track input[type="range"] {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	height: 30px;
	background: none;
	pointer-events: none;
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
}
.inv-price__track input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--inv-primary);
	box-shadow: 0 2px 4px rgba(0,0,0,.15);
	cursor: grab;
	transition: transform .1s;
}
.inv-price__track input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
.inv-price__track input[type="range"]::-moz-range-thumb {
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--inv-primary);
	box-shadow: 0 2px 4px rgba(0,0,0,.15);
	cursor: grab;
}
.inv-price__inputs {
	display: flex;
	gap: 10px;
	margin-top: 14px;
}
.inv-price__inputs label {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: var(--inv-text-font);
	font-size: 12px;
	color: var(--inv-text);
	text-transform: uppercase;
	letter-spacing: .3px;
}
.inv-price__num {
	flex: 1;
	min-width: 0;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--inv-border);
	border-radius: var(--inv-radius-form);
	font-family: var(--inv-text-font);
	font-size: 13px;
	font-weight: 600;
	color: var(--inv-title);
	text-align: right;
	background: var(--inv-bg);
	appearance: none;
	-moz-appearance: textfield;
}
.inv-price__num:focus { outline: none; border-color: var(--inv-border-focus); }
.inv-price__num::-webkit-outer-spin-button,
.inv-price__num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* -------- Buttons (Woodmart .btn matching) ----------------------------- */
.inv-btn {
	flex: 1;
	height: 48px;
	padding: 0 22px;
	border: 1.5px solid transparent;
	border-radius: var(--inv-radius-form);
	font-family: var(--inv-text-font);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: transform .15s var(--inv-ease), background .2s var(--inv-ease), color .2s, border-color .2s, box-shadow .25s;
	position: relative;
	overflow: hidden;
}
.inv-btn--primary {
	background: var(--inv-primary);
	color: #fff;
	border-color: var(--inv-primary);
	box-shadow: 0 4px 14px rgba(255,0,0,.25);
}
.inv-btn--primary::before {
	content: '';
	position: absolute;
	top: 0; left: -100%;
	width: 100%; height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
	transition: left .6s var(--inv-ease);
}
.inv-btn--primary:hover {
	background: var(--inv-title);
	border-color: var(--inv-title);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.inv-btn--primary:hover::before { left: 100%; }
.inv-btn--primary:active { transform: translateY(0) scale(.98); }
.inv-btn--ghost {
	background: var(--inv-bg);
	color: var(--inv-title);
	border-color: var(--inv-border-2);
}
.inv-btn--ghost:hover {
	border-color: var(--inv-primary);
	color: var(--inv-primary);
	background: var(--inv-primary-soft, rgba(255,0,0,.05));
}
.inv-btn--ghost:active { transform: scale(.98); }
.inv-btn__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	background: rgba(255,255,255,.22);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	position: relative;
	z-index: 1;
}

/* -------- Results ------------------------------------------------------- */
.inv-results { padding: 8px 0 24px; position: relative; min-height: 200px; }
.inv-results.is-loading .inv-results__grid { opacity: .35; pointer-events: none; filter: blur(.5px); transition: opacity .2s, filter .2s; }
.inv-results.is-loading::before {
	content: '';
	position: absolute;
	inset: 40px 0 0 0;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,.5) 50%, transparent);
	animation: inv-shimmer 1.4s infinite;
	pointer-events: none;
	z-index: 4;
}
.inv-results.is-loading::after {
	content: '';
	position: absolute;
	top: 60px;
	left: 50%;
	transform: translateX(-50%);
	width: 40px;
	height: 40px;
	border: 3px solid var(--inv-surface-2);
	border-top-color: var(--inv-primary);
	border-radius: 50%;
	animation: inv-spin .8s linear infinite;
	z-index: 5;
}
@keyframes inv-shimmer {
	0%   { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}
@keyframes inv-spin { to { transform: translate(-50%,0) rotate(360deg); } }
.inv-results__meta {
	padding: 0 0 16px;
	color: var(--inv-text);
	font-family: var(--inv-text-font);
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
/* When JS relocates the sort dropdown into the meta row (desktop ≥1024px),
   push it to the right edge next to "N продукта" — Amazon/Zalando pattern. */
.inv-results__meta .inv-filters__sort-wrap {
	margin-left: auto;
}
@media (max-width: 1023px) {
	/* On mobile the sort stays in the topbar; hide any stray copy. */
	.inv-results__meta .inv-filters__sort-wrap { display: none; }
}
.inv-results__count {
	font-weight: 700;
	color: var(--inv-title);
	font-size: 15px;
	transition: color .2s;
}
.inv-results__grid { transition: opacity .2s, filter .2s; }
.inv-results__more { text-align: center; padding: 30px 0 10px; }
.inv-noresults {
	padding: 60px 20px;
	text-align: center;
	color: var(--inv-text);
	font-family: var(--inv-text-font);
	font-size: 14px;
	background: var(--inv-surface);
	border-radius: var(--inv-radius);
	position: relative;
}
.inv-noresults::before {
	content: '';
	display: block;
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ccc' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E") center/contain no-repeat;
	opacity: .7;
}

/* -------- Sticky mobile FAB -------------------------------------------- */
.inv-fab {
	display: inline-flex;
	position: fixed;
	right: 24px;
	bottom: calc(24px + env(safe-area-inset-bottom));
	z-index: 100;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--inv-primary);
	color: #fff;
	border: 0;
	box-shadow: 0 10px 30px rgba(255,0,0,.4), 0 4px 12px rgba(0,0,0,.15);
	cursor: pointer;
	align-items: center;
	justify-content: center;
	transition: transform .2s var(--inv-ease-bounce), background .2s;
	animation: inv-fab-pulse 3s var(--inv-ease) infinite;
}
.inv-fab:hover {
	background: var(--inv-title);
	transform: scale(1.08);
	animation: none;
}
.inv-fab:active { transform: scale(.92); }
@keyframes inv-fab-pulse {
	0%, 100% { box-shadow: 0 10px 30px rgba(255,0,0,.4), 0 4px 12px rgba(0,0,0,.15), 0 0 0 0 rgba(255,0,0,.5); }
	50%      { box-shadow: 0 10px 30px rgba(255,0,0,.4), 0 4px 12px rgba(0,0,0,.15), 0 0 0 14px rgba(255,0,0,0); }
}
.inv-fab__count {
	position: absolute;
	top: -4px;
	right: -4px;
	background: var(--inv-accent);
	color: var(--inv-title);
	font-size: 11px;
	font-weight: 700;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	border: 2px solid var(--inv-bg);
}

/* -------- Body lock while drawer open ---------------------------------- */
body.inv-drawer-open {
	overflow: hidden;
	touch-action: none;
}

/* -------- Responsive --------------------------------------------------- */
@media (max-width: 782px) {
	.inv-filters__topbar { padding: 10px 0; gap: 8px; }
	.inv-filters__sort { min-width: 0; max-width: 170px; font-size: 12px; padding: 0 30px 0 12px; }
	.inv-filters__toggle span:not(.inv-filters__count-badge) { display: none; }
	.inv-filters__toggle { padding: 0 12px; }
	.inv-fab { width: 54px; height: 54px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
	.inv-drawer__panel { width: 100vw; max-width: 100vw; }
	.inv-drawer__body { padding: 4px 18px 16px; }
	.inv-drawer__head { padding: 16px 18px; }
	.inv-drawer__foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
}
