/* Category Accordion for WooCommerce 2.0 */
.tpcafw {
	--tpcafw-font-size: 16px;
	--tpcafw-text: #000;
	--tpcafw-hover: #00f;
	--tpcafw-active: #00f;
	--tpcafw-border: #ddd;
	--tpcafw-speed: 250ms;
}

.tpcafw ul,
.tpcafw li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tpcafw-list > .tpcafw-item:not(:last-child) {
	border-bottom: 1px solid var(--tpcafw-border);
}

.tpcafw-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.tpcafw .tpcafw-link {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	padding: 8px 0;
	color: var(--tpcafw-text);
	font-size: var(--tpcafw-font-size);
	text-decoration: none;
	box-shadow: none;
	transition: color 0.2s;
}

.tpcafw .tpcafw-link:hover,
.tpcafw .tpcafw-link:focus-visible,
.tpcafw .is-open > .tpcafw-row > .tpcafw-link:hover {
	color: var(--tpcafw-hover);
}

.tpcafw .is-open > .tpcafw-row > .tpcafw-link,
.tpcafw .is-current > .tpcafw-row > .tpcafw-link {
	color: var(--tpcafw-active);
}

.tpcafw-thumb {
	flex: none;
	width: 28px;
	height: 28px;
	object-fit: cover;
	border-radius: 3px;
}

.tpcafw-count {
	opacity: 0.6;
	font-size: 0.85em;
}

/* Toggle button */
.tpcafw .tpcafw-toggle {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 4px;
	box-shadow: none;
	color: var(--tpcafw-text);
	line-height: 1;
	cursor: pointer;
}

.tpcafw .tpcafw-toggle:hover {
	background: none;
	color: var(--tpcafw-hover);
}

.tpcafw .tpcafw-toggle:focus-visible,
.tpcafw .tpcafw-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.tpcafw-icon {
	display: block;
	line-height: 1;
	transition: transform var(--tpcafw-speed) ease;
}

/* Arrow icon (pure CSS, no icon font needed) */
.tpcafw--icon-arrow .tpcafw-icon::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	margin-inline-end: 3px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
}

.tpcafw--icon-arrow .is-open > .tpcafw-row .tpcafw-icon {
	transform: rotate(90deg);
}

.rtl .tpcafw--icon-arrow .tpcafw-icon::before {
	transform: rotate(135deg);
}

.rtl .tpcafw--icon-arrow .is-open > .tpcafw-row .tpcafw-icon {
	transform: rotate(-90deg);
}

/* Plus / minus icon */
.tpcafw--icon-plus .tpcafw-icon::before {
	content: "+";
	font-size: 20px;
}

.tpcafw--icon-plus .is-open > .tpcafw-row .tpcafw-icon::before {
	content: "\2212";
}

/* Subcategories */
.tpcafw .tpcafw-sub {
	padding-inline-start: 16px;
}

.tpcafw .tpcafw-sub[hidden] {
	display: none;
}

.tpcafw .tpcafw-sub .tpcafw-link {
	padding: 6px 0;
	font-size: max(12px, calc(var(--tpcafw-font-size) - 2px));
}

.tpcafw-empty {
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	.tpcafw * {
		transition: none !important;
	}
}
