/* ===========================
   /* ===========================
   Theme Compatibility Fixes
   =========================== */

/* Astra Theme */
.ast-header-break-point .has-mega-menu > .tj-mega-menu-wrapper > .tj-mega-menu,
.ast-mobile-menu-buttons
	.has-mega-menu
	> .tj-mega-menu-wrapper
	> .tj-mega-menu {
	position: static;
}

/* Astra desktop menu */
.ast-desktop .main-header-menu .has-mega-menu > .tj-mega-menu-wrapper {
	position: absolute;
}

.ast-desktop
	.main-header-menu
	.has-mega-menu
	> .tj-mega-menu-wrapper
	> .tj-mega-menu {
	position: relative;
	display: none !important;
}

.ast-desktop
	.main-header-menu
	.has-mega-menu:hover
	> .tj-mega-menu-wrapper
	> .tj-mega-menu,
.ast-desktop
	.main-header-menu
	.has-mega-menu.mega-menu-open
	> .tj-mega-menu-wrapper
	> .tj-mega-menu {
	display: block !important;
}

/* Astra submenu fixes */
.ast-desktop .main-header-menu .has-mega-menu .tj-mega-menu {
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	border: none;
}

/* Hello Elementor Theme */
.hello-elementor .site-header .has-mega-menu > .tj-mega-menu-wrapper {
	position: absolute;
	top: 100%;
	left: 0;
}

.hello-elementor
	.site-header
	.has-mega-menu
	> .tj-mega-menu-wrapper
	> .tj-mega-menu {
	position: relative;
	left: 0 !important;
}

/* Hello Elementor - Menu container */
.hello-elementor .site-navigation .has-mega-menu {
	position: relative;
}

/* Hello Elementor - Force show mega menu on hover */
.hello-elementor
	.site-navigation
	.has-mega-menu:hover
	> .tj-mega-menu-wrapper
	> .tj-mega-menu,
.hello-elementor
	.site-navigation
	.has-mega-menu.mega-menu-open
	> .tj-mega-menu-wrapper
	> .tj-mega-menu {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Hello Elementor - Remove default submenu styles */
.hello-elementor .site-navigation .has-mega-menu > .tj-mega-menu {
	background: #ffffff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Hello Elementor - Elementor Pro Header */
.elementor-widget-nav-menu .has-mega-menu > .tj-mega-menu-wrapper {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 9999;
}

.elementor-widget-nav-menu
	.has-mega-menu
	> .tj-mega-menu-wrapper
	> .tj-mega-menu {
	position: relative;
	left: 0 !important;
}

/* Elementor Nav Menu Widget - Force visibility */
.elementor-nav-menu
	.has-mega-menu:hover
	> .tj-mega-menu-wrapper
	> .tj-mega-menu,
.elementor-nav-menu
	.has-mega-menu.mega-menu-open
	> .tj-mega-menu-wrapper
	> .tj-mega-menu {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}
important/**
 * TJ Mega Menu - Frontend Styles
 * 
 * Styles for mega menu that work with any Elementor-based theme
 */

/* ===========================
   Mega Menu Container
   =========================== */

.has-mega-menu {
	position: relative;
}

.tj-mega-menu-wrapper {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 9999;
	width: 100%;
	pointer-events: none;
}

.tj-mega-menu {
	display: block;
	position: relative;
	left: 0 !important;
	width: 100%;
	min-width: 600px;
	padding: 0;
	margin: 0;
	list-style: none;
	background: #ffffff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
	border-radius: 0 0 4px 4px;

	/* Hidden by default */
	visibility: hidden;
	opacity: 0;
	transform: translateY(-10px);

	/* Smooth transition */
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;

	/* Enable pointer events for mega menu content */
	pointer-events: auto;
}

.tj-mega-menu-content {
	padding: 30px;
	list-style: none;
	width: 100%;
}

/* Remove default submenu styles for mega menus */
.has-mega-menu > .tj-mega-menu-wrapper > .tj-mega-menu {
	position: relative;
	border: none;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Ensure mega menu content doesn't inherit unwanted styles */
.tj-mega-menu * {
	box-sizing: border-box;
}

/* ===========================
   Mega Menu States - PURE CSS HOVER
   =========================== */

/* Show mega menu on hover - Desktop only */
@media (min-width: 993px) {
	.has-mega-menu:hover > .tj-mega-menu-wrapper {
		pointer-events: auto;
	}

	.has-mega-menu:hover > .tj-mega-menu-wrapper > .tj-mega-menu,
	.has-mega-menu:focus-within > .tj-mega-menu-wrapper > .tj-mega-menu {
		visibility: visible;
		opacity: 1;
		transform: translateY(0);
	}

	/* Keep mega menu open when hovering over it */
	.tj-mega-menu-wrapper:hover > .tj-mega-menu {
		visibility: visible;
		opacity: 1;
		transform: translateY(0);
	}
}

/* Mobile toggle class (for JS toggle on mobile) */
.mega-menu-open > .tj-mega-menu-wrapper > .tj-mega-menu {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

/* ===========================
   Custom Classes Support
   =========================== */

/* Full width mega menu */
.has-mega-menu.full-width > .tj-mega-menu-wrapper > .tj-mega-menu {
	left: 50% !important;
	transform: translateX(-50%);
	width: 100vw;
	max-width: 100vw;
}

/* Centered mega menu */
.has-mega-menu.centered > .tj-mega-menu-wrapper > .tj-mega-menu {
	left: 50% !important;
	transform: translateX(-50%);
}

/* Right aligned mega menu */
.has-mega-menu.align-right > .tj-mega-menu-wrapper > .tj-mega-menu {
	left: auto !important;
	right: 0;
}

/* Dark theme mega menu */
.has-mega-menu.dark-theme > .tj-mega-menu-wrapper > .tj-mega-menu {
	background: #1e1e1e;
	color: #ffffff;
}

/* ===========================
   Elementor Widget Compatibility
   =========================== */

/* Ensure Elementor widgets display correctly in mega menu */
.tj-mega-menu .elementor-widget-wrap {
	display: flex;
	flex-wrap: wrap;
}

.tj-mega-menu .elementor-column {
	width: 100%;
}

.tj-mega-menu .elementor-section {
	width: 100%;
}

/* Remove Elementor editor placeholders in frontend */
.tj-mega-menu .elementor-empty-view {
	display: none;
}

/* ===========================
   Navigation Menu Compatibility
   =========================== */

/* Ensure parent menu item styling */
.has-mega-menu > a {
	position: relative;
}

/* Add dropdown indicator (optional) */
.has-mega-menu > a::after {
	content: "";
	display: inline-block;
	margin-left: 8px;
	vertical-align: middle;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid currentColor;
	transition: transform 0.3s ease;
}

.mega-menu-open > a::after {
	transform: rotate(180deg);
}

/* Remove default submenu indicators if theme adds them */
.has-mega-menu.menu-item-has-children > a .submenu-parent-icon {
	display: none;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 992px) {
	.tj-mega-menu-wrapper {
		position: static;
	}

	.tj-mega-menu {
		display: none;
		position: static;
		width: 100%;
		min-width: auto;
		box-shadow: none;
		border-radius: 0;
		background: #f5f5f5;
	}

	.tj-mega-menu-content {
		padding: 15px;
	}

	.mega-menu-open > .tj-mega-menu-wrapper > .tj-mega-menu {
		display: block;
	}

	/* Full width not needed on mobile */
	.has-mega-menu.full-width > .tj-mega-menu-wrapper > .tj-mega-menu {
		transform: none;
		width: 100%;
		max-width: 100%;
		left: 0 !important;
	}

	/* Stack Elementor columns on mobile */
	.tj-mega-menu .elementor-column {
		width: 100% !important;
		margin-bottom: 15px;
	}
}

@media (max-width: 768px) {
	.tj-mega-menu-content {
		padding: 10px;
	}
}

/* ===========================
   Theme Compatibility Fixes
   =========================== */

/* Astra Theme */
.ast-header-break-point .has-mega-menu > .tj-mega-menu-wrapper > .tj-mega-menu {
	position: static;
}

/* OceanWP Theme */
#site-navigation .has-mega-menu > .tj-mega-menu-wrapper > .tj-mega-menu {
	position: relative;
}

/* GeneratePress Theme */
.main-navigation .has-mega-menu > .tj-mega-menu-wrapper > .tj-mega-menu {
	position: relative;
}

/* Hello Elementor Theme */
.hello-elementor .has-mega-menu > .tj-mega-menu-wrapper > .tj-mega-menu {
	position: relative;
}

/* ===========================
   Accessibility
   =========================== */

/* Focus styles for keyboard navigation */
.has-mega-menu > a:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Show mega menu on focus (keyboard navigation) */
@media (min-width: 993px) {
	.has-mega-menu:focus-within > .tj-mega-menu-wrapper {
		pointer-events: auto;
	}
}

.tj-mega-menu:focus-within {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

/* Screen reader only text */
.tj-mega-menu .screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

/* ===========================
   Animation & Transitions
   =========================== */

.tj-mega-menu {
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.has-mega-menu > a {
	transition: all 0.3s ease;
}

/* ===========================
   Print Styles
   =========================== */

@media print {
	.tj-mega-menu {
		display: none !important;
	}
}

/* ===========================
   RTL Support
   =========================== */

[dir="rtl"] .has-mega-menu > a::after {
	margin-left: 0;
	margin-right: 8px;
}

[dir="rtl"] .has-mega-menu.align-right > .tj-mega-menu-wrapper > .tj-mega-menu {
	right: auto;
	left: 0;
}

/* ===========================
   Custom Width Support
   =========================== */

.tj-mega-menu[style*="max-width"] {
	width: auto !important;
}

/* ===========================
   Z-Index Management
   =========================== */

.has-mega-menu {
	z-index: 1000;
}

.mega-menu-open {
	z-index: 1001;
}

.tj-mega-menu-wrapper {
	z-index: 9999;
}

/* Ensure mega menu appears above other elements */
.site-header,
header,
.elementor-location-header {
	position: relative;
	z-index: 999;
}
