/* AJAX shop filters — panel redesign (Moderno child) */

.anak-ajax-filters {
	--anak-filter-red: #c43038;
	--anak-filter-red-hover: #a8282f;
	--anak-filter-border: #e6e6e6;
	--anak-filter-muted: #8a8a8a;
	--anak-filter-text: #1a1a1a;
	--anak-filter-cube: #d9d9d9;
	--anak-filter-cube-active: #c43038;
}

/* Hide active-filter count badge on the "סינון" button */
.anak-ajax-filters .c-page-header__filter-count,
.anak-ajax-filters .js-filter-show-button .c-page-header__filter-count {
	display: none !important;
}

/* Hide "המסננים שלך" / clear-all */
.anak-ajax-filters .js-shop-sidebar .widget_layered_nav_filters {
	display: none !important;
}

/* Loading state */
body.anak-filters-loading {
	cursor: wait;
}

.c-product-grid.is-anak-loading,
.js-shop-sidebar.is-anak-loading {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* —— Panel shell —— */
.anak-ajax-filters .c-shop-sidebar--desktop-filter .c-shop-sidebar__content--desktop-filter,
.anak-ajax-filters .c-shop-sidebar__content {
	background: #fff;
}

.anak-ajax-filters .js-shop-sidebar .widget {
	border: 0;
	border-bottom: 1px solid var(--anak-filter-border);
	margin: 0;
	padding: 18px 0 20px;
	background: transparent;
}

.anak-ajax-filters .js-shop-sidebar .widget:last-child {
	border-bottom: 0;
}

.anak-ajax-filters .js-shop-sidebar .widget .widget-title,
.anak-ajax-filters .js-shop-sidebar .widget .widgettitle,
.anak-ajax-filters .js-shop-sidebar .widget h2,
.anak-ajax-filters .js-shop-sidebar .widget .c-widget__title {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: var(--anak-filter-text);
	margin: 0 0 14px;
	padding: 0;
	border: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
}

/* —— Lists —— */
body.anak-ajax-filters .js-shop-sidebar .anak-filter-list,
body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list,
body.anak-ajax-filters .js-shop-sidebar .product-categories,
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories ul {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Kill Moderno layered-nav native squares on <li> */
body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item:before,
body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item:after,
body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item.chosen:before,
body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item.chosen:after {
	content: none !important;
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	border: 0 !important;
	background: none !important;
}

/* Kill Moderno category indent + black current-cat fill */
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories ul > li,
body.anak-ajax-filters.h-rtl .js-shop-sidebar .widget_product_categories ul > li,
body.anak-ajax-filters .c-sidebar .widget_product_categories ul > li {
	margin: 0 !important;
	margin-right: 0 !important;
	margin-left: 0 !important;
	padding: 0 !important;
}

body.anak-ajax-filters .js-shop-sidebar li.current-cat > a:after,
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories ul > li > a:after {
	content: none !important;
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	background: none !important;
}

body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item,
body.anak-ajax-filters .js-shop-sidebar .product-categories > li,
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories ul > li {
	margin: 0 !important;
	padding: 0 !important;
	display: flex !important;
	align-items: center;
	gap: 10px;
	position: relative;
}

body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item a,
body.anak-ajax-filters .js-shop-sidebar .product-categories > li > a,
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories ul > li > a {
	display: flex !important;
	flex: 1 1 auto;
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
	margin: 0 !important;
	padding: 11px 0 !important;
	font-size: 14px;
	font-weight: 400;
	color: var(--anak-filter-text) !important;
	text-decoration: none;
	position: relative;
	min-width: 0;
}

body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item > .count,
body.anak-ajax-filters .js-shop-sidebar .product-categories > li > .count,
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories .count {
	flex: 0 0 auto;
	color: var(--anak-filter-muted);
	font-size: 13px;
	font-weight: 400;
	line-height: 1;
}

/*
 * Shared checkbox — same right edge as titles (widget padding: 0).
 * High specificity beats Moderno category absolute 10px a:before.
 */
body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item a:before,
body.anak-ajax-filters .js-shop-sidebar .product-categories > li > a:before,
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories ul > li > a:before,
body.anak-ajax-filters.h-rtl .js-shop-sidebar .widget_product_categories ul > li > a:before,
body.anak-ajax-filters.h-rtl .c-sidebar .widget_product_categories ul > li > a:before {
	content: "" !important;
	position: static !important;
	inset: auto !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	flex: 0 0 22px !important;
	display: block !important;
	width: 22px !important;
	height: 22px !important;
	min-width: 22px !important;
	margin: 0 !important;
	margin-inline-end: 12px !important;
	border: 2px solid #bdbdbd !important;
	border-radius: 4px !important;
	background-color: #fff !important;
	background-image: none !important;
	box-sizing: border-box !important;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item a:hover:before,
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories ul > li > a:hover:before {
	border-color: #888 !important;
}

body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item--chosen > a:before,
body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item.chosen > a:before,
body.anak-ajax-filters .js-shop-sidebar .widget_product_categories ul > li.current-cat > a:before,
body.anak-ajax-filters .js-shop-sidebar li.current-cat > a:before {
	border-color: var(--anak-filter-red) !important;
	border-radius: 4px !important;
	background-color: var(--anak-filter-red) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 7.2l3 3 6-6'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	background-size: 14px 14px !important;
}

body.anak-ajax-filters .js-shop-sidebar .woocommerce-widget-layered-nav-list__item a:after {
	display: none !important;
	content: none !important;
	background: none !important;
}

.anak-ajax-filters .anak-filter-list__hidden {
	display: none !important;
}

.anak-ajax-filters .anak-filter-list__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	padding: 0;
	border: 0;
	background: none;
	font-size: 13px;
	font-weight: 500;
	color: var(--anak-filter-text);
	cursor: pointer;
}

.anak-ajax-filters .anak-filter-list__more:hover {
	color: var(--anak-filter-red);
}

.anak-ajax-filters .anak-filter-list__more-icon {
	font-size: 16px;
	line-height: 1;
	font-weight: 600;
}

/* —— Price filter —— */
.anak-ajax-filters .widget_price_filter .price_slider_amount,
.anak-ajax-filters .anak-price-filter__amount {
	display: flex !important;
	flex-direction: column !important;
	position: relative;
}

.anak-ajax-filters .anak-price-filter__inputs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 14px;
}

.anak-ajax-filters .anak-price-filter__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.anak-ajax-filters .anak-price-filter__field label {
	font-size: 12px;
	font-weight: 500;
	color: var(--anak-filter-muted);
}

.anak-ajax-filters .anak-price-filter__control {
	position: relative;
	display: flex;
	align-items: center;
}

.anak-ajax-filters .anak-price-filter__currency {
	position: absolute;
	left: 14px;
	right: auto;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1;
	font-size: 16px;
	font-weight: 600;
	color: var(--anak-filter-text);
	pointer-events: none;
	user-select: none;
	line-height: 1;
}

.anak-ajax-filters .widget_price_filter input.anak-price-filter__input,
.anak-ajax-filters .anak-price-filter input#min_price,
.anak-ajax-filters .anak-price-filter input#max_price {
	opacity: 1 !important;
	visibility: visible !important;
	display: block !important;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 14px 0 32px;
	border: 1px solid var(--anak-filter-border);
	border-radius: 4px;
	background: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 52px;
	color: var(--anak-filter-text);
	box-sizing: border-box;
	text-align: center;
}

.anak-ajax-filters .anak-price-filter input:focus {
	outline: none;
	border-color: #aaa;
}

.anak-ajax-filters .anak-price-cubes {
	display: flex;
	flex-direction: row;
	gap: 5px;
	margin: 6px 0 14px;
	width: 100%;
}

.anak-ajax-filters .anak-price-cubes__item {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	height: 32px;
	border: 0;
	border-radius: 4px;
	padding: 0;
	background: var(--anak-filter-cube);
	cursor: pointer;
	transition: background 0.15s ease;
}

.anak-ajax-filters .anak-price-cubes__item:hover {
	background: #c8c8c8;
}

.anak-ajax-filters .anak-price-cubes__item.is-active {
	background: var(--anak-filter-cube-active);
}

.anak-ajax-filters .anak-price-cubes__tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	padding: 5px 8px;
	border-radius: 4px;
	background: #3a3a3a;
	color: #fff;
	font-size: 11px;
	font-weight: 500;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease, visibility 0.12s ease;
	z-index: 5;
}

.anak-ajax-filters .anak-price-cubes__tooltip:after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border: 5px solid transparent;
	border-top-color: #3a3a3a;
}

@media (hover: hover) {
	.anak-ajax-filters .anak-price-cubes__item:hover .anak-price-cubes__tooltip {
		opacity: 1;
		visibility: visible;
	}
}

.anak-ajax-filters .anak-price-cubes__item:focus {
	outline: none;
}

.anak-ajax-filters .anak-price-cubes__item:focus-visible {
	outline: 2px solid var(--anak-filter-red);
	outline-offset: 2px;
}

.anak-ajax-filters .widget_price_filter .price_slider {
	display: block !important;
	margin: 8px 10px 6px;
	height: 3px;
}

.anak-ajax-filters .widget_price_filter .price_slider:before {
	height: 3px;
	background: #ddd;
	left: -8px;
	right: -8px;
}

.anak-ajax-filters .widget_price_filter .ui-slider-range {
	height: 3px;
	background-color: #1a1a1a;
}

.anak-ajax-filters .widget_price_filter .ui-slider-handle {
	width: 14px;
	height: 14px;
	top: -6px;
	margin-left: -7px;
	border-radius: 50%;
	background-color: #1a1a1a;
	box-shadow: 0 0 0 2px #fff;
}

.anak-ajax-filters .anak-price-filter__label,
.anak-ajax-filters .widget_price_filter .price_label {
	display: none !important;
}

.anak-ajax-filters .anak-price-filter__submit,
.anak-ajax-filters .widget_price_filter .button.anak-price-filter__submit,
.anak-ajax-filters .widget_price_filter button.button {
	display: block;
	width: 100%;
	margin: 14px 0 0 !important;
	padding: 12px 16px !important;
	border: 0 !important;
	border-radius: 4px !important;
	background: var(--anak-filter-red) !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-align: center;
	cursor: pointer;
	line-height: 1.3 !important;
}

.anak-ajax-filters .anak-price-filter__submit:hover,
.anak-ajax-filters .widget_price_filter .button.anak-price-filter__submit:hover {
	background: var(--anak-filter-red-hover) !important;
}

.anak-ajax-filters .c-shop-sidebar--desktop-filter .c-sidebar__wrap {
	padding-inline: 18px;
}

/* Backdrop when filter is open (click-outside closes) */
.anak-ajax-filters .c-shop-sidebar__shadow.js-filter-shadow {
	position: fixed;
	z-index: 1399;
	inset: 0;
	width: 100%;
	height: 100%;
	visibility: hidden;
	opacity: 0;
	background-color: rgba(0, 0, 0, 0.25);
	transition: opacity 0.2s ease, visibility 0.2s ease;
	cursor: pointer;
}

.anak-ajax-filters .c-shop-sidebar--active + .c-shop-sidebar__shadow.js-filter-shadow,
.anak-ajax-filters body.filter-open .c-shop-sidebar__shadow.js-filter-shadow,
body.anak-ajax-filters.filter-open .c-shop-sidebar__shadow.js-filter-shadow {
	visibility: visible;
	opacity: 1;
}

@media (max-width: 767px) {
	.anak-ajax-filters .c-shop-sidebar__content {
		padding-inline: 16px;
	}
}
