/* ==========================================================================
   Aroma Product Filter Widget
   Design tokens: primary #1660aa  |  header #104375
                  text-dark #1f2937  |  text-muted #4b5563
                  border-light #f3f4f6  |  border-cb #d1d5db
   ========================================================================== */

/* ── Widget card ──────────────────────────────────────────────────────────── */
.apf-widget {
	background: #fff;
	padding: 16px;
	border-radius: 16px;
	border: 1px solid #f3f4f6;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* ── Widget header (icon + title) ─────────────────────────────────────────── */
.apf-widget-header {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 20px;
	color: #104375;
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 1px solid #f3f4f6;
	line-height: 1.2;
}

.apf-widget-header svg,
.apf-widget-header i,
.apf-widget-header .e-font-icon-svg {
	flex-shrink: 0;
	color: inherit;
	width: 20px;
	height: 20px;
}

/* ── Filter groups ────────────────────────────────────────────────────────── */
.apf-filter-group {
	border-bottom: 1px solid #f3f4f6;
	padding: 16px 0;
	display: flex;
	flex-direction: column;
}

.apf-filter-group:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

/* ── Group toggle button ──────────────────────────────────────────────────── */
.apf-group-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 700;
	font-size: 0.89em;  /* 17px */
	color: #1f2937;
	background: none;
	border: none;
	padding: 0;
	margin-bottom: 0;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	line-height: 1.4;
	transition: color 0.15s;
}

/* Elementor kit override — .elementor-kit-38 button has specificity 0,1,1 */
body .apf-group-toggle {
	background-color: transparent;
	background: none;
	color: #1f2937;
	border-radius: 0;
	font-weight: 700;
}

body .apf-group-toggle:hover,
body .apf-group-toggle:focus,
body .apf-group-toggle:active {
	background-color: transparent;
	color: #1660aa;
	outline: none;
}

.apf-group-toggle:hover,
.apf-group-toggle:focus,
.apf-group-toggle:active {
	color: #1660aa;
	background: none;
	outline: none;
}

.apf-chevron {
	flex-shrink: 0;
	transition: transform 0.2s ease;
	color: currentColor;
}

.apf-filter-group.apf-collapsed .apf-chevron {
	transform: rotate(180deg);
}

/* ── Group body ───────────────────────────────────────────────────────────── */
.apf-group-body {
	overflow: hidden;
}

.apf-filter-group.apf-collapsed .apf-group-body {
	display: none;
}

/* ── Items list (checkboxes container) ────────────────────────────────────── */
.apf-items-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
}

/* ── Custom checkbox item ─────────────────────────────────────────────────── */
.apf-filter-item--checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding: 0;
	font-family: inherit;
	line-height: 1.4;
}

.apf-custom-cb {
	width: 0.89em;   /* 17px — tracks text size */
	height: 0.89em;
	border-radius: 0.21em;  /* ~4px */
	border: 1px solid #d1d5db;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-sizing: border-box;
	transition: border-color 0.15s, background-color 0.15s;
}

.apf-filter-item--checkbox:hover .apf-custom-cb {
	border-color: #1660aa;
}

.apf-filter-item--checkbox.apf-checked .apf-custom-cb {
	background-color: #1660aa;
	border-color: #1660aa;
}

/* Checkmark */
.apf-filter-item--checkbox.apf-checked .apf-custom-cb::after {
	content: '';
	display: block;
	width: 4px;
	height: 7px;
	border: 1.5px solid #fff;
	border-top: 0;
	border-left: 0;
	transform: rotate(45deg) translate(0px, -1px);
}

.apf-checkbox {
	display: none;
}

.apf-cb-text {
	font-size: 0.89em;  /* 17px */
	font-weight: 500;
	color: #4b5563;
	transition: color 0.15s;
}

.apf-filter-item--checkbox:hover .apf-cb-text {
	color: #1660aa;
}

.apf-filter-item--checkbox.apf-checked .apf-cb-text {
	color: #1660aa;
}

/* ── Button-style items (pill buttons — used with "Buttons" display style) ── */
.apf-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--apf-gap, 8px);
	align-items: center;
	margin-top: 12px;
}

.apf-filter-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 14px;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	background: #fff;
	color: #4b5563;
	font-size: 0.89em;  /* 17px */
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	line-height: 1.4;
	transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

/* Elementor kit override — .elementor-kit-38 button sets bg/color/border-radius/font-weight */
body .apf-filter-item {
	background-color: #fff;
	color: #4b5563;
	border-radius: 20px;
	font-weight: 500;
}

body .apf-filter-item:hover {
	background-color: #fff;
	border-color: #1660aa;
	color: #1660aa;
}

body .apf-filter-item[aria-pressed="true"] {
	background-color: #1660aa;
	border-color: #1660aa;
	color: #fff;
	font-weight: 600;
}

.apf-filter-item:hover {
	border-color: #1660aa;
	color: #1660aa;
}

.apf-filter-item[aria-pressed="true"] {
	background: #1660aa;
	border-color: #1660aa;
	color: #fff;
	font-weight: 600;
}

/* ── Loading state ────────────────────────────────────────────────────────── */
.elementor-widget.apf-loading {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s;
}

/* ── Editor empty notice ──────────────────────────────────────────────────── */
.apf-empty-notice {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 16px;
	background: #f9fafb;
	color: #9ca3af;
	font-size: 13px;
	border: 1px dashed #e5e7eb;
	border-radius: 8px;
	text-align: center;
}

/* ── Price Range Slider ───────────────────────────────────────────────────── */
.apf-price-range {
	padding: 4px 0 8px;
}

.apf-price-display {
	display: flex;
	align-items: center;
	font-size: 13px;
	color: #4b5563;
	margin-bottom: 16px;
}

.apf-price-separator {
	margin: 0 6px;
	color: #9ca3af;
}

.apf-slider-track-wrap {
	padding: 0 9px;
}

.apf-slider-track {
	position: relative;
	height: 4px;
	background: #e5e7eb;
	border-radius: 2px;
	margin: 12px 0;
}

.apf-slider-range {
	position: absolute;
	top: 0;
	height: 100%;
	background: #1660aa;
	border-radius: 2px;
	pointer-events: none;
}

.apf-slider-handle {
	position: absolute;
	top: 50%;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #1660aa;
	border: 2px solid #1660aa;
	transform: translate(-50%, -50%);
	cursor: grab;
	box-sizing: border-box;
	transition: box-shadow 0.15s;
	touch-action: none;
}

.apf-slider-handle:active {
	cursor: grabbing;
}

.apf-slider-handle:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(22, 96, 170, 0.3);
}

.apf-slider-track-wrap.apf-dragging {
	user-select: none;
}
