/**
 * EduNexa — ادونکسا
 * Shop & Course Toolbar Stylesheet
 * Responsive Desktop & Mobile Toolbar with 60fps Draggable Bottom Sheet for Sorting
 *
 * @package EduNexa
 * @author  امیر حسین بناوند (Amir Hossein Banavand)
 * @link    https://npocto.ir
 */

/* ==========================================================================
   1. DESKTOP & TABLET TOOLBAR CONTAINER (> 768px)
   ========================================================================== */
.edunexa-toolbar-outer-container {
	width: 100%;
	direction: rtl;
	box-sizing: border-box;
	margin-block-end: 1.5rem;
}

.edunexa-toolbar-wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	padding: 0.85rem 1.25rem;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 2px 10px rgba(34, 39, 51, 0.04);
	transition: all 0.25s ease;
	box-sizing: border-box;
}

.edunexa-toolbar-right {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex: 1 1 auto;
	min-width: 0;
}

.edunexa-toolbar-label {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.875rem;
	font-weight: 800;
	color: #1e293b;
	white-space: nowrap;
	flex-shrink: 0;
}

.edunexa-toolbar-label svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
	color: #fab237;
}

/* Sorting Tabs List */
.edunexa-sort-tabs {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	white-space: nowrap;
	-webkit-overflow-scrolling: touch;
}

.edunexa-sort-tabs::-webkit-scrollbar {
	display: none;
}

.edunexa-sort-tab-item {
	display: inline-block;
	margin: 0 !important;
	padding: 0 !important;
}

.edunexa-sort-tab-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.45rem 0.95rem;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 10px;
	color: #64748b;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	outline: none;
	white-space: nowrap;
	font-family: inherit;
	user-select: none;
	gap: 0.4rem;
}

.edunexa-sort-tab-btn:hover {
	color: #1e293b;
	background: rgba(250, 178, 55, 0.1);
}

.edunexa-sort-tab-btn.is-active {
	color: #1e293b;
	background: #fab237;
	font-weight: 800;
	box-shadow: 0 4px 12px rgba(250, 178, 55, 0.35);
}

.edunexa-tab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.edunexa-tab-icon svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/* Left Side: Counter & Quick Toggles */
.edunexa-toolbar-left {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
}

.edunexa-toolbar-instock-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125rem;
	font-weight: 700;
	color: #475569;
	cursor: pointer;
	user-select: none;
	position: relative;
}

.edunexa-toolbar-instock-toggle input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.edunexa-toolbar-instock-slider {
	position: relative;
	width: 36px;
	height: 20px;
	background-color: #cbd5e1;
	border-radius: 99px;
	transition: all 0.25s ease;
}

.edunexa-toolbar-instock-slider::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	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-toolbar-instock-toggle input:checked + .edunexa-toolbar-instock-slider {
	background-color: #fab237;
}

.edunexa-toolbar-instock-toggle input:checked + .edunexa-toolbar-instock-slider::before {
	transform: translateX(-16px);
}

.edunexa-toolbar-count {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.8125rem;
	font-weight: 700;
	color: #475569;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	padding: 0.45rem 0.85rem;
	border-radius: 10px;
	white-space: nowrap;
}

.edunexa-count-number {
	font-weight: 900;
	color: #1e293b;
}

/* ==========================================================================
   2. MOBILE 2-ROW TOOLBAR CARD (<= 768px)
   ========================================================================== */
.edunexa-toolbar-mobile-card {
	display: none;
	width: 100%;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	overflow: hidden;
	margin-block-end: 1rem;
	direction: rtl;
	box-sizing: border-box;
}

.edunexa-mtb-top-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1rem;
	border-block-end: 1px solid #f1f5f9;
	gap: 0.5rem;
}

.edunexa-mtb-archive-title {
	font-size: 0.9375rem;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.edunexa-mtb-result-range {
	font-size: 0.75rem;
	font-weight: 600;
	color: #64748b;
	white-space: nowrap;
	flex-shrink: 0;
}

.edunexa-mtb-actions-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: stretch;
	background: #ffffff;
}

.edunexa-mtb-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.8rem 1rem;
	background: transparent;
	border: none;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	color: #1e293b;
	cursor: pointer;
	transition: background-color 0.15s ease;
	outline: none;
	user-select: none;
}

.edunexa-mtb-action-btn:first-child {
	border-inline-end: 1px solid #f1f5f9;
}

.edunexa-mtb-action-btn:active {
	background-color: #f8fafc;
}

.edunexa-mtb-action-btn svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
}

/* ==========================================================================
   3. MOBILE DRAGGABLE BOTTOM SHEET MODAL (SORTING)
   ========================================================================== */
.edunexa-mobile-sort-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;
}

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

.edunexa-mobile-sort-sheet {
	width: 100%;
	max-width: 520px;
	max-height: 85vh;
	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-sort-sheet-backdrop.is-active .edunexa-mobile-sort-sheet {
	transform: translateY(0);
}

.edunexa-bottom-sheet-drag-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 0 0.35rem;
	cursor: grab;
	touch-action: none;
}

.edunexa-bottom-sheet-drag-handle {
	width: 44px;
	height: 4.5px;
	background: #cbd5e1;
	border-radius: 99px;
}

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

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

.edunexa-mss-close {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #f1f5f9;
	border: none;
	color: #64748b;
	font-size: 1.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	line-height: 1;
	transition: all 0.15s ease;
}

.edunexa-mss-close:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.edunexa-mss-options-list {
	padding: 0.85rem 1.25rem 1.5rem;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	-webkit-overflow-scrolling: touch;
}

.edunexa-mss-option-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1rem;
	border-radius: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #334155;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	outline: none;
	text-align: right;
}

.edunexa-mss-option-card:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.edunexa-mss-option-card.is-active {
	background: rgba(250, 178, 55, 0.12);
	border-color: #fab237;
	color: #1e293b;
	font-weight: 900;
}

.edunexa-mss-opt-check {
	display: none;
	color: #fab237;
}

.edunexa-mss-option-card.is-active .edunexa-mss-opt-check {
	display: inline-flex;
}

/* ==========================================================================
   4. RESPONSIVE BREAKPOINT
   ========================================================================== */
@media (max-width: 768px) {
	.edunexa-toolbar-desktop-view {
		display: none !important;
	}

	.edunexa-toolbar-mobile-card {
		display: block !important;
	}
}
