/**
 * NexaShop Desktop & Tablet Navbar Elementor Widget Styles (فهرست ناوبری پیشرفته و مگامنو)
 *
 * Implements the horizontal navbar with tool icons, chevron toggles (Image 1),
 * visual subcategory dropdowns with tool images and left arrows (Image 2),
 * and the integrated Category Megamenu button.
 *
 * @package NexaShop
 * @subpackage ElementorWidgets\Header
 */

/* =========================================
   1. کانتینر اصلی ناوبری (Shell & Wrapper)
   ========================================= */

.nexashop-navbar-shell,
.nexashop-navbar-shell * {
	box-sizing: border-box;
}

.nexashop-navbar-shell {
	width: 100%;
	direction: rtl;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
	position: relative;
	z-index: 990;
	background: #ffffff;
	border-bottom: 1px solid #ebeef2;
	transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.nexashop-navbar-shell.is-sticky {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 998;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.nexashop-navbar-inner {
	width: 100%;
	max-width: 1380px;
	margin: 0 auto;
	padding-inline: 16px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 16px;
	position: relative;
}

/* =========================================
   2. دکمه مگامنو دسته‌بندی‌ها (All Categories Button)
   ========================================= */

.nexashop-navbar-cats-btn-wrap {
	position: relative;
	flex: 0 0 auto;
}

.nexashop-navbar-cats-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 40px;
	padding-inline: 14px 12px;
	background: #ff9b00;
	color: #1a1e21;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none !important;
	cursor: pointer;
	white-space: nowrap;
	user-select: none;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.nexashop-navbar-cats-btn:hover,
.nexashop-navbar-cats-btn-wrap.is-open .nexashop-navbar-cats-btn {
	background: #e88d00;
	color: #000000;
	box-shadow: 0 4px 12px rgba(255, 155, 0, 0.28);
}

.nexashop-navbar-cats-btn__icon {
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 20px;
}

.nexashop-navbar-cats-btn__icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.nexashop-navbar-cats-btn__icon i {
	font-size: 17px;
	line-height: 1;
}

.nexashop-navbar-cats-btn__title {
	letter-spacing: -0.2px;
}

.nexashop-navbar-cats-btn__chevron {
	width: 14px;
	height: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 14px;
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nexashop-navbar-cats-btn__chevron svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
	fill: none;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.nexashop-navbar-cats-btn-wrap.is-open .nexashop-navbar-cats-btn__chevron,
.nexashop-navbar-cats-btn-wrap:hover .nexashop-navbar-cats-btn__chevron {
	transform: rotate(180deg);
}

.nexashop-navbar-cats-btn__badge {
	background: #1a1e21;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 999px;
	line-height: 1.4;
	margin-right: 2px;
}

/* پنل مگامنو دسته‌بندی‌ها (Categories Megamenu Dropdown) */
.nexashop-navbar-cats-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	width: 720px;
	max-width: 90vw;
	background: #ffffff;
	border: 1px solid #e5e9ee;
	border-radius: 12px;
	box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.04);
	display: flex;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.22s ease;
	z-index: 1000;
	overflow: hidden;
}

.nexashop-navbar-cats-btn-wrap:hover .nexashop-navbar-cats-panel,
.nexashop-navbar-cats-btn-wrap.is-open .nexashop-navbar-cats-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

/* ستون راست والدها */
.nexashop-navbar-cats-parents {
	width: 250px;
	flex: 0 0 250px;
	background: #fafbfc;
	border-left: 1px solid #ebeff3;
	padding: 10px 0;
	margin: 0;
	list-style: none;
	max-height: 480px;
	overflow-y: auto;
}

.nexashop-navbar-cats-parents::-webkit-scrollbar {
	width: 4px;
}

.nexashop-navbar-cats-parents::-webkit-scrollbar-thumb {
	background: #d8dee6;
	border-radius: 4px;
}

.nexashop-navbar-cats-parent-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	color: #2b3137;
	text-decoration: none !important;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, padding-right 0.15s ease;
}

.nexashop-navbar-cats-parent-item:hover,
.nexashop-navbar-cats-parent-item.is-active {
	background: #ffffff;
	color: #ff9b00;
	padding-right: 20px;
}

.nexashop-navbar-cats-parent-item__info {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.nexashop-navbar-cats-parent-item__icon {
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.nexashop-navbar-cats-parent-item__icon img,
.nexashop-navbar-cats-parent-item__icon svg {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.nexashop-navbar-cats-parent-item__title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nexashop-navbar-cats-parent-item__arrow {
	width: 12px;
	height: 12px;
	stroke: #9aa2ac;
	fill: none;
	stroke-width: 2;
}

.nexashop-navbar-cats-parent-item:hover .nexashop-navbar-cats-parent-item__arrow {
	stroke: #ff9b00;
}

/* ستون چپ زیردسته‌ها */
.nexashop-navbar-cats-subpane {
	flex: 1 1 auto;
	padding: 18px 20px;
	max-height: 480px;
	overflow-y: auto;
	display: none;
}

.nexashop-navbar-cats-subpane.is-active {
	display: block;
}

.nexashop-navbar-cats-subgrid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px 14px;
}

/* بنر هدایت مستقیم برای دسته‌های بدون زیردسته مگامنو */
.nexashop-navbar-cats-direct-banner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 36px 20px;
	background: #f8fafc;
	border: 1px dashed #d0d7de;
	border-radius: 12px;
	min-height: 260px;
	height: 100%;
}

.nexashop-navbar-cats-direct-icon {
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #ff9b00;
	margin-bottom: 12px;
}

.nexashop-navbar-cats-direct-icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.nexashop-navbar-cats-direct-title {
	font-size: 16px;
	font-weight: 700;
	color: #1a1e21;
	margin: 0 0 6px 0;
}

.nexashop-navbar-cats-direct-desc {
	font-size: 13px;
	color: #636b75;
	margin: 0 0 16px 0;
}

.nexashop-navbar-cats-direct-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	background: #ff9b00;
	color: #1a1e21 !important;
	font-size: 13px;
	font-weight: 700;
	border-radius: 6px;
	text-decoration: none !important;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.nexashop-navbar-cats-direct-btn:hover {
	background: #e88d00;
	transform: translateX(-3px);
}

.nexashop-navbar-cats-parent-item[data-has-sub="0"] {
	cursor: pointer;
}


/* =========================================
   3. لیست منوی افقی دسکتاپ و تبلت (Horizontal Menu Bar - Image 1)
   ========================================= */

.nexashop-navbar-nav-wrap {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	overflow: visible;
}

.nexashop-navbar-menu {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 6px;
	height: 100%;
	direction: rtl;
}

/* هر آیتم والد در منوی اصلی */
.nexashop-navbar-item {
	position: relative;
	height: 100%;
	display: flex;
	align-items: center;
	white-space: nowrap;
}

/* لینک آیتم والد - مطابق تصویر ۱ */
.nexashop-navbar-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 100%;
	padding-inline: 12px;
	color: #2b3036;
	text-decoration: none !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	position: relative;
	transition: color 0.18s ease, background-color 0.18s ease;
	border-radius: 6px;
	user-select: none;
}

.nexashop-navbar-link:hover,
.nexashop-navbar-item:hover > .nexashop-navbar-link,
.nexashop-navbar-item.is-open > .nexashop-navbar-link,
.nexashop-navbar-item.current-menu-item > .nexashop-navbar-link,
.nexashop-navbar-item.current-menu-ancestor > .nexashop-navbar-link {
	color: #ff9b00;
}

/* خط نشانگر هاور زیر لینک والد */
.nexashop-navbar-link::after {
	content: "";
	position: absolute;
	bottom: 0;
	right: 12px;
	left: 12px;
	height: 2px;
	background: #ff9b00;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 2px 2px 0 0;
}

.nexashop-navbar-link:hover::after,
.nexashop-navbar-item:hover > .nexashop-navbar-link::after,
.nexashop-navbar-item.is-open > .nexashop-navbar-link::after,
.nexashop-navbar-item.current-menu-item > .nexashop-navbar-link::after {
	transform: scaleX(1);
}

/* آیکون آیتم والد (در سمت راست عنوان در جهت RTL) */
.nexashop-navbar-link__icon {
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 20px;
	color: currentColor;
	transition: transform 0.2s ease;
}

.nexashop-navbar-link__icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.nexashop-navbar-link__icon svg.is-stroked {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.nexashop-navbar-link__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.nexashop-navbar-link__icon i {
	font-size: 18px;
	line-height: 1;
}

.nexashop-navbar-item:hover .nexashop-navbar-link__icon {
	transform: translateY(-1px);
}

/* عنوان آیتم */
.nexashop-navbar-link__title {
	font-family: inherit;
	letter-spacing: -0.2px;
}

/* فلش رو به پایین (Chevron Down - در سمت چپ عنوان در جهت RTL) */
.nexashop-navbar-link__chevron {
	width: 14px;
	height: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 14px;
	color: #636b75;
	transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.18s ease;
}

.nexashop-navbar-link__chevron svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
	fill: none;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.nexashop-navbar-item:hover > .nexashop-navbar-link .nexashop-navbar-link__chevron,
.nexashop-navbar-item.is-open > .nexashop-navbar-link .nexashop-navbar-link__chevron {
	transform: rotate(180deg);
	color: #ff9b00;
}

/* بج آیتم */
.nexashop-navbar-link__badge {
	font-size: 10px;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 999px;
	background: #ffe3b3;
	color: #b86500;
	line-height: 1.3;
	margin-right: 2px;
}


/* =========================================
   4. منوی آبشاری تصویری زیردسته‌ها (Image 2 Dropdown Panel)
   ========================================= */

.nexashop-nav-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	min-width: 260px;
	max-width: 340px;
	background: #ffffff;
	border: 1px solid #e7ecf2;
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 3px 8px rgba(0, 0, 0, 0.04);
	padding: 14px 12px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s ease;
	z-index: 1001;
}

/* پل نامرئی هاور برای پیوستگی حرکت ماوس */
.nexashop-nav-dropdown::after {
	content: "";
	position: absolute;
	top: -14px;
	right: 0;
	left: 0;
	height: 14px;
	background: transparent;
}

/* باز شدن با هاور، فوکوس یا کلاس is-open */
.nexashop-navbar-item:hover > .nexashop-nav-dropdown,
.nexashop-navbar-item:focus-within > .nexashop-nav-dropdown,
.nexashop-navbar-item.is-open > .nexashop-nav-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

/* سه‌گوش اشاره‌گر بالای منوی آبشاری */
.nexashop-nav-dropdown::before {
	content: "";
	position: absolute;
	top: -6px;
	right: 24px;
	width: 12px;
	height: 12px;
	background: #ffffff;
	border-top: 1px solid #e7ecf2;
	border-right: 1px solid #e7ecf2;
	transform: rotate(45deg);
	border-radius: 2px;
}

/* هدر منوی آبشاری (Category Header - مانند ابزار تخریب با آیکون نارنجی در تصویر ۲) */
.nexashop-nav-dropdown__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 6px 12px 6px;
	border-bottom: 1px solid #f0f3f6;
	margin-bottom: 8px;
	color: #1a1e21;
	text-decoration: none !important;
}

.nexashop-nav-dropdown__header-icon {
	width: 26px;
	height: 26px;
	flex: 0 0 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #ff9b00;
}

.nexashop-nav-dropdown__header-icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.nexashop-nav-dropdown__header-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.nexashop-nav-dropdown__header-title {
	font-size: 15px;
	font-weight: 800;
	color: #1a1e21;
	letter-spacing: -0.2px;
}

/* لیست زیردسته‌ها */
.nexashop-nav-dropdown__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* هر سطر زیردسته - مطابق تصویر ۲ */
.nexashop-subcat-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 10px;
	border-radius: 8px;
	color: #2c3138;
	text-decoration: none !important;
	transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
	position: relative;
}

.nexashop-subcat-item:hover {
	background-color: #f7f9fc;
	color: #ff9b00;
}

/* بخش سمت راست: تصویر محصول/زیردسته + عنوان */
.nexashop-subcat-item__main {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	flex: 1 1 auto;
}

/* عکس بندانگشتی ابزار در تصویر ۲ */
.nexashop-subcat-item__thumb {
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	border-radius: 6px;
	background: #fbfcfd;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: transform 0.2s ease;
}

.nexashop-subcat-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.nexashop-subcat-item__thumb svg {
	width: 24px;
	height: 24px;
	color: #ff9b00;
	fill: currentColor;
}

.nexashop-subcat-item__thumb i {
	font-size: 22px;
	color: #ff9b00;
	line-height: 1;
}

.nexashop-subcat-item:hover .nexashop-subcat-item__thumb img,
.nexashop-subcat-item:hover .nexashop-subcat-item__thumb svg,
.nexashop-subcat-item:hover .nexashop-subcat-item__thumb i {
	transform: scale(1.08);
}

/* بج زیردسته */
.nexashop-subcat-item__badge {
	display: inline-block;
	margin-right: 6px;
	padding: 2px 7px;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.2;
	color: #d97706;
	background-color: #fef3c7;
	border-radius: 9999px;
	white-space: nowrap;
}

/* عنوان زیردسته */
.nexashop-subcat-item__title {
	font-size: 13.5px;
	font-weight: 500;
	color: inherit;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: -0.15px;
}

/* فلش رو به چپ (Arrow Chevron Left: `<` در تصویر ۲) */
.nexashop-subcat-item__arrow {
	width: 15px;
	height: 15px;
	flex: 0 0 15px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #9aa2ac;
	transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), color 0.18s ease;
}

.nexashop-subcat-item__arrow svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
	fill: none;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.nexashop-subcat-item:hover .nexashop-subcat-item__arrow {
	transform: translateX(-4px);
	color: #ff9b00;
}


/* =========================================
   5. بخش اکشن‌ها و ابزارهای سمت چپ (Left Utilities)
   ========================================= */

.nexashop-navbar-extra {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-right: auto; /* در حالت RTL به سمت چپ نوار می‌چسبد */
	flex: 0 0 auto;
}

.nexashop-navbar-extra-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #555e69;
	text-decoration: none !important;
	font-size: 13px;
	font-weight: 600;
	transition: color 0.18s ease;
}

.nexashop-navbar-extra-link:hover {
	color: #ff9b00;
}

.nexashop-navbar-extra-link svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}


/* =========================================
   6. پشتیبانی تبلت و واکنش‌گرایی (Tablet & Mobile Responsiveness)
   ========================================= */

@media (max-width: 1024px) {
	.nexashop-navbar-inner {
		padding-inline: 12px;
		gap: 10px;
	}

	.nexashop-navbar-link {
		padding-inline: 8px;
		font-size: 13px;
		gap: 6px;
	}

	.nexashop-navbar-link__icon {
		width: 18px;
		height: 18px;
		flex-basis: 18px;
	}

	.nexashop-navbar-cats-btn {
		font-size: 12.5px;
		padding-inline: 10px;
		gap: 6px;
	}

	.nexashop-navbar-cats-panel {
		width: 540px;
	}

	.nexashop-navbar-cats-parents {
		width: 200px;
		flex-basis: 200px;
	}
}

@media (max-width: 768px) {
	.nexashop-navbar-extra {
		display: none;
	}

	.nexashop-navbar-cats-panel {
		width: 92vw;
		right: 4vw;
	}

	.nexashop-nav-dropdown {
		right: auto;
		left: 0;
	}
}

/* کاهش انیمیشن سیستم */
@media (prefers-reduced-motion: reduce) {
	.nexashop-navbar-link,
	.nexashop-navbar-link::after,
	.nexashop-navbar-link__chevron,
	.nexashop-nav-dropdown,
	.nexashop-subcat-item,
	.nexashop-subcat-item__arrow,
	.nexashop-navbar-cats-panel {
		transition: none !important;
	}
}
