/**
 * NexaShop Mobile Bottom Navigation Bar Styles (منو موبایلی پایین صفحه)
 * Matches media_1790268879870.png + Glassmorphism + Light/Glow Animations + Zero-Collision Coordination
 */

.nexashop-mobile-bottom-nav {
	--ns-mbn-box-bg: rgba(255, 255, 255, 0.94);
	--ns-mbn-box-border: rgba(255, 255, 255, 0.88);
	--ns-mbn-blur: 18px;
	--ns-mbn-bottom-gap: 10px;
	--ns-mbn-side-gap: 12px;
	--ns-mbn-icon-size: 24px;
	--ns-mbn-icon-box-size: 34px;
	--ns-mbn-icon-color: #2c3338;
	--ns-mbn-icon-active-color: #5bc470;
	--ns-mbn-icon-bg: transparent;
	--ns-mbn-icon-active-bg: rgba(91, 196, 112, 0.12);
	--ns-mbn-text-color: #2c3338;
	--ns-mbn-text-active-color: #1e293b;
	--ns-mbn-glow-color: #5bc470;

	position: fixed;
	left: var(--ns-mbn-side-gap, 12px);
	right: var(--ns-mbn-side-gap, 12px);
	bottom: calc(var(--ns-mbn-bottom-gap, 10px) + env(safe-area-inset-bottom, 0px));
	z-index: 99985;
	direction: rtl;
	pointer-events: none;
	transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
	            opacity 0.32s ease,
	            visibility 0.38s ease;
	will-change: transform, opacity;
}

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

@media (min-width: 1025px) {
	body:not(.elementor-editor-active) .nexashop-mobile-bottom-nav.ns-mbn-vis-mobile_and_tablet {
		display: none !important;
	}
}

/* Keep centered & mobile-sized when previewing inside Desktop Elementor Editor */
@media (min-width: 769px) {
	body.elementor-editor-active .nexashop-mobile-bottom-nav.ns-mbn-editor-visible {
		max-width: 440px;
		margin-left: auto;
		margin-right: auto;
	}
}

/* =========================================================================
   SMART ZERO-COLLISION ANIMATION WHEN HAMBURGER MENU OPENS
   (وقتی منوی همبرگری باز می‌شود، این نوار با انیمیشن نرم به پایین رفته و مخفی می‌شود)
   ========================================================================= */
body.ns-hamburger-open .nexashop-mobile-bottom-nav.ns-mbn-hide-on-hamburger,
body.ns-mbn-temp-hidden .nexashop-mobile-bottom-nav {
	transform: translateY(135%) scale(0.96) !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/* =========================================================================
   FLOATING CAPSULE BAR CONTAINER (media_1790268879870.png)
   ========================================================================= */
.ns-mbn-bar-inner {
	pointer-events: auto;
	position: relative;
	background: var(--ns-mbn-box-bg, rgba(255, 255, 255, 0.94));
	border: 1px solid var(--ns-mbn-box-border, rgba(255, 255, 255, 0.88));
	border-radius: 26px;
	padding: 10px 14px;
	box-shadow: 0 12px 34px rgba(15, 23, 42, 0.10), 0 2px 10px rgba(15, 23, 42, 0.04);
	overflow: hidden;
}

.nexashop-mobile-bottom-nav.ns-mbn-is-glass .ns-mbn-bar-inner {
	backdrop-filter: blur(var(--ns-mbn-blur, 18px)) saturate(180%);
	-webkit-backdrop-filter: blur(var(--ns-mbn-blur, 18px)) saturate(180%);
}

/* Subtle Light Shimmer across the top border of the Glass Bar */
.ns-mbn-border-shimmer {
	position: absolute;
	top: 0;
	left: -100%;
	width: 65%;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--ns-mbn-glow-color, #5bc470), rgba(255, 255, 255, 0.95), transparent);
	opacity: 0.75;
	pointer-events: none;
	animation: nsMbnShimmerSlide 5.5s ease-in-out infinite;
}

@keyframes nsMbnShimmerSlide {
	0% {
		left: -70%;
	}
	55%, 100% {
		left: 125%;
	}
}

/* =========================================================================
   ITEMS TRACK & INDIVIDUAL NAV ITEMS
   ========================================================================= */
.ns-mbn-items-track {
	display: flex;
	align-items: center;
	justify-content: space-around;
	gap: 6px;
	width: 100%;
}

.ns-mbn-item {
	position: relative;
	flex: 1 1 0%;
	min-width: 0;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 4px 4px;
	border-radius: 16px;
	text-decoration: none !important;
	background: var(--item-pill-bg, transparent);
	color: var(--item-text-color, var(--ns-mbn-text-color, #2c3338));
	transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	-webkit-tap-highlight-color: transparent;
}

.ns-mbn-item.has-pill-bg {
	padding: 8px 12px;
	flex: 0 0 auto;
}

/* Text Position Modifiers */
.ns-mbn-item.ns-mbn-text-pos-inline {
	flex-direction: row;
	gap: 7px;
	padding: 8px 13px;
}

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

/* Top Spotlight Light Effect for Active / Hovered Item */
.ns-mbn-spotlight {
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%) scaleX(0.3);
	width: 28px;
	height: 3px;
	border-radius: 0 0 8px 8px;
	background: var(--item-icon-active-color, var(--ns-mbn-glow-color, #5bc470));
	box-shadow: 0 4px 14px var(--item-icon-active-color, var(--ns-mbn-glow-color, #5bc470));
	opacity: 0;
	transition: opacity 0.28s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	pointer-events: none;
}

.ns-mbn-light-spotlight_shimmer .ns-mbn-item.is-active .ns-mbn-spotlight,
.ns-mbn-light-spotlight_shimmer .ns-mbn-item:hover .ns-mbn-spotlight,
.ns-mbn-light-active_spotlight .ns-mbn-item.is-active .ns-mbn-spotlight,
.ns-mbn-light-active_spotlight .ns-mbn-item:hover .ns-mbn-spotlight {
	opacity: 1;
	transform: translateX(-50%) scaleX(1);
}

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

.ns-mbn-icon-wrap svg,
.ns-mbn-icon-wrap i {
	width: var(--ns-mbn-icon-size, 24px);
	height: var(--ns-mbn-icon-size, 24px);
	font-size: var(--ns-mbn-icon-size, 24px);
	display: block;
}

/* Hover & Active States */
.ns-mbn-item:hover .ns-mbn-icon-wrap,
.ns-mbn-item.is-active .ns-mbn-icon-wrap {
	background: var(--item-icon-active-bg, var(--ns-mbn-icon-active-bg, rgba(91, 196, 112, 0.12)));
	color: var(--item-icon-active-color, var(--ns-mbn-icon-active-color, #5bc470));
}

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

.ns-mbn-hover-bounce_pop .ns-mbn-item:hover .ns-mbn-icon-wrap {
	animation: nsMbnPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

@keyframes nsMbnPop {
	0% { transform: scale(1); }
	50% { transform: scale(1.18) translateY(-3px); }
	100% { transform: scale(1.05); }
}

/* Item Text Label */
.ns-mbn-label {
	font-size: 11.5px;
	font-weight: 700;
	color: var(--item-text-color, var(--ns-mbn-text-color, #2c3338));
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
	transition: color 0.22s ease, font-weight 0.22s ease;
}

.ns-mbn-item:hover .ns-mbn-label,
.ns-mbn-item.is-active .ns-mbn-label {
	color: var(--item-icon-active-color, var(--ns-mbn-text-active-color, #1e293b));
	font-weight: 800;
}

/* =========================================================================
   BADGES (Orange Checkmark matching media_1790268879870.png + Cart Counter)
   ========================================================================= */
.ns-mbn-badge {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1.8px solid #ffffff;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
	z-index: 2;
}

/* Orange Verified Checkmark on bottom-left of User Icon (matches media_1790268879870.png) */
.ns-mbn-badge-verified {
	bottom: 1px;
	left: 1px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background-color: #e67e22;
}

.ns-mbn-badge-verified svg {
	width: 9px !important;
	height: 9px !important;
}

/* Cart Count & Custom Badge */
.ns-mbn-badge-count,
.ns-mbn-badge-custom {
	top: -3px;
	right: -4px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 99px;
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
}

.ns-mbn-badge-count.is-zero {
	display: none;
}

.ns-mbn-badge-dot {
	top: 1px;
	right: 2px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

/* =========================================================================
   MOBILE QUICK SEARCH MODAL (Triggered by Search Item)
   ========================================================================= */
.ns-mbn-search-modal {
	position: fixed;
	inset: 0;
	z-index: 999992;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.ns-mbn-search-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.ns-mbn-search-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.52);
	backdrop-filter: blur(3px);
}

.ns-mbn-search-sheet {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: calc(var(--ns-mobile-bottom-nav-offset, 84px) + 8px);
	background: #ffffff;
	border-radius: 22px;
	padding: 18px;
	box-shadow: 0 18px 46px rgba(15, 23, 42, 0.22);
	transform: translateY(20px);
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

.ns-mbn-search-sheet-head h4 {
	margin: 0;
	font-size: 14px;
	font-weight: 800;
	color: #1e293b;
}

.ns-mbn-search-close {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: none;
	background: #f1f5f9;
	color: #334155;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

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

.ns-mbn-search-input {
	width: 100%;
	height: 46px;
	border-radius: 14px !important;
	border: 1.5px solid #e2e8f0 !important;
	background: #f8fafc !important;
	padding: 0 14px 0 46px !important;
	font-size: 13.5px !important;
	color: #1e293b !important;
	outline: none !important;
}

.ns-mbn-search-input:focus {
	border-color: #5bc470 !important;
	background: #ffffff !important;
}

.ns-mbn-search-submit {
	position: absolute;
	left: 6px;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	border: none;
	background: #5bc470;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.ns-mbn-search-submit svg {
	width: 18px;
	height: 18px;
}
