/**
 * Custom Elementor Menu - Comprehensive Styles
 * Includes desktop, responsive, and all widget features
 */

/* ========================================
   WRAPPER & BASE STRUCTURE
   ======================================== */
.custom-elementor-menu-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    width: 100%;
}

/* ========================================
   MAIN MENU - HORIZONTAL LAYOUT (DEFAULT)
   ======================================== */
.custom-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.custom-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}

.custom-menu > li > a {
    display: flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration:none !important;
}

/* ========================================
   VERTICAL LAYOUT
   ======================================== */
.custom-menu-layout-vertical .custom-menu {
    flex-direction: column;
    align-items: stretch;
}

.custom-menu-layout-vertical .custom-menu > li {
    width: 100%;
}

.custom-menu-layout-vertical .custom-menu > li > a {
    width: 100%;
}

/* ========================================
   DROPDOWN INDICATOR
   ======================================== */
.dropdown-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    margin-left: 5px;
    line-height: 1;
}

.dropdown-indicator i {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    color: inherit;
}

/* CSS Fallback arrow if icon font doesn't load */
.dropdown-indicator:empty::before {
    content: '▼';
    font-family: Arial, sans-serif;
    font-style: normal;
    font-size: 12px;
    line-height: 1;
}

/* .menu-item-has-children:hover > a .dropdown-indicator,
.menu-item-has-children.active > a .dropdown-indicator {
    transform: rotate(180deg);
} */

/* Submenu dropdown indicators - positioned on right */
.custom-menu .sub-menu .menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.custom-menu .sub-menu{
    max-height: 0;  
    transition: max-height 0.3s ease;
}
/* Desktop hover expands submenu fully */
@media(min-width: 769px) {
    .menu-item-has-children.hover > .sub-menu {
        max-height: none;       /* full height */
        overflow: visible;      /* allow content to show */
        display: block;         /* make sure it shows */
        transition: max-height 0.3s ease;
    }
}

.custom-menu .sub-menu .dropdown-indicator {
    margin-left: auto;
    transform: rotate(-90deg); /* Point right instead of down */
}

.custom-menu .sub-menu .menu-item-has-children:hover > a .dropdown-indicator {
    transform: rotate(90deg); /* Rotate when hovering */
}

/* CSS Fallback arrow for submenus */
.custom-menu .sub-menu .dropdown-indicator:empty::before {
    content: '▶';
}

/* ========================================
   SUBMENU / DROPDOWN STYLING
   ======================================== */
.custom-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden !important;
}

/* Show submenu on hover - Desktop */
.custom-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Submenu items */
.custom-menu .sub-menu li {
    position: relative;
    margin: 0;
    width: 100%;
}

.custom-menu .sub-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

/* ========================================
   MULTI-LEVEL DROPDOWNS (3rd level and beyond)
   ======================================== */
.custom-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 0;
}

/* Flyout position - Right */
.dropdown-position-right .custom-menu .sub-menu .sub-menu {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Hover state for nested submenus */
.custom-menu .sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ========================================
   HAMBURGER ICON (Mobile Toggle)
   ======================================== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10000;
    transition: all 0.3s ease;
    position: relative;
}

/* Responsive breakpoint: Show hamburger and hide menu on mobile */
@media (max-width: 1024px) {
    .hamburger {
        display: flex !important;
    }
    
    .custom-menu:not(.mobile-active) {
        display: none !important;
    }
}

/* Dynamic breakpoint using CSS variable (when set) */
/* @supports (width: max(0px)) {
    @media (max-width: var(--menu-breakpoint, 768px)) {
        .hamburger {
            display: flex !important;
        }
        
        .custom-menu:not(.mobile-active) {
            display: none !important;
        }
    }
} */

/* Show hamburger in Elementor editor for preview */
.elementor-editor-active .hamburger {
    display: flex !important;
    opacity: 0.5;
}

.elementor-editor-active .hamburger::before {
    content: 'Preview Mode';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    color: #888;
}

.hamburger span {
    display: block;
    background-color: currentColor;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Custom hamburger image/SVG */
.hamburger img {
    display: block;
    max-width: 100%;
    height: auto;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show hamburger icon by default, hide close icon */
.hamburger .hamburger-icon {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.hamburger .close-icon {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
}

/* When active, hide hamburger icon and show close icon */
.hamburger.active .hamburger-icon {
    opacity: 0;
    visibility: hidden;
}

.hamburger.active .close-icon {
    opacity: 1;
    visibility: visible;
}

/* Hamburger animation when active (for default bars) */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ========================================
   ACTIVE MENU ITEM HIGHLIGHTING
   ======================================== */
.custom-menu li.current-menu-item > a,
.custom-menu li.current-menu-ancestor > a,
.custom-menu li.current-menu-parent > a,
.custom-menu li.active-menu-item > a {
    /* Styles applied via Elementor controls */
}

/* ========================================
   STICKY MENU BEHAVIOR
   ======================================== */
.menu-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transition: all 0.3s ease;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Mobile Menu - Hidden by default */
.custom-menu.mobile-hidden {
    display: none !important;
}

/* Mobile Menu - Active state */
.custom-menu.mobile-active {
    display: flex !important;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

/* Mobile Menu - Full Width Breakout Positioning (Only on Mobile) */
@media (max-width: 1024px) {
    .custom-elementor-menu-wrapper {
        position: relative;  /* Creates positioning context for absolute menu */
    }
    
    /* .custom-menu.mobile-active {
        position: absolute; 
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        z-index: 9998;
    } */
}

/* Mobile menu items */
.custom-menu.mobile-active > li {
    width: 100%;
}

.custom-menu.mobile-active > li > a {
    width: 100%;
    justify-content: space-between;
}

/* Mobile submenu styling */
.custom-menu.mobile-active .sub-menu {
    position: relative;
    /* top: 0; */
    left: 0;
    transform: none;
    width: 100%;
    overflow: hidden;
    max-height: none;  /* Start collapsed */
    opacity: 1;

    visibility: visible;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

/* Show mobile submenu when parent is active */
.custom-menu.mobile-active li.mobile-submenu-active > .sub-menu {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
}

/* Mobile submenu items - add indentation */
.custom-menu.mobile-active .sub-menu li a {
    padding-left: 30px;
}

.custom-menu.mobile-active .sub-menu .sub-menu li a {
    padding-left: 50px;
}

.custom-menu.mobile-active .sub-menu .sub-menu .sub-menu li a {
    padding-left: 70px;
}

/* Mobile dropdown indicator rotation */
.custom-menu.mobile-active li.mobile-submenu-active > a .dropdown-indicator {
    transform: rotate(180deg);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus states for keyboard navigation */
.custom-menu a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.custom-menu a:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   ANIMATION & TRANSITIONS
   ======================================== */

/* Smooth dropdown animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile menu slide in */
@keyframes mobileMenuSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-menu.mobile-active {
    animation: mobileMenuSlide 0.3s ease;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .hamburger {
        display: none !important;
    }
    
    .custom-menu {
        display: flex !important;
    }
    
    .custom-menu .sub-menu {
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* ========================================
   RTL SUPPORT
   ======================================== */
[dir="rtl"] .custom-menu .sub-menu {
    left: auto;
    right: 0;
}

[dir="rtl"] .custom-menu .sub-menu .sub-menu {
    left: auto;
    right: 100%;
}

[dir="rtl"] .dropdown-indicator {
    margin-left: 0;
    margin-right: 5px;
}

[dir="rtl"] .custom-menu.mobile-active .sub-menu li a {
    padding-left: 20px !important;
    padding-right: 30px !important;
}

/* ========================================
   BROWSER COMPATIBILITY FIXES
   ======================================== */

/* IE11 Flexbox fixes */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .custom-menu {
        display: -ms-flexbox;
    }
    
    .custom-menu > li {
        -ms-flex: 0 0 auto;
    }
}

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
    .custom-menu .sub-menu {
        -webkit-transform: translateY(-10px);
    }
    
    .custom-menu > li:hover > .sub-menu {
        -webkit-transform: translateY(0);
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Hide on specific devices
.hide-desktop {
    display: none !important;
}

.hide-mobile {
    display: flex !important;
}

/* Clearfix 
.custom-elementor-menu-wrapper::after {
    content: "";
    display: table;
    clear: both;
}
 */


.menu-item.touch-opened > .sub-menu {
    display: block;
}

@media (max-width:1024px) {
   .elementor-85 .elementor-element.elementor-element-b0a9927 .custom-menu .sub-menu{
    display: none;
} 
}
.mobile-menu-wrapper {
    position: relative;  /* keeps absolute dropdown positioned correctly */
    width: 100vw;        /* full viewport width */
    max-width: 100vw;
    left: 0;             /* ensure it starts at the left edge */
    margin: 0;           /* remove any offsets */
    padding: 0;
}
.custom-menu.mobile-active { 
    position: fixed !important;
    left: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    z-index: 9998;
}

.mobile-menu-wrapper{
    width: 100vw;
    max-width: 100vw;
}
/* disable page scroll when menu is opened */
body.menu-open {
    overflow-y: hidden;
    touch-action: none; /* optional: disables touch scrolling on mobile */
}