/**
 * EduNexa — ادونکسا
 * Shop & Course Filters Stylesheet
 * Desktop Modern Accordion & Mobile Draggable Off-Canvas Filter Sheet
 *
 * @package EduNexa
 * @author  امیر حسین بناوند (Amir Hossein Banavand)
 * @link    https://npocto.ir
 */

.edunexa-filters-outer-container {
	width: 100%;
	direction: rtl;
	box-sizing: border-box;
}

.edunexa-filters-wrap {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	box-sizing: border-box;
}

/* ==========================================================================
   1. ACCORDION FILTER GROUP CARD
   ========================================================================== */
.edunexa-filter-group {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
	overflow: hidden;
	transition: all 0.25s ease;
}

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

.edunexa-filter-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.95rem 1.15rem;
	cursor: pointer;
	user-select: none;
	background: #ffffff;
	transition: background-color 0.2s ease;
}

.edunexa-filter-header:hover {
	background: #f8fafc;
}

.edunexa-filter-title-wrap {
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

.edunexa-filter-title {
	font-size: 0.9375rem;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
}

.edunexa-filter-icon {
	color: #fab237;
	display: inline-flex;
	align-items: center;
	font-size: 1rem;
}

.edunexa-filter-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
	transition: transform 0.25s ease, color 0.2s ease;
}

.edunexa-filter-arrow svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
}

.edunexa-filter-group.is-collapsed .edunexa-filter-arrow {
	transform: rotate(-90deg);
}

.edunexa-filter-body {
	padding: 1rem 1.15rem 1.25rem;
	border-block-start: 1px solid #f1f5f9;
}

/* ==========================================================================
   2. FILTER COMPONENTS (SEARCH, CATS, INSTRUCTORS, LEVEL, PRICE, SWITCHES)
   ========================================================================== */

/* Search Input */
.edunexa-filter-search-box {
	position: relative;
	width: 100%;
}

.edunexa-filter-search-input {
	width: 100%;
	height: 44px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	font-family: inherit;
	font-size: 0.8125rem;
	color: #1e293b;
	padding: 0 1rem 0 2.5rem;
	outline: none;
	box-sizing: border-box;
	transition: all 0.2s ease;
	text-align: right;
}

.edunexa-filter-search-input:focus {
	border-color: #fab237;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(250, 178, 55, 0.15);
}

.edunexa-filter-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	pointer-events: none;
	display: flex;
}

/* Filter Checkbox Lists (Categories, Instructors, Levels) */
.edunexa-filter-checkbox-list {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	max-height: 240px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.edunexa-filter-checkbox-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
	font-size: 0.8125rem;
	color: #334155;
	transition: color 0.15s ease;
}

.edunexa-filter-checkbox-item:hover {
	color: #0f172a;
}

.edunexa-filter-cb-label {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	flex: 1;
	min-width: 0;
}

.edunexa-filter-cb-custom {
	width: 18px;
	height: 18px;
	border: 1.5px solid #cbd5e1;
	border-radius: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.2s ease;
	background: #ffffff;
}

.edunexa-filter-checkbox-item input {
	display: none;
}

.edunexa-filter-checkbox-item input:checked + .edunexa-filter-cb-custom {
	background: #fab237;
	border-color: #fab237;
	color: #1e293b;
}

.edunexa-filter-cb-custom svg {
	display: none;
	width: 11px;
	height: 11px;
	stroke: currentColor;
	stroke-width: 3;
}

.edunexa-filter-checkbox-item input:checked + .edunexa-filter-cb-custom svg {
	display: block;
}

.edunexa-filter-cb-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 600;
}

.edunexa-filter-cb-count {
	font-size: 0.75rem;
	font-weight: 700;
	color: #94a3b8;
	background: #f1f5f9;
	padding: 0.15rem 0.5rem;
	border-radius: 99px;
}

/* Price Range Slider */
.edunexa-price-filter-wrap {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.edunexa-price-slider-track-wrap {
	position: relative;
	height: 24px;
	display: flex;
	align-items: center;
}

.edunexa-price-slider-bar {
	width: 100%;
	height: 6px;
	background: #e2e8f0;
	border-radius: 99px;
	position: relative;
}

.edunexa-price-slider-highlight {
	position: absolute;
	height: 100%;
	background: #fab237;
	border-radius: 99px;
}

.edunexa-price-range-input {
	position: absolute;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	background: transparent;
	top: 9px;
	right: 0;
	margin: 0;
}

.edunexa-price-range-input::-webkit-slider-thumb {
	pointer-events: auto;
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ffffff;
	border: 3px solid #fab237;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: transform 0.15s ease;
}

.edunexa-price-range-input::-webkit-slider-thumb:hover {
	transform: scale(1.15);
}

.edunexa-price-inputs-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.edunexa-price-box {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	flex: 1;
}

.edunexa-price-box label {
	font-size: 0.75rem;
	font-weight: 700;
	color: #64748b;
}

.edunexa-price-box-val {
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 0.4rem 0.6rem;
	font-size: 0.8125rem;
	font-weight: 800;
	color: #1e293b;
	text-align: center;
	direction: ltr;
}

/* Switches (In-Stock, Sale, Free) */
.edunexa-filter-switches-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.edunexa-filter-switch-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
}

.edunexa-filter-switch-title {
	font-size: 0.8125rem;
	font-weight: 700;
	color: #334155;
}

.edunexa-filter-switch-toggle {
	position: relative;
	width: 38px;
	height: 22px;
	background-color: #cbd5e1;
	border-radius: 99px;
	transition: all 0.25s ease;
}

.edunexa-filter-switch-toggle::before {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background-color: #ffffff;
	top: 2px;
	right: 2px;
	transition: transform 0.25s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.edunexa-filter-switch-row input {
	display: none;
}

.edunexa-filter-switch-row input:checked + .edunexa-filter-switch-toggle {
	background-color: #fab237;
}

.edunexa-filter-switch-row input:checked + .edunexa-filter-switch-toggle::before {
	transform: translateX(-16px);
}

/* Active Filters Chips Bar */
.edunexa-active-filters-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	margin-block-end: 0.75rem;
}

.edunexa-active-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	color: #334155;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.25rem 0.65rem;
	border-radius: 99px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.edunexa-active-chip:hover {
	background: #fee2e2;
	border-color: #fca5a5;
	color: #ef4444;
}

.edunexa-active-chip-remove {
	font-size: 1rem;
	line-height: 1;
}

.edunexa-active-clear-all {
	font-size: 0.75rem;
	font-weight: 800;
	color: #ef4444;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	text-decoration: underline;
}

/* Action Buttons (Apply & Reset) */
.edunexa-filter-actions {
	display: flex;
	gap: 0.75rem;
	margin-block-start: 0.5rem;
}

.edunexa-filter-btn-apply {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	background: #fab237;
	color: #1e293b;
	border: none;
	border-radius: 12px;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	font-weight: 800;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 4px 14px rgba(250, 178, 55, 0.35);
}

.edunexa-filter-btn-apply:hover {
	background: #e09923;
	transform: translateY(-2px);
}

.edunexa-filter-btn-reset {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	background: #f8fafc;
	color: #64748b;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	padding: 0.75rem 1rem;
	font-size: 0.8125rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
}

.edunexa-filter-btn-reset:hover {
	background: #fee2e2;
	border-color: #fca5a5;
	color: #ef4444;
}

/* ==========================================================================
   3. MOBILE DRAGGABLE BOTTOM SHEET MODAL (FILTERS)
   ========================================================================== */
.edunexa-mobile-filter-sheet-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 99999;
	opacity: 0;
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	align-items: flex-end;
	justify-content: center;
	direction: rtl;
}

.edunexa-mobile-filter-sheet-backdrop.is-active {
	display: flex;
	opacity: 1;
}

.edunexa-mobile-filter-sheet {
	width: 100%;
	max-width: 520px;
	height: 90vh;
	max-height: 90vh;
	background: #ffffff;
	border-radius: 20px 20px 0 0;
	box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(100%);
	transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
	box-sizing: border-box;
}

.edunexa-mobile-filter-sheet-backdrop.is-active .edunexa-mobile-filter-sheet {
	transform: translateY(0);
}

.edunexa-mfs-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1.25rem;
	border-block-end: 1px solid #f1f5f9;
	flex-shrink: 0;
}

.edunexa-mfs-title-box {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.edunexa-mfs-title {
	font-size: 1rem;
	font-weight: 800;
	color: #0f172a;
}

.edunexa-mfs-reset-btn {
	background: transparent;
	border: none;
	color: #ef4444;
	font-size: 0.8125rem;
	font-weight: 700;
	cursor: pointer;
}

.edunexa-mfs-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 1rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	-webkit-overflow-scrolling: touch;
}

.edunexa-mfs-footer {
	padding: 0.85rem 1.25rem 1.25rem;
	border-block-start: 1px solid #f1f5f9;
	background: #ffffff;
	flex-shrink: 0;
}

.edunexa-mfs-apply-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.85rem 1rem;
	background: #fab237;
	color: #1e293b;
	border: none;
	border-radius: 14px;
	font-size: 0.9375rem;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(250, 178, 55, 0.35);
}

/* On Desktop hide mobile sheets */
@media (min-width: 769px) {
	.edunexa-mobile-filter-sheet-backdrop {
		display: none !important;
	}
}

/* On Mobile hide desktop filter accordions so sidebar does not consume space, keeping bottom sheet functional */
@media (max-width: 768px) {
	.edunexa-filters-wrap,
	.edunexa-active-filters-bar {
		display: none !important;
	}

	.edunexa-filters-outer-container {
		display: block !important;
		margin: 0 !important;
		padding: 0 !important;
	}
}

