/* AJAX loading state for product grid when karat filter updates */
.woocommerce.main-products.mk-shop-filter-is-loading,
.woocommerce.mk-shop-filter-is-loading {
	position: relative;
	min-height: 120px;
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.woocommerce.main-products.mk-shop-filter-is-loading::after,
.woocommerce.mk-shop-filter-is-loading::after {
	content: "";
	position: absolute;
	inset: 40% auto auto 50%;
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: var(--mk-filter-accent, #b8860b);
	animation: mk-shop-filter-spin 0.75s linear infinite;
}

@keyframes mk-shop-filter-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Hide product categories filter on category/tag archives (shop only). */
body.tax-product_cat .widget_product_categories.widget-container,
body.tax-product_tag .widget_product_categories.widget-container,
body.tax-product_cat .ts-product-categories-widget:not(.mk-gender-category-filter-widget),
body.tax-product_tag .ts-product-categories-widget:not(.mk-gender-category-filter-widget) {
	display: none !important;
}
/* Product categories + Gender widgets — same checkbox style as Karat/Color/Price */
.widget_product_categories ul.product-categories,
.mk-product-categories-filter,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.widget_product_categories ul.product-categories ul.children,
.mk-product-categories-filter ul.children,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories ul.children {
	list-style: none;
	margin: 4px 0 0;
	padding: 0 0 0 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	box-sizing: border-box;
}

body.woocommerce.archive .widget_product_categories.widget-container ul.product-categories > li,
body.woocommerce.archive .widget_product_categories.widget-container ul.product-categories ul.children > li,
body.woocommerce.archive .ts-product-categories-widget.widget-container ul.mk-product-categories-filter > li,
body.woocommerce.archive .ts-product-categories-widget.widget-container ul.mk-product-categories-filter ul.children > li,
body.woocommerce.archive .ts-product-categories-widget.widget-container .mk-gender-category-filter ul.product-categories > li {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: flex-start;
	width: 100%;
	gap: 0;
	line-height: 22px;
}

body.woocommerce.archive .widget_product_categories.widget-container ul.product-categories li.cat-parent,
body.woocommerce.archive .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 20px;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 6px;
}

body.woocommerce.archive .widget_product_categories.widget-container ul.product-categories li.cat-parent > label,
body.woocommerce.archive .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent > label {
	grid-column: 1;
	grid-row: 1;
	order: unset;
	flex: unset;
	min-width: 0;
	width: auto;
}

body.woocommerce.archive .widget_product_categories.widget-container ul.product-categories li.cat-parent > .icon-toggle,
body.woocommerce.archive .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent > .icon-toggle {
	grid-column: 2;
	grid-row: 1;
	order: unset;
	justify-self: end;
}

body.woocommerce.archive .widget_product_categories.widget-container ul.product-categories li.cat-parent > ul.children,
body.woocommerce.archive .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent > ul.children {
	grid-column: 1 / -1;
	grid-row: 2;
	order: unset;
	flex: unset;
	width: 100%;
}

.widget_product_categories ul.product-categories li > a,
.mk-product-categories-filter li > a,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories li > a {
	display: none !important;
}

.widget_product_categories ul.product-categories li > .count,
.mk-product-categories-filter li > .count,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories li > .count {
	display: none !important;
}

.widget_product_categories ul.product-categories label,
.mk-product-categories-filter label,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories label {
	padding: 0 0 0 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	position: relative;
	color: var(--ts-text-color);
	line-height: 22px;
	min-height: 22px;
	gap: 0 10px;
	margin: 0;
	text-decoration: none;
	transition: 200ms ease;
	width: 100%;
	box-sizing: border-box;
}

.widget_product_categories ul.product-categories label:hover,
.mk-product-categories-filter label:hover,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories label:hover {
	color: var(--ts-link-hover-color);
}

.widget_product_categories ul.product-categories input[type="checkbox"],
.mk-product-categories-filter input[type="checkbox"],
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 16px;
	height: 16px;
	margin: 0;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	cursor: pointer;
}

.widget_product_categories ul.product-categories label:before,
.mk-product-categories-filter label:before,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories label:before {
	content: '';
	width: 16px;
	height: 16px;
	border: 1px solid var(--ts-text-color);
	border-radius: 3px;
	position: absolute;
	top: 50%;
	left: 0;
	transform: translateY(-50%);
	box-sizing: border-box;
}

.widget_product_categories ul.product-categories label:after,
.mk-product-categories-filter label:after,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories label:after {
	font-family: 'icomoon';
	content: "\e926";
	display: block;
	position: absolute;
	top: 50%;
	left: 4px;
	transform: translateY(-50%);
	font-size: 9px;
	line-height: 1;
	width: 9px;
	height: 9px;
	text-align: center;
	opacity: 0;
	visibility: hidden;
	transition: 150ms ease;
}

.widget_product_categories ul.product-categories li:hover > label:before,
.widget_product_categories ul.product-categories li.chosen > label:before,
.widget_product_categories ul.product-categories li.current-cat > label:before,
.mk-product-categories-filter li:hover > label:before,
.mk-product-categories-filter li.chosen > label:before,
.mk-product-categories-filter li.current-cat > label:before,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories li:hover > label:before,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories li.chosen > label:before,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories li.current-cat > label:before {
	background-color: var(--ts-text-color);
}

.widget_product_categories ul.product-categories li:hover > label:after,
.widget_product_categories ul.product-categories li.chosen > label:after,
.widget_product_categories ul.product-categories li.current-cat > label:after,
.mk-product-categories-filter li:hover > label:after,
.mk-product-categories-filter li.chosen > label:after,
.mk-product-categories-filter li.current-cat > label:after,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories li:hover > label:after,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories li.chosen > label:after,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories li.current-cat > label:after {
	opacity: 1;
	visibility: visible;
	color: var(--ts-main-bg);
}

.widget_product_categories ul.product-categories .itsjewel-pca-filter-name,
.mk-product-categories-filter .itsjewel-pca-filter-name,
.ts-product-categories-widget .mk-gender-category-filter ul.product-categories .itsjewel-pca-filter-name {
	flex: 1;
	min-width: 0;
	line-height: 22px;
}

/* Parent category expand arrow (demo-style) */
.widget_product_categories ul.product-categories li.cat-parent > .icon-toggle,
.mk-product-categories-filter li.cat-parent > .icon-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 20px;
	width: 20px;
	height: 22px;
	margin: 0;
	padding: 0;
	order: 2;
	cursor: pointer;
	font-size: 10px;
	line-height: 1;
	color: var(--ts-text-color);
	transition: color 200ms ease;
	position: relative;
	z-index: 3;
	pointer-events: auto;
	flex-shrink: 0;
}

.widget_product_categories ul.product-categories li.cat-parent > .icon-toggle:before,
.mk-product-categories-filter li.cat-parent > .icon-toggle:before {
	font-family: 'icomoon';
	content: "\e951";
	speak: never;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
}

.widget_product_categories ul.product-categories li.cat-parent.active > .icon-toggle:before,
.widget_product_categories ul.product-categories li.cat-parent.current-cat-parent > .icon-toggle:before,
.mk-product-categories-filter li.cat-parent.active > .icon-toggle:before,
.mk-product-categories-filter li.cat-parent.current-cat-parent > .icon-toggle:before {
	content: "\e943";
}

.widget_product_categories ul.product-categories li.cat-parent > .icon-toggle:hover,
.mk-product-categories-filter li.cat-parent > .icon-toggle:hover {
	color: var(--ts-link-hover-color);
}

.widget_product_categories ul.product-categories li.cat-parent > label,
.mk-product-categories-filter li.cat-parent > label {
	min-width: 0;
}

.widget_product_categories ul.product-categories li.cat-parent > ul.children,
.mk-product-categories-filter li.cat-parent > ul.children {
	display: none !important;
	width: 100%;
}

.widget_product_categories ul.product-categories li.cat-parent.active > ul.children,
.widget_product_categories ul.product-categories li.cat-parent.current-cat-parent > ul.children,
.mk-product-categories-filter li.cat-parent.active > ul.children,
.mk-product-categories-filter li.cat-parent.current-cat-parent > ul.children {
	display: flex !important;
}

body.woocommerce.archive #ts-filter-widget-area .widget_product_categories.widget-container ul.product-categories li.cat-parent:not(.active):not(.current-cat-parent) > ul.children,
body.woocommerce.archive #left-sidebar .widget_product_categories.widget-container ul.product-categories li.cat-parent:not(.active):not(.current-cat-parent) > ul.children,
body.woocommerce.archive #right-sidebar .widget_product_categories.widget-container ul.product-categories li.cat-parent:not(.active):not(.current-cat-parent) > ul.children,
body.woocommerce.archive #ts-filter-widget-area .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent:not(.active):not(.current-cat-parent) > ul.children,
body.woocommerce.archive #left-sidebar .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent:not(.active):not(.current-cat-parent) > ul.children,
body.woocommerce.archive #right-sidebar .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent:not(.active):not(.current-cat-parent) > ul.children {
	display: none !important;
}

body.woocommerce.archive #ts-filter-widget-area .widget_product_categories.widget-container ul.product-categories li.cat-parent.active > ul.children,
body.woocommerce.archive #left-sidebar .widget_product_categories.widget-container ul.product-categories li.cat-parent.active > ul.children,
body.woocommerce.archive #right-sidebar .widget_product_categories.widget-container ul.product-categories li.cat-parent.active > ul.children,
body.woocommerce.archive #ts-filter-widget-area .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent.active > ul.children,
body.woocommerce.archive #left-sidebar .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent.active > ul.children,
body.woocommerce.archive #right-sidebar .ts-product-categories-widget.widget-container ul.mk-product-categories-filter li.cat-parent.active > ul.children {
	display: flex !important;
}

.widget_product_categories .dearyu-hidden-cat,
.mk-product-categories-filter .dearyu-hidden-cat {
	display: none !important;
}

.widget_product_categories + .dearyu-show-toggle,
.mk-product-categories-filter + .dearyu-show-toggle,
.widget_product_categories .dearyu-show-toggle,
.mk-product-cat-checkbox-mode .dearyu-show-toggle {
	display: block;
	width: 100%;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--ts-primary-color, #2e7d32);
	cursor: pointer;
	user-select: none;
	clear: both;
}

body.woocommerce.archive .widget_product_categories ul.product-categories > li,
body.woocommerce.archive .widget_product_categories ul.product-categories ul.children > li {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	gap: 0;
	line-height: 22px;
}

body.woocommerce.archive .widget_product_categories ul.product-categories li.cat-parent {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 20px;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 6px;
}

body.woocommerce.archive .widget_product_categories ul.product-categories li.cat-parent > label {
	grid-column: 1;
	grid-row: 1;
	width: auto;
	min-width: 0;
}

body.woocommerce.archive .widget_product_categories ul.product-categories li.cat-parent > .icon-toggle {
	grid-column: 2;
	grid-row: 1;
	justify-self: end;
}

body.woocommerce.archive .widget_product_categories ul.product-categories li.cat-parent > ul.children {
	grid-column: 1 / -1;
	grid-row: 2;
	width: 100%;
}

/* Live ThemeSky category widget: keep checkbox text and plus icon on one row. */
.ts-product-categories-widget .mk-product-cat-checkbox-mode > ul.mk-product-categories-filter > li {
	display: block !important;
	width: 100%;
	line-height: 22px;
}

.ts-product-categories-widget .mk-product-cat-checkbox-mode > ul.mk-product-categories-filter > li.cat-parent {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 20px;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 6px;
}

.ts-product-categories-widget .mk-product-cat-checkbox-mode > ul.mk-product-categories-filter > li.cat-parent > label {
	grid-column: 1;
	grid-row: 1;
	width: auto;
	min-width: 0;
}

.ts-product-categories-widget .mk-product-cat-checkbox-mode > ul.mk-product-categories-filter > li.cat-parent > .icon-toggle {
	grid-column: 2;
	grid-row: 1;
	display: inline-flex !important;
	justify-self: end;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 22px;
	margin: 0;
}

.ts-product-categories-widget .mk-product-cat-checkbox-mode > ul.mk-product-categories-filter > li.cat-parent > ul.children {
	grid-column: 1 / -1;
	grid-row: 2;
	width: 100%;
}

.ts-product-categories-widget .mk-product-cat-checkbox-mode > ul.mk-product-categories-filter > li.current-cat-parent > ul.children {
	display: flex !important;
}

.ts-product-categories-widget .mk-product-cat-checkbox-mode > ul.mk-product-categories-filter > li.dearyu-hidden-cat {
	display: none !important;
}

.mahakali-pca-active-filters .mk-active-filters-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.mahakali-pca-active-filters .mk-active-filters-title-row .widget-title {
	margin: 0;
	flex: 1;
	min-width: 0;
}

.mahakali-pca-active-filters .mk-clear-filters-btn {
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--ts-primary-color, #2e7d32);
	text-decoration: none;
	white-space: nowrap;
}

.mahakali-pca-active-filters .mk-clear-filters-btn:hover {
	text-decoration: underline;
}

