/**
 * Collapsible subcategories for the "Shop By Categories" layered-nav widget.
 * Children are hidden until the parent term is expanded via the +/- toggle.
 */

.tmcore-wp-widget-product-categories-layered-nav .wc-layered-nav-term {
	position: relative;
}

/* Grown/shrunk in JS to fit expanded subcategories instead of clipping them. */
.tmcore-wp-widget-product-categories-layered-nav.widget-scrollable .widget-content-inner {
	transition: max-height .2s ease;
}

.tmcore-wp-widget-product-categories-layered-nav .wc-layered-nav-term > ul.children {
	display: none;
	margin: 6px 0 4px 22px !important;
	padding: 0 0 0 12px !important;
	border-left: 2px solid #eee;
	list-style: none;
}

.tmcore-wp-widget-product-categories-layered-nav .wc-layered-nav-term.expanded > ul.children {
	display: block;
}

.tmcore-wp-widget-product-categories-layered-nav .wc-layered-nav-term.has-children > a {
	display: inline-block;
	margin-right: 4px;
}

.tmcore-wp-widget-product-categories-layered-nav .term-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	line-height: 14px;
	border: 1px solid #cfcfcf;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 700;
	color: #777;
	cursor: pointer;
	user-select: none;
	vertical-align: middle;
	background: #fff;
	transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.tmcore-wp-widget-product-categories-layered-nav .term-toggle:hover,
.tmcore-wp-widget-product-categories-layered-nav .term-toggle:focus-visible {
	border-color: #ffa500;
	color: #ffa500;
	outline: none;
}

.tmcore-wp-widget-product-categories-layered-nav .term-toggle::before {
	content: "+";
}

.tmcore-wp-widget-product-categories-layered-nav .wc-layered-nav-term.expanded > .term-toggle {
	border-color: #ffa500;
	background: #ffa500;
	color: #fff;
}

.tmcore-wp-widget-product-categories-layered-nav .wc-layered-nav-term.expanded > .term-toggle::before {
	content: "\2212";
}

/* Parent of the active subcategory filter: show it as active too (same colored
   label + ticked checkbox the theme gives .chosen), so e.g. filtering by
   "Abstract" leaves both "Wallpapers" and "Abstract" visibly active. */
.tmcore-wp-widget-filter ul .child-chosen > a {
	color: var(--global-palette1) !important;
}

.tmcore-wp-widget-filter ul.list-style-checkbox .child-chosen > a:after {
	-webkit-transform: scale(1, 1);
	-ms-transform: scale(1, 1);
	transform: scale(1, 1);
}

.tmcore-wp-widget-product-categories-layered-nav ul.children .wc-layered-nav-term {
	margin: 0 0 6px 0;
}

.tmcore-wp-widget-product-categories-layered-nav ul.children .wc-layered-nav-term:last-child {
	margin-bottom: 0;
}
