.shasta-mega-menu,
.shasta-mega-menu * {
	box-sizing: border-box;
}

.shasta-mega-menu {
	--smm-panel-width: 1000px;
	--smm-panel-top: 130px;
	--smm-primary-width: 220px;
	--smm-accent: #1e3a8a;
	direction: rtl;
	font-family: Vazirmatn, Vazir, Tahoma, Arial, sans-serif;
}

.shasta-mega-menu__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	vertical-align: middle;
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	min-width: 52px;
	min-height: 52px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: #0f172a;
	font: inherit;
	font-size: 21px;
	line-height: 1 !important;
	cursor: pointer;
	appearance: none;
	transition: color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.shasta-mega-menu__toggle svg,
.shasta-mega-menu__toggle i {
	display: block;
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	margin: 0;
	line-height: 1;
}

.shasta-mega-menu__toggle:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}

.shasta-mega-menu__toggle svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.shasta-mega-menu__backdrop {
	position: fixed;
	inset: 0;
	z-index: 999998;
	background: rgba(15, 23, 42, .28);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .25s ease, visibility .25s ease;
}

.shasta-mega-menu__backdrop.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.shasta-mega-menu__panel {
	position: fixed;
	top: var(--smm-panel-top);
	left: 50%;
	z-index: 999999;
	width: min(var(--smm-panel-width), 95vw);
	max-height: calc(100dvh - var(--smm-panel-top) - 20px);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .65);
	border-radius: 20px;
	background: linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(248, 250, 255, .90));
	box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
	backdrop-filter: blur(22px) saturate(180%);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(-50%) translateY(8px) scale(.985);
	transform-origin: top center;
	transition: opacity .25s ease, visibility .25s ease, transform .25s cubic-bezier(.22, 1, .36, 1);
}

.shasta-mega-menu__panel.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0) scale(1);
}

.shasta-mega-menu__layout {
	display: flex;
	min-height: 330px;
	max-height: inherit;
}

.shasta-mega-menu__primary {
	position: relative;
	flex: 0 0 var(--smm-primary-width);
	width: var(--smm-primary-width);
	padding: 24px 0;
	overflow: hidden;
	border-left: 1px solid rgba(30, 58, 138, .08);
	background: rgba(248, 250, 255, .82);
}

.shasta-mega-menu__primary::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	background: linear-gradient(90deg, var(--smm-accent), #3b82f6, transparent);
	opacity: .75;
}

.shasta-mega-menu__tabs {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.shasta-mega-menu__tab {
	display: flex;
	align-items: center;
	gap: 10px;
	position: relative;
	width: calc(100% - 32px);
	min-height: 52px;
	margin: 0 auto;
	padding: 11px 12px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: #4b5563;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4 !important;
	text-align: right;
	cursor: pointer;
	appearance: none;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.shasta-mega-menu__tab:hover,
.shasta-mega-menu__tab[aria-selected="true"] {
	color: var(--smm-accent);
	background: rgba(30, 58, 138, .10);
}

.shasta-mega-menu__tab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background: rgba(30, 58, 138, .07);
	color: var(--smm-accent);
	font-size: 16px;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.shasta-mega-menu__tab-icon svg,
.shasta-mega-menu__link-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.shasta-mega-menu__tab[aria-selected="true"] .shasta-mega-menu__tab-icon {
	background: var(--smm-accent);
	color: #fff;
	box-shadow: 0 4px 12px rgba(30, 58, 138, .25);
}

.shasta-mega-menu__tab-arrow {
	display: block;
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	margin-right: auto;
	border: 0;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	opacity: .35;
	transform: rotate(-45deg);
}

.shasta-mega-menu__indicator {
	position: absolute;
	right: 0;
	width: 3px;
	height: 32px;
	border-radius: 4px 0 0 4px;
	background: linear-gradient(180deg, var(--smm-accent), #3b82f6);
	box-shadow: -2px 0 10px rgba(59, 130, 246, .4);
	opacity: 0;
	pointer-events: none;
	transition: top .3s ease, opacity .2s ease;
}

/* Front-end reset: keep theme button/inline SVG defaults from moving the
 * trigger and primary tabs. The extra class scope preserves Elementor's
 * generated per-widget controls without relying on !important. */
.shasta-mega-menu .shasta-mega-menu__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	line-height: 1;
}

.shasta-mega-menu .shasta-mega-menu__toggle svg,
.shasta-mega-menu .shasta-mega-menu__toggle i {
	display: block;
	flex: 0 0 auto;
	margin: 0;
	line-height: 1;
}

.shasta-mega-menu .shasta-mega-menu__tab {
	display: flex;
	align-items: center;
	padding: 11px 12px;
	margin-inline: auto;
	border: 0;
	background: transparent;
	line-height: 1.4;
}

.shasta-mega-menu .shasta-mega-menu__tab-arrow {
	display: block;
	flex: 0 0 auto;
	margin-inline-start: auto;
	margin-inline-end: 0;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.shasta-mega-menu__content {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	padding: 28px;
	overflow: auto;
	overscroll-behavior: contain;
}

.shasta-mega-menu__tabpanel {
	display: none;
	flex-direction: column;
	gap: 16px;
	min-height: 274px;
}

.shasta-mega-menu__tabpanel.is-active {
	display: flex;
	animation: smm-panel-in .28s ease both;
}

.shasta-mega-menu__heading {
	padding-bottom: 14px;
	border-bottom: 1px solid rgba(30, 58, 138, .09);
}

.shasta-mega-menu__heading h3 {
	margin: 0 0 4px;
	color: var(--smm-accent);
	font-size: 16px;
	font-weight: 800;
	line-height: 1.4;
}

.shasta-mega-menu__heading p {
	margin: 0;
	color: #87909f;
	font-size: 12px;
	line-height: 1.6;
}

.shasta-mega-menu__links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.shasta-mega-menu__link {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 42px;
	padding: 9px 12px;
	border: 1px solid rgba(30, 58, 138, .08);
	border-radius: 11px;
	background: rgba(255, 255, 255, .62);
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.shasta-mega-menu__link:hover {
	border-color: rgba(30, 58, 138, .18);
	color: var(--smm-accent);
	transform: translateY(-2px);
}

.shasta-mega-menu__link-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	background: rgba(30, 58, 138, .08);
	color: #3b82f6;
	font-size: 14px;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.shasta-mega-menu__link:hover .shasta-mega-menu__link-icon {
	background: var(--smm-accent);
	color: #fff;
}

.shasta-mega-menu__toggle:focus-visible,
.shasta-mega-menu__tab:focus-visible,
.shasta-mega-menu__link:focus-visible {
	outline: 3px solid rgba(59, 130, 246, .38);
	outline-offset: 3px;
}

body.shasta-mega-menu-lock {
	overflow: hidden !important;
}

@keyframes smm-panel-in {
	from {
		opacity: 0;
		transform: translateX(-8px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@media (max-width: 1024px) {
	.shasta-mega-menu {
		--smm-panel-top: 88px;
		--smm-primary-width: 190px;
	}

	.shasta-mega-menu__panel {
		width: min(var(--smm-panel-width), 94vw);
		max-height: calc(100dvh - var(--smm-panel-top) - 18px);
	}

	.shasta-mega-menu__primary {
		padding: 18px 0;
	}

	.shasta-mega-menu__content {
		padding: 22px 20px;
	}
}

@media (max-width: 767px) {
	.shasta-mega-menu__panel {
		inset: max(66px, calc(env(safe-area-inset-top) + 56px)) 10px max(10px, env(safe-area-inset-bottom));
		width: auto;
		max-height: none;
		border-radius: 18px;
		transform: translateY(10px) scale(.99);
	}

	.shasta-mega-menu__panel.is-open {
		transform: translateY(0) scale(1);
	}

	.shasta-mega-menu__layout {
		flex-direction: column;
		height: 100%;
		min-height: 0;
	}

	.shasta-mega-menu__primary {
		flex: 0 0 auto;
		width: 100%;
		padding: 12px 8px 10px;
		border-left: 0;
		border-bottom: 1px solid rgba(30, 58, 138, .08);
	}

	.shasta-mega-menu__tabs {
		flex-direction: row;
		gap: 6px;
		padding: 0 4px 3px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}

	.shasta-mega-menu__tabs::-webkit-scrollbar {
		display: none;
	}

	.shasta-mega-menu__tab {
		flex: 0 0 auto;
		width: auto;
		min-width: 112px;
		margin: 0;
		padding: 9px 10px;
		white-space: nowrap;
		scroll-snap-align: start;
	}

	.shasta-mega-menu__tab-arrow,
	.shasta-mega-menu__indicator {
		display: none;
	}

	.shasta-mega-menu__content {
		flex: 1 1 auto;
		min-height: 0;
		padding: 18px 16px 20px;
	}

	.shasta-mega-menu__tabpanel {
		min-height: 0;
	}

	.shasta-mega-menu__links {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 480px) {
	.shasta-mega-menu__panel {
		inset-inline: 6px;
		bottom: max(6px, env(safe-area-inset-bottom));
		border-radius: 15px;
	}

	.shasta-mega-menu__tab {
		min-width: 98px;
		padding: 8px;
		font-size: 12px;
	}

	.shasta-mega-menu__content {
		padding: 15px 12px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shasta-mega-menu *,
	.shasta-mega-menu__backdrop,
	.shasta-mega-menu__panel {
		animation: none !important;
		transition-duration: .01ms !important;
	}
}
