/* ==========================================================================
   Product Filter Categories v1.1
   ========================================================================== */

/* --------------------------------------------------------------------------
   Sidebar wrapper
   -------------------------------------------------------------------------- */

.pfc-sidebar {
	font-family: inherit;
	font-size: 13px;
	color: #1a1a1a;
	line-height: 1.5;
}

/* --------------------------------------------------------------------------
   "View all collections" link
   -------------------------------------------------------------------------- */

.pfc-view-all {
	display: block;
	font-size: 12px;
	color: #555;
	text-decoration: none;
	margin-bottom: 10px;
	letter-spacing: 0.02em;
}

.pfc-view-all:hover {
	color: #000;
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Category tree
   -------------------------------------------------------------------------- */

.pfc-categories {
	margin-bottom: 28px;
}

.pfc-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Root level links */
.pfc-cat-root > .pfc-cat-item > .pfc-cat-row > .pfc-cat-link {
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Level 1 children – indented */
.pfc-cat-children {
	padding-left: 14px;
}

/* Level 1 links */
.pfc-cat-children > .pfc-cat-item > .pfc-cat-row > .pfc-cat-link {
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Level 2+ links – normal case */
.pfc-cat-children .pfc-cat-children > .pfc-cat-item > .pfc-cat-row > .pfc-cat-link {
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

/* Row: link + toggle button side by side */
.pfc-cat-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	padding: 4px 0;
}

/* Category link */
.pfc-cat-link {
	flex: 1;
	color: inherit;
	text-decoration: none;
	transition: color 0.15s;
}

.pfc-cat-link:hover {
	color: #555;
}

/* Active / ancestor → bold */
.pfc-cat-link.is-bold {
	font-weight: 700;
}

/* Chevron toggle button */
.pfc-toggle {
	flex-shrink: 0;
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: inherit;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.pfc-toggle svg {
	display: block;
	transition: transform 0.2s ease;
	transform-origin: center;
}

/* Rotate chevron when expanded */
.pfc-toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Filter section
   -------------------------------------------------------------------------- */

.pfc-filter {
	border-top: 1px solid #e5e5e5;
	padding-top: 20px;
}

.pfc-filter-heading {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 18px;
	padding: 0;
	letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   Shared checkbox (In Stock + Attributes)
   -------------------------------------------------------------------------- */

.pfc-checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
}

/* Visually hide the native checkbox */
.pfc-checkbox-label input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Custom square box */
.pfc-checkbox-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border: 1.5px solid #999;
	background: #fff;
	transition: border-color 0.15s, background 0.15s;
}

/* Checked state */
.pfc-checkbox-label input:checked ~ .pfc-checkbox-box {
	border-color: #1a1a1a;
	background: #1a1a1a;
}

/* Checkmark */
.pfc-checkbox-label input:checked ~ .pfc-checkbox-box::after {
	content: '';
	display: block;
	width: 10px;
	height: 6px;
	border-left: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(-47deg) translateY(-1px);
}

.pfc-checkbox-label:hover .pfc-checkbox-box {
	border-color: #1a1a1a;
}

.pfc-checkbox-text {
	font-size: 13px;
	color: #1a1a1a;
}

/* --------------------------------------------------------------------------
   In-stock filter
   -------------------------------------------------------------------------- */

.pfc-instock {
	margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Price range slider
   -------------------------------------------------------------------------- */

.pfc-price {
	margin-bottom: 20px;
}

.pfc-price-heading {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 14px;
	padding: 0;
}

/* Wrapper stacks both range inputs on top of each other */
.pfc-range-wrap {
	position: relative;
	height: 20px;
	margin: 0 4px 10px;
}

/* Visual track */
.pfc-range-track {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	left: 0;
	right: 0;
	height: 4px;
	background: #d0d0d0;
	border-radius: 2px;
	pointer-events: none;
	z-index: 1;
}

/* Filled portion between thumbs */
.pfc-range-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	background: #1a1a1a;
	border-radius: 2px;
}

/* Both range inputs overlap */
.pfc-range {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	left: 0;
	width: 100%;
	height: 4px;
	margin: 0;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
	pointer-events: none;
	outline: none;
	z-index: 2;
}

/* WebKit thumb */
.pfc-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #1a1a1a;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
	transition: transform 0.1s;
}

.pfc-range::-webkit-slider-thumb:hover,
.pfc-range::-webkit-slider-thumb:active {
	transform: scale(1.2);
}

/* Firefox thumb */
.pfc-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #1a1a1a;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.pfc-range::-moz-range-track {
	background: transparent;
}

/* Price labels */
.pfc-price-labels {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #555;
	margin-top: 4px;
}

.pfc-price-lo,
.pfc-price-hi {
	white-space: nowrap;
}

.pfc-price-sep {
	flex: 1;
	text-align: center;
	color: #999;
}

/* --------------------------------------------------------------------------
   Attribute filters
   -------------------------------------------------------------------------- */

.pfc-attribute {
	margin-bottom: 18px;
}

.pfc-attribute-heading {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 10px;
	padding: 0;
}

.pfc-attribute-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* --------------------------------------------------------------------------
   AJAX – Results wrapper loading state
   -------------------------------------------------------------------------- */

#pfc-results {
	position: relative;
	transition: opacity 0.25s ease;
}

#pfc-results.pfc-loading {
	opacity: 0.45;
	pointer-events: none;
	user-select: none;
}

/* Centered spinner overlay */
#pfc-results.pfc-loading::after {
	content: '';
	position: absolute;
	top: 60px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 99;
	width: 34px;
	height: 34px;
	border: 3px solid #e0e0e0;
	border-top-color: #1a1a1a;
	border-radius: 50%;
	animation: pfc-spin 0.75s linear infinite;
}

@keyframes pfc-spin {
	to { transform: translateX(-50%) rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Pagination (injected via AJAX)
   -------------------------------------------------------------------------- */

.pfc-pagination {
	margin-top: 24px;
	text-align: center;
}

.pfc-pagination ul {
	list-style: none;
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	padding: 0;
}

.pfc-pagination ul li a,
.pfc-pagination ul li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	border: 1px solid #ddd;
	color: #1a1a1a;
	text-decoration: none;
	font-size: 13px;
	transition: background 0.15s, border-color 0.15s;
}

.pfc-pagination ul li a:hover {
	background: #f5f5f5;
	border-color: #bbb;
}

.pfc-pagination ul li span.current {
	background: #1a1a1a;
	border-color: #1a1a1a;
	color: #fff;
}
