/* ==========================================================================
   Collapsible product categories (WooCommerce "Product Categories" widget)
   Pairs with js/aic-category-accordion.js. Loaded from functions.php
   ("Collapsible shop categories" section).
   ========================================================================== */

/* Parent row: the name, then the arrow right after it, then the sub-list on its own line. */
.widget_product_categories ul.product-categories li.aic-cat-has-toggle {
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	justify-content: flex-start; /* TheGem's filter sidebar sets space-between, which pushes the arrow to the edge */
}
.widget_product_categories ul.product-categories li.aic-cat-has-toggle > a {
	flex: 0 1 auto;
	width: auto;
}
.widget_product_categories ul.product-categories li.aic-cat-has-toggle > ul.children {
	flex: 0 0 100%;
	width: 100%;
}

/* TheGem draws its own (non-clickable) arrow on parent rows with li:after - our button replaces it. */
.widget_product_categories > ul li.cat-parent.aic-cat-has-toggle:after {
	content: none !important; /* TheGem sets content on several current-cat variants */
}

.widget_product_categories .aic-cat-toggle {
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	margin: 0 0 0 4px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	line-height: 1;
}
.widget_product_categories .aic-cat-toggle:hover {
	background: #f0f3f5;
}
.widget_product_categories .aic-cat-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

/* Chevron: points down when closed, up when open. */
.widget_product_categories .aic-cat-toggle__icon {
	display: block;
	width: 7px;
	height: 7px;
	margin: 0 auto;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s ease;
}
.widget_product_categories .aic-cat-toggle[aria-expanded="true"] .aic-cat-toggle__icon {
	transform: translateY(2px) rotate(-135deg);
}

.widget_product_categories ul.children[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   Audio Packages tiers: a small square in the tier's colour before the name.
   Matched on the category address (slug), so renaming the label is fine.
   The text itself stays like every other category.
   -------------------------------------------------------------------------- */
.widget_product_categories ul.product-categories li li a[href$="/bronze/"]::before,
.widget_product_categories ul.product-categories li li a[href$="/silver/"]::before,
.widget_product_categories ul.product-categories li li a[href$="/gold/"]::before,
.widget_product_categories ul.product-categories li li a[href$="/platinum/"]::before {
	content: '';
	display: inline-block;
	float: none;
	width: 16px;
	height: 16px;
	margin: 0 10px 0 0;
	vertical-align: middle;
	position: relative;
	top: -2px;
	border-radius: 3px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); /* edge so the pale squares still read on white */
}
/* Silver is a clear mid grey and platinum a very light cool grey with a firmer edge,
   so the two differ in lightness - not just a slightly different pale grey. */
.widget_product_categories ul.product-categories li li a[href$="/bronze/"]::before   { background-color: #cd7f32; }
.widget_product_categories ul.product-categories li li a[href$="/silver/"]::before   { background-color: #9ea3a8; }
.widget_product_categories ul.product-categories li li a[href$="/gold/"]::before     { background-color: #d4af37; }
.widget_product_categories ul.product-categories li li a[href$="/platinum/"]::before {
	background-color: #eceef1;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
