/**
 * EduNexa — ادونکسا
 * Mobile Bottom Navigation Bar Styles (منوی ناوبری پایین صفحه موبایل)
 *
 * - Floating capsule / card at bottom of mobile viewport (border-radius: 24px)
 * - Backdrop blur glassmorphism, spotlight glow, active state detection
 * - Live WooCommerce cart counter badge & verified student badges
 * - Safe bottom padding offset coordination
 *
 * @package EduNexa
 * @since   1.2.0
 */

.edunexa-mobile-bottom-nav {
	--edunexa-mbn-box-bg: rgba(255, 255, 255, 0.94);
	--edunexa-mbn-box-border: rgba(255, 255, 255, 0.88);
	--edunexa-mbn-blur: 16px;
	--edunexa-mbn-bottom-gap: 12px;
	--edunexa-mbn-side-gap: 14px;
	--edunexa-mbn-icon-size: 24px;
	--edunexa-mbn-icon-box-size: 34px;
	--edunexa-mbn-icon-color: #475569;
	--edunexa-mbn-icon-active-color: #FAB237;
	--edunexa-mbn-icon-bg: transparent;
	--edunexa-mbn-icon-active-bg: rgba(250, 178, 55, 0.12);
	--edunexa-mbn-text-color: #64748b;
	--edunexa-mbn-text-active-color: #0f172a;
	--edunexa-mbn-glow-color: #FAB237;

	position: fixed;
	left: var(--edunexa-mbn-side-gap, 14px);
	right: var(--edunexa-mbn-side-gap, 14px);
	bottom: var(--edunexa-mbn-bottom-gap, 12px);
	z-index: 997;
	direction: rtl;
	box-sizing: border-box;
	pointer-events: none; /* children enable pointer events */
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Device Breakpoint Visibility */
@media (min-width: 768px) {
	.edunexa-mobile-bottom-nav.edunexa-mbn-vis-mobile_only:not(.edunexa-mbn-editor-visible) {
		display: none !important;
	}
}

@media (min-width: 1025px) {
	.edunexa-mobile-bottom-nav.edunexa-mbn-vis-mobile_tablet:not(.edunexa-mbn-editor-visible),
	.edunexa-mobile-bottom-nav:not(.edunexa-mbn-editor-visible) {
		display: none !important;
	}
}

/* Keep centered & mobile-sized when previewing inside Desktop Elementor Editor */
.edunexa-mobile-bottom-nav.edunexa-mbn-editor-visible {
	max-width: 480px;
	margin: 0 auto;
}

/* Hide automatically when full drawer is open */
body.Edu-drawer-open .edunexa-mobile-bottom-nav.edunexa-mbn-hide-on-drawer {
	transform: translateY(140%);
	opacity: 0;
	pointer-events: none;
}

/* =========================================================================
   BAR INNER (CAPSULE CARD)
   ========================================================================= */
.edunexa-mbn-bar-inner {
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: space-around;
	background: var(--edunexa-mbn-box-bg, rgba(255, 255, 255, 0.94));
	border: 1px solid var(--edunexa-mbn-box-border, rgba(226, 232, 240, 0.8));
	border-radius: 24px;
	box-shadow: 0 10px 32px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
	padding: 6px 8px;
	position: relative;
	overflow: hidden;
	backdrop-filter: blur(var(--edunexa-mbn-blur, 16px));
	-webkit-backdrop-filter: blur(var(--edunexa-mbn-blur, 16px));
}

.edunexa-mobile-bottom-nav.edunexa-mbn-is-glass .edunexa-mbn-bar-inner {
	background: rgba(255, 255, 255, 0.85);
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
	.edunexa-mobile-bottom-nav:not([data-theme="light"]) .edunexa-mbn-bar-inner {
		background: rgba(15, 23, 42, 0.92);
		border-color: rgba(51, 65, 85, 0.8);
		box-shadow: 0 10px 32px -4px rgba(0, 0, 0, 0.45);
	}
	.edunexa-mobile-bottom-nav:not([data-theme="light"]) {
		--edunexa-mbn-icon-color: #94a3b8;
		--edunexa-mbn-text-color: #94a3b8;
		--edunexa-mbn-text-active-color: #f8fafc;
	}
}

/* Subtle Light Shimmer across the top border of the Glass Bar */
.edunexa-mbn-border-shimmer {
	position: absolute;
	top: 0;
	left: -50%;
	width: 45%;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--edunexa-mbn-glow-color, #FAB237), transparent);
	animation: edunexaMbnBarEdgeSweep 4s ease-in-out infinite;
	z-index: 10;
	pointer-events: none;
}

@keyframes edunexaMbnBarEdgeSweep {
	0% { left: -65%; }
	60%, 100% { left: 125%; }
}

/* =========================================================================
   ITEMS TRACK & ITEM BUTTONS
   ========================================================================= */
.edunexa-mbn-items-track {
	display: flex;
	align-items: center;
	justify-content: space-around;
	width: 100%;
	position: relative;
	z-index: 2;
}

.edunexa-mbn-item {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 5px 4px;
	text-decoration: none;
	background: transparent;
	border: none;
	outline: none;
	cursor: pointer;
	position: relative;
	color: var(--edunexa-mbn-text-color, #64748b);
	font-family: inherit;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	-webkit-tap-highlight-color: transparent;
	border-radius: 14px;
	min-width: 48px;
}

.edunexa-mbn-item.has-pill-bg {
	background: rgba(250, 178, 55, 0.12);
	border: 1px solid rgba(250, 178, 55, 0.3);
}

/* Text Position Modifiers */
.edunexa-mbn-item.edunexa-mbn-text-pos-inline {
	flex-direction: row;
	gap: 6px;
}

.edunexa-mbn-item.edunexa-mbn-text-pos-top {
	flex-direction: column-reverse;
}

/* Top Spotlight Light Effect for Active / Hovered Item */
.edunexa-mbn-spotlight {
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%);
	width: 28px;
	height: 3px;
	border-radius: 999px;
	background: var(--edunexa-mbn-glow-color, #FAB237);
	box-shadow: 0 0 10px 1px var(--edunexa-mbn-glow-color, #FAB237);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.edunexa-mbn-light-spotlight_shimmer .edunexa-mbn-item.is-active .edunexa-mbn-spotlight,
.edunexa-mbn-light-spotlight_shimmer .edunexa-mbn-item:hover .edunexa-mbn-spotlight,
.edunexa-mbn-light-active_spotlight .edunexa-mbn-item.is-active .edunexa-mbn-spotlight {
	opacity: 1;
}

/* Icon Wrapper */
.edunexa-mbn-icon-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--edunexa-mbn-icon-box-size, 34px);
	height: var(--edunexa-mbn-icon-box-size, 34px);
	border-radius: 12px;
	background: var(--edunexa-mbn-icon-bg, transparent);
	color: var(--edunexa-mbn-icon-color, #475569);
	position: relative;
	transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.edunexa-mbn-icon-wrap svg,
.edunexa-mbn-icon-wrap i {
	width: var(--edunexa-mbn-icon-size, 24px);
	height: var(--edunexa-mbn-icon-size, 24px);
	display: block;
	fill: currentColor;
	transition: transform 0.25s ease;
}

/* Hover & Active States */
.edunexa-mbn-item:hover .edunexa-mbn-icon-wrap,
.edunexa-mbn-item.is-active .edunexa-mbn-icon-wrap {
	color: var(--edunexa-mbn-icon-active-color, #FAB237);
	background: var(--edunexa-mbn-icon-active-bg, rgba(250, 178, 55, 0.12));
}

.edunexa-mbn-hover-spring_lift .edunexa-mbn-item:hover .edunexa-mbn-icon-wrap,
.edunexa-mbn-hover-spring_lift .edunexa-mbn-item:active .edunexa-mbn-icon-wrap {
	transform: translateY(-3px) scale(1.08);
}

.edunexa-mbn-hover-bounce_pop .edunexa-mbn-item:hover .edunexa-mbn-icon-wrap {
	transform: scale(1.15);
}

.edunexa-mbn-hover-scale_only .edunexa-mbn-item:hover .edunexa-mbn-icon-wrap {
	transform: scale(1.06);
}

/* Item Text Label */
.edunexa-mbn-label {
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	margin-top: 3px;
	color: var(--edunexa-mbn-text-color, #64748b);
	white-space: nowrap;
	transition: color 0.2s ease, font-weight 0.2s ease;
	letter-spacing: -0.2px;
}

.edunexa-mbn-item:hover .edunexa-mbn-label,
.edunexa-mbn-item.is-active .edunexa-mbn-label {
	color: var(--edunexa-mbn-text-active-color, #0f172a);
	font-weight: 700;
}

/* =========================================================================
   BADGES (CART COUNT & VERIFIED CHECKS)
   ========================================================================= */
.edunexa-mbn-badge {
	position: absolute;
	z-index: 5;
	pointer-events: none;
}

/* Orange Verified Checkmark on bottom-left of User Icon */
.edunexa-mbn-badge-verified {
	bottom: -2px;
	left: -2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #f97316;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.edunexa-mbn-badge-verified svg {
	width: 8px;
	height: 8px;
	stroke: #ffffff;
	stroke-width: 2.5;
	fill: none;
}

/* Cart Count & Custom Badge */
.edunexa-mbn-badge-count,
.edunexa-mbn-badge-custom {
	top: -4px;
	right: -6px;
	background: #ef4444;
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #ffffff;
	box-shadow: 0 2px 5px rgba(239, 68, 68, 0.35);
	line-height: 1;
}

.edunexa-mbn-badge-count.is-zero {
	display: none !important;
}

.edunexa-mbn-badge-dot {
	top: 0;
	right: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ef4444;
	border: 1.5px solid #ffffff;
}

/* =========================================================================
   SEARCH MODAL BOTTOM SHEET
   ========================================================================= */
.edunexa-mbn-search-modal {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: none;
	direction: rtl;
}

.edunexa-mbn-search-modal.is-open {
	display: block;
}

.edunexa-mbn-search-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.edunexa-mbn-search-sheet {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: #ffffff;
	border-radius: 24px 24px 0 0;
	padding: 20px 20px 32px;
	box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
	transform: translateY(100%);
	transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.edunexa-mbn-search-modal.is-open .edunexa-mbn-search-sheet {
	transform: translateY(0);
}

.edunexa-mbn-search-sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.edunexa-mbn-search-sheet-head h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
}

.edunexa-mbn-search-close {
	background: #f1f5f9;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: #64748b;
}

.edunexa-mbn-search-form {
	position: relative;
	display: flex;
	align-items: center;
}

.edunexa-mbn-search-input {
	width: 100%;
	height: 48px;
	padding: 0 44px 0 16px;
	border-radius: 14px;
	border: 1.5px solid #e2e8f0;
	background: #f8fafc;
	font-family: inherit;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s ease;
}

.edunexa-mbn-search-input:focus {
	border-color: #FAB237;
	background: #ffffff;
}

.edunexa-mbn-search-submit {
	position: absolute;
	right: 12px;
	background: transparent;
	border: none;
	color: #64748b;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.edunexa-mbn-search-submit svg {
	width: 20px;
	height: 20px;
}
