/* Base styles for the mega menu */
/* Global menu item height setting for consistent display across all devices */
:root {
    --menu-item-height: 42px; /* Base height for menu items */
    --menu-items-count: 10; /* Show exactly 10 items */
    --menu-items-total-height: calc(var(--menu-item-height) * var(--menu-items-count)); /* Total height for menu items */
    --menu-item-spacing: 2px; /* Spacing between menu items */
}

.hamburger-mega-menu-wrapper {
    position: relative;
    z-index: 999999;
    will-change: transform;
    --primary-color: #254c98;
    --secondary-color: #657fb0;
    --text-color: #ffffff;
    --hover-opacity: 0.8;
    --transition-speed: 0.3s;
    --mobile-breakpoint: 767px;
}

/* Add this to prevent animation conflicts */
.hamburger-mega-menu-wrapper * {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Single, clean hamburger menu style */
.hamburger-menu {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 999998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 0;
    will-change: transform;
    transition: transform 0.2s ease;
}

.hamburger-menu:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

.hamburger-menu:active {
    transform: translateY(0);
}

/* Hamburger Icon */
.hamburger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    transform: rotate(0deg);
    transition: .5s ease-in-out;
    cursor: pointer;
}

.hamburger-icon .line {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: #254c98;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger-icon .line:nth-child(1) {
    top: 0px;
}

.hamburger-icon .line:nth-child(2) {
    top: 8px;
}

.hamburger-icon .line:nth-child(3) {
    top: 16px;
}

/* Active State */
.hamburger-menu.menu-active .hamburger-icon .line:nth-child(1) {
    top: 8px;
    transform: rotate(45deg);
}

.hamburger-menu.menu-active .hamburger-icon .line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.menu-active .hamburger-icon .line:nth-child(3) {
    top: 8px;
    transform: rotate(-45deg);
}

/* Add transition for menu activation */
.nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 840px;
    height: auto;
    background: var(--primary-color);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    z-index: 999998;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    --menu-item-height: 42px; /* Base height for menu items */
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.nav-menu .menu-items {
    width: 100%;
    margin: 0;
    margin-top: 25px;
    padding: 0 20px;
    overflow-y: auto !important; /* Force scrolling for menu-items */
    overflow-x: hidden;
    flex: 1;
    height: auto !important; /* Changed from fixed height to auto */
    min-height: auto !important; /* Changed from fixed height to auto */
    max-height: none !important; /* Changed from fixed height to none */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS devices */
    scrollbar-width: thin; /* Improve scrollbar appearance */
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent; /* Custom scrollbar colors */
    display: block !important; /* Ensure proper display */
    overscroll-behavior-y: contain; /* Prevent page scrolling when menu is scrolled */
}

.nav-menu .menu-items a {
    text-decoration: none;
    font-family: inherit;
    font-size: 16px;
    line-height: 20px;
    color: var(--text-color);
    transition: var(--transition-speed);
    display: block;
    padding: 10px 15px;
    margin: var(--menu-item-spacing) 0;
    cursor: pointer;
    height: var(--menu-item-height, 42px);
    display: flex;
    align-items: center;
}

.nav-menu .menu-items a:hover {
    opacity: 0.8;
}

.nav-menu .menu-items a.menu-link {
    pointer-events: auto;
}

.nav-menu .menu-items a.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    padding: 12px 15px;
}

.nav-menu .menu-items a.dropdown-trigger i,
.nav-menu .menu-items a.dropdown-trigger svg {
    margin-left: 5px;
}

.dropdown-trigger {
    display: flex !important;
    align-items: center;
    gap: 5px;
    pointer-events: auto;
    padding: 6px 15px !important;
}

.dropdown-trigger i,
.dropdown-trigger svg {
    margin-left: auto;
    margin-right: 2px;
}

/* Add specific style for the chevron icon */
.dropdown-trigger .e-font-icon-svg {
    width: 12px !important;
    height: 12px !important;
    margin-left: 5px;
    margin-top: 2px;
}

/* Sub Menu Panel Styles */
.sub-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 840px;
    height: 100vh;
    background: #254c98;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    z-index: 999998;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    display: flex;
    flex-direction: column;
}

.sub-menu-panel.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.panel-header {
    background-color: #657fb0 !important;
    padding: 15px 20px !important;
    min-height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-direction: row !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Responsive styles */
@media (max-width: 767px) {
    .panel-header {
        padding: 12px 15px !important;
    }
}

@media (max-width: 480px) {
    .panel-header {
        padding: 10px 12px !important;
    }
}

.back-button {
    color: white;
    text-decoration: none;
    font-family: inherit;
    font-size: 18px;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.view-all-btn {
    text-decoration: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 24px;
    color: #fff;
    transition: 0.3s;
    border: 1px solid #fff;
    padding: 2px 15px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Grid Layout */
.two-column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 0;
    min-height: 0;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    /* Stylish Scrollbar for all browsers */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #15d2ef #e3eaff;
}

.two-column-grid::-webkit-scrollbar {
    width: 8px;
    background: #e3eaff;
}

.two-column-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #254c98 40%, #657fb0 100%);
    border-radius: 10px;
    border: 2px solid #e3eaff;
}

.two-column-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #254c98 60%, #657fb0 100%);
}

.two-column-grid::-webkit-scrollbar-corner {
    background: #e3eaff;
}

@media (max-width: 767px) {
    .two-column-grid {
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
        scrollbar-color: #15d2ef #e3eaff !important;
    }
    .two-column-grid::-webkit-scrollbar {
        width: 8px;
        background: #e3eaff;
        display: block !important;
    }
    .two-column-grid::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #254c98 40%, #657fb0 100%);
        border-radius: 10px;
        border: 2px solid #e3eaff;
    }
    .two-column-grid::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #254c98 60%, #657fb0 100%);
    }
    .two-column-grid::-webkit-scrollbar-corner {
        background: #e3eaff;
    }
}

/* --- End of .two-column-grid styles and scrollbar styles --- */

.column a {
    display: block;
    color: white;
    text-decoration: none;
    font-family: inherit;
    font-size: 18px;
    line-height: 35px;
    margin: 0;
    padding: 0px;
    transition: 0.3s;
}

/* Footer Styles */
.menu-footer,
.nav-menu .menu-footer {
    padding: 12px 20px;
    width: 100%;
    box-sizing: border-box;
    background: #254c98;
    position: sticky;
    bottom: 0;
    left: 0;
    z-index: 999;
}

.menu-footer .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.menu-footer .button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.menu-footer .menu-btn {
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 200px;
}

.menu-footer .menu-btn-outline {
    border: 2px solid #fff;
    color: #fff;
    background: transparent;
}

.menu-footer .menu-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-footer .menu-btn-solid {
    background: #fff;
    color: #254c98;
    border: 2px solid #fff;
}

.menu-footer .menu-btn-solid:hover {
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 767px) {
    /* Target both main menu and submenu footers */
    .menu-footer,
    .nav-menu .menu-footer,
    .sub-menu-panel .menu-footer {
        padding: 15px;
        width: 100%;
        margin-top: auto;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: #254c98;
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: var(--footer-button-spacing, 15px);
        box-sizing: border-box;
    }

    .menu-footer::before,
    .nav-menu .menu-footer::before,
    .sub-menu-panel .menu-footer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: rgba(255, 255, 255, 0.8);
    }
    
    /* Target buttons in both menus */
    /* Common button styles for all menus */
    .menu-footer .menu-btn,
    .nav-menu .menu-footer .menu-btn,
    .sub-menu-panel .menu-footer .menu-btn {
        flex: 0 1 auto;
        min-width: 100px;
        padding: 10px 20px;
        font-size: 14px;
        text-align: center;
        white-space: nowrap;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
        cursor: pointer;
        text-decoration: none;
        text-transform: uppercase;
        font-weight: 500;
        letter-spacing: 0.5px;
        margin: 0;
    }

    .menu-footer .menu-btn:hover,
    .nav-menu .menu-footer .menu-btn:hover,
    .sub-menu-panel .menu-footer .menu-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
    }
}

.nav-menu .menu-footer {
    position: sticky;
    bottom: 0;
    z-index: 999999;
    background: #254c98;
}

.divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    margin-bottom: 12px;
    width: 100%;
}

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
}

.menu-btn {
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border: 2px solid white;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
    display: inline-block;
    cursor: pointer;
    font-weight: 500;
    background: transparent;
}

.menu-btn:hover {
    background-color: white;
    color: #254c98;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .nav-menu, .sub-menu-panel {
        width: 90%;
        height: auto !important;
        overflow-y: hidden;
    }

    .panel-header {
        margin: 0px;
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .back-button {
        font-size: 28px;
        line-height: 34px;
    }

    .view-all-btn {
        font-size: 13px;
        padding: 2px 12px;
        margin-left: 34px;
    }

    .panel-content {
        height: auto;
    }
}

/* Small Mobile Devices */
@media (max-width: 767px) {
    .nav-menu, .sub-menu-panel {
        width: 100%;
        height: auto !important; /* Auto height instead of 100vh */
        max-height: 100vh; /* Maximum height */
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0;
        gap: 0; /* Remove gap for tighter spacing */
    }

    /* Container for menu items */
    /* Remove menu-items-container styles since we removed the div */
    /* These styles are no longer needed */

    .nav-menu .menu-items,
    .sub-menu-panel .menu-items {
        height: auto !important; /* Changed from fixed height to auto */
        min-height: auto !important; /* Changed from fixed height to auto */
        max-height: none !important; /* Changed from fixed height to none */
        overflow-y: auto !important; /* Always enable vertical scrolling */
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        scroll-behavior: smooth;
        padding: 0 15px;
        margin: 0;
        margin-top: 25px;
        margin-bottom: 0;
    }

    .panel-header {
        margin: 0px;
        margin-bottom: 20px;
    }

    .column a {
        padding: 6px 0;
        font-size: 16px;
        line-height: 32px;
    }

    .menu-footer {
        padding: 10px 12px;
        margin-top: 0 !important; /* Ensure no extra margin is added */
        position: sticky;
        bottom: 0;
        background: var(--primary-color);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Make both main menu and submenu footers consistent */
    .nav-menu .menu-footer,
    .sub-menu-panel .menu-footer {
        position: relative;
        bottom: auto;
        margin-top: 0 !important;
        background: #254c98;
    }
    
    /* Fix for active nav-menu footer positioning */
    .nav-menu.active {
        height: auto !important;
        max-height: 700px !important; /* Limit height for active menu */
    }
    
    .nav-menu.active .menu-items {
        height: auto !important; /* Changed from fixed height to auto */
        min-height: auto !important; /* Changed from fixed height to auto */
        max-height: none !important; /* Changed from fixed height to none */
        scrollbar-width: thin !important; /* Improved scrollbar */
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent !important; /* Custom scrollbar colors */
    }
    
    /* Force footer to stay close to menu items */
    .nav-menu.active .menu-footer {
        position: sticky;
        bottom: 0;
        margin-top: 0 !important;
    }

    .menu-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Tablet Specific Styles (767px to 993px) */
@media (min-width: 768px) and (max-width: 992px) {
    .nav-menu, .sub-menu-panel {
        width: 100%;
        height: auto !important;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0;
        gap: 0;
    }
    
    .nav-menu .menu-items,
    .sub-menu-panel .menu-items {
        height: auto !important; /* Changed from fixed height to auto */
        min-height: auto !important; /* Changed from fixed height to auto */
        max-height: none !important; /* Changed from fixed height to none */
        overflow-y: auto !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS devices */
        padding: 0 15px;
        margin: 0;
        margin-bottom: 5px !important; /* Exact 5px gap */
        scrollbar-width: thin !important; /* Improved scrollbar */
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent !important; /* Custom scrollbar colors */
    }
    
    .nav-menu .menu-footer,
    .sub-menu-panel .menu-footer {
        position: relative;
        bottom: auto;
        margin-top: 0 !important;
        background: #254c98;
        padding: 10px 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu.active {
        height: auto !important;
        max-height: 500px !important;
    }
    
    .nav-menu.active .menu-items {
        height: auto !important; /* Changed from fixed height to auto */
        min-height: auto !important; /* Changed from fixed height to auto */
        max-height: none !important; /* Changed from fixed height to none */
    }
    
    .nav-menu.active .menu-footer {
        position: sticky;
        margin-top: 0 !important;
    }
    
    .menu-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Menu Position Styles */
.menu-position-left .nav-menu {
    left: 0;
    right: auto;
    transform: translateX(-100%);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-position-right .nav-menu {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

.menu-position-left .nav-menu.active {
    transform: translateX(0);
}

.menu-position-right .nav-menu.active {
    transform: translateX(0);
}

/* Sub Menu Panel Position */
.menu-position-left .sub-menu-panel {
    left: 0;
    right: auto;
    transform: translateX(-100%);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-position-right .sub-menu-panel {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

.menu-position-left .sub-menu-panel.active,
.menu-position-right .sub-menu-panel.active {
    transform: translateX(0);
}

/* Animation Types */
.menu-animation-fade .nav-menu,
.menu-animation-fade .sub-menu-panel {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-animation-fade .nav-menu.active,
.menu-animation-fade .sub-menu-panel.active {
    opacity: 1;
    visibility: visible;
}

.menu-animation-zoom .nav-menu,
.menu-animation-zoom .sub-menu-panel {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.menu-animation-zoom .nav-menu.active,
.menu-animation-zoom .sub-menu-panel.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Custom Breakpoint Styles */
@media (max-width: var(--tablet-breakpoint)) {
    .nav-menu, .sub-menu-panel {
        width: 90%;
        height: var(--tablet-menu-height, 100vh) !important;
    }
}

@media (max-width: var(--mobile-breakpoint)) {
    .nav-menu, .sub-menu-panel {
        width: var(--mobile-menu-width, 100%);
        height: var(--mobile-menu-height, 100vh) !important;
    }
}

/* Hamburger Menu Styles */
.elementor-widget-hamburger-mega-menu {
    position: relative;
    isolation: isolate;
    contain: layout style paint;
}

/* Menu spacing when open */
.nav-menu.active,
.sub-menu-panel.active {
    margin-top: var(--menu-open-spacing, 20px);
}

/* Fix for Elementor editor */
.elementor-editor-active .hamburger-menu {
    position: absolute;
}

/* Responsive Footer Styles */
@media (min-width: 993px) {
    /* Footer Styles */
    .menu-footer,
    .sub-menu-panel .menu-footer {
        padding: 10px 20px;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: var(--primary-color);
        z-index: 2;
        border-top: 2px solid rgba(255, 255, 255, 0.45);
        margin-top: 20px; /* 5px gap between menu items and footer */
        box-sizing: border-box;
    }

    .menu-footer .menu-btn,
    .sub-menu-panel .menu-footer .menu-btn {
        flex: 0 1 auto;
        min-width: 100px;
        padding: 10px 20px;
        font-size: 14px;
        text-align: center;
        white-space: nowrap;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
        cursor: pointer;
        text-decoration: none;
        text-transform: uppercase;
        font-weight: 500;
        letter-spacing: 0.5px;
    }

    .menu-footer .menu-btn:hover,
    .sub-menu-panel .menu-footer .menu-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }

    .menu-footer .menu-btn:active,
    .sub-menu-panel .menu-footer .menu-btn:active {
        transform: translateY(0);
        background: rgba(255, 255, 255, 0.15);
    }
}

@media (max-width: 992px) {
    .menu-footer {
        padding: 15px;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    .menu-btn {
        width: 100%;
        padding: 10px 20px;
    }
}

/* Icon states */
.svg-inline--fa.fa-w-10,
.svg-inline--fa.fa-w-14 {
    width: .625em;
    margin-top: 4px;
}

.svg-inline--fa.fa-w-14 {
    width: .625em;
}

.menu-icon i,
.menu-icon svg {
    transition: all 0.3s ease;
    margin-top: 4.5px;
}

.dropdown-trigger i,
.dropdown-trigger svg {
    margin-left: auto;
}

/* Hide hamburger when menu is open (if enabled) */
.hide-icon-on-open .nav-menu.active ~ .hamburger-menu {
    display: none !important;
}

/* Icon states */
.menu-icon-close,
.menu-icon-open {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon-close {
    display: none;
}

.menu-icon-open {
    display: block;
}

/* When menu is active */
.hamburger-menu.menu-active .menu-icon-open {
    display: none;
}

.hamburger-menu.menu-active .menu-icon-close {
    display: block;
}

/* Icon styles */
.menu-icon i {
    font-size: 24px;
    color: #254c98;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon-close i {
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Remove any margin/padding from SVG icons */
.menu-icon svg,
.svg-inline--fa {
    margin: 0;
    padding: 0;
}

/* Left Position */
.menu-position-left .nav-menu {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

.menu-position-left .nav-menu.active {
    transform: translateX(0);
}

/* Right Position */
.menu-position-right .nav-menu {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

.menu-position-right .nav-menu.active {
    transform: translateX(0);
}

/* Popup Position */
.menu-position-popup .nav-menu {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-position-popup .nav-menu.active {
    transform: translate(-50%, -50%) scale(1);
}

/* Sub Menu Panel Positions */
.menu-position-right .sub-menu-panel {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

.menu-position-left .sub-menu-panel {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

.menu-position-popup .sub-menu-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Active States for Sub Menu */
.menu-position-right .sub-menu-panel.active,
.menu-position-left .sub-menu-panel.active {
    transform: translateX(0);
}

.menu-position-popup .sub-menu-panel.active {
    transform: translate(-50%, -50%) scale(1);
}

/* Update panel content styles */
.panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px 30px 0 30px;
    position: relative;
}

/* Update sub-menu-panel styles */
.sub-menu-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
}

/* Update menu footer styles in panel */
.sub-menu-panel .menu-footer {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    position: sticky;
    bottom: 0;
    left: 0;
    background: #254c98;
    z-index: 999;
}

/* Ensure the two-column-grid doesn't push footer out */
.two-column-grid {
    overflow-y: auto;
    margin-bottom: 20px;
    max-height: calc(var(--menu-height, 100vh) - 200px); /* Adjust height accounting for footer */
}

@media (min-width: 993px) {
    .sub-menu-panel .button-group {
        display: flex;
        flex-direction: row;
        gap: 15px;
        max-width: 100%;
    }

    .sub-menu-panel .menu-btn {
        flex: 1;
        min-width: 150px;
    }
}

/* Desktop and larger screens */
@media (min-width: 1241px) {
    .panel-content {
        padding: 30px 40px 0 40px;
        max-height: calc(100vh - 180px);
    }

    .two-column-grid {
        max-height: 455px;
        padding-right: 15px;
        gap: 20px;
    }

    .menu-footer,
    .sub-menu-panel .menu-footer {
        padding: 20px 40px;
        position: sticky;
        bottom: 0;
        width: 100%;
        z-index: 999999;
        background: #254c98;
    }

    .button-group,
    .sub-menu-panel .button-group {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 20px;
        max-width: 100%;
    }

    .menu-btn,
    .sub-menu-panel .menu-btn {
        flex: 1;
        min-width: 200px;
        max-width: calc(50% - 10px);
        padding: 15px 30px;
        font-size: 16px;
    }
}

/* Combine medium screen styles */
@media (min-width: 993px) and (max-width: 1240px) {
    .panel-content {
        padding: 25px 30px 0 30px;
        max-height: calc(100vh - 170px);
    }

    .two-column-grid {
        max-height: calc(100vh - 260px);
        gap: 20px;
    }

    .menu-footer,
    .sub-menu-panel .menu-footer {
        padding: 15px 20px;
        position: sticky;
        bottom: 0;
        width: 100%;
        z-index: 999999;
        background: #254c98;
    }

    .button-group,
    .sub-menu-panel .button-group {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 15px;
        max-width: 100%;
    }

    .menu-btn,
    .sub-menu-panel .menu-btn {
        flex: 1;
        min-width: 150px;
        max-width: calc(50% - 7.5px);
    }
    .column a {
        padding: 6px 0;
        font-size: 16px;
        line-height: 32px;
        height: 28px;
        display: flex;
        align-items: center;
    }
}

/* Combine mobile styles */
@media (max-width: 992px) {
    .nav-menu, 
    .sub-menu-panel {
        width: 90%;
        /* height: 100vh !important; */
        display: flex;
        flex-direction: column;
    }

    .panel-content {
        padding: 15px 20px 50px 20px;
        height: auto;
        position: relative;
        overflow-y: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0; /* Allow content to shrink if needed */
        justify-content: space-between; /* Push footer to bottom */
    }
    
    .nav-menu .menu-list {
        margin-bottom: 0;
        margin-top: 0;
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .two-column-grid {
        grid-template-columns: 1fr;
        gap: 0;
        max-height: none;
        padding-right: 10px;
        overflow-y: auto;
        margin-bottom: 25px;
        flex: 1;
    }

    .column a {
        padding: 6px 0;
        font-size: 16px;
        line-height: 32px;
        height: 28px;
    }

    .menu-footer,
    .sub-menu-panel .menu-footer,
    .nav-menu .menu-footer {
        padding: 15px;
        z-index: 999999;
        background: #254c98;
        position: relative;
        bottom: 0;
        left: 0;
        width: 100%;
        box-sizing: border-box;
        margin-top: auto;
        height: 75px;
    }
    
    .button-group {
        display: flex;
        flex-direction: row;
        gap: 15px;
        justify-content: center;
    }

    .menu-btn,
    .sub-menu-panel .menu-btn {
        width: auto;
        padding: 10px 20px;
        font-size: 14px;
        min-width: 140px;
        text-align: center;
        text-transform: uppercase;
        font-weight: 600;
        border: 1px solid #ffffff;
        transition: all 0.3s ease;
    }
    
    .menu-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .sub-menu-panel {
        padding: 0 15px;
        height: var(--mobile-menu-height) !important;
    }

    .two-column-grid {
        max-height: 350px;
        padding-right: 8px;
        overflow-y: auto;
        max-height: 200px;
        margin-bottom: 25px !important;    /* Mobile footer spacing */
    }

    .menu-footer,
    .sub-menu-panel .menu-footer {
        padding: 10px 15px;
        margin: 0;
        position: sticky;
        bottom: 0;
        background: var(--primary-color);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sub-menu-panel .menu-footer {
        padding: 10px 15px;
        padding: 12px 15px;
        width: 100%;
        position: sticky;
        bottom: 0;
        background: #254c98;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sub-menu-panel .menu-footer .button-group {
        display: flex;
        flex-direction: row !important;
        justify-content: center;
        gap: 15px;
        width: 100%;
        margin: 0 auto;
    }

    .menu-btn,
    .sub-menu-panel .menu-btn {
        flex: 1;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 13px;
        text-align: center;
        white-space: nowrap;
        max-width: none;
    }
    
    .column a {
        padding: 4px 0;
        font-size: 15px;
        line-height: 30px;
        height: 28px;
    }
}

/* Media queries adjustments */
@media (min-width: 1241px) {
    .two-column-grid {
        max-height: 455px;
        padding-right: 15px;
    }
}

@media (max-width: 992px) {
    .two-column-grid {
        grid-template-columns: 1fr;
        max-height: 455px;
        padding-right: 10px;
    }
}

@media (max-width: 480px) {
    .two-column-grid {
        max-height: 420px;
    }

    .column a {
        padding: 6px 0;
        font-size: 20px;
        line-height: 32px;
    }
}

/* Override Elementor's responsive hiding */
@media (min-width: 768px) and (max-width: 1024px) {
    .hamburger-mega-menu-wrapper:not(.elementor-hidden-tablet) {
        display: block !important;
    }
}

@media (max-width: 767px) {
    .hamburger-mega-menu-wrapper:not(.elementor-hidden-mobile) {
        display: block !important;
    }
}

@media (min-width: 1025px) {
    .hamburger-mega-menu-wrapper:not(.elementor-hidden-desktop) {
        display: block !important;
    }
}

/* Ensure sub-menu panels stay visible when active */
.sub-menu-panel.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Ensure panels are above Elementor elements */
@media (max-width: 767px) {
    .menu-item-has-children .sub-menu {
        display: none;
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: none !important;
        width: 100% !important;
        background: var(--primary-color) !important;
        padding-left: 15px !important;
        max-height: calc((var(--menu-item-height, 42px) * 10) + 20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .menu-item-has-children.submenu-active > .sub-menu {
        display: block;
    }

    .menu-item-has-children > a {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--menu-item-height, 42px);
    }

    .menu-item-has-children.submenu-active > a {
        color: var(--text-color);
        font-weight: bold;
        background: rgba(255, 255, 255, 0.1);
    }
}

.active-menu .nav-menu-close {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .nav-menu {
        overflow-y: hidden;
        height: var(--mobile-menu-height) !important; /* Important to override other styles */
        background: #254c98;
        padding: 0;
        display: flex;
        flex-direction: column;
        min-height: unset !important; /* Ensure no min-height overrides our setting */
        max-height: unset !important; /* Ensure no max-height overrides our setting */
    }
    
    .nav-menu .menu-list {
        height: auto;
        max-height: calc(var(--mobile-menu-height) - 80px) !important; /* Add !important to override any other styles */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 30px;
        margin: 0;
        flex: 1;
    }
    
    .nav-menu ul li {
        padding: 2px 0;
    }
    
    .nav-menu ul li a {
        font-size: 15px;
        line-height: 18px;
        padding: 6px 0;
    }
    
    .dropdown-trigger {
        padding: 4px 0 !important;
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .dropdown-trigger .e-font-icon-svg {
        width: 10px !important;
        height: 10px !important;
    }
    
    .nav-menu .menu-list {
        max-height: calc(var(--mobile-menu-height, 100vh) - 120px);
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0;
        margin-bottom: 0;
        flex: 1;
    }
    
    body.menu-open .nav-menu {
        overflow-y: auto;
        height: auto;
    }
    
    .menu-footer,
    .sub-menu-panel .menu-footer,
    .nav-menu .menu-footer {
        padding: 15px 20px;
        margin-top: 0;
    }
}

.hamburger-menu .menu-icon svg,
.back-button svg,
.dropdown-trigger svg {
    display: inline-block;
    vertical-align: middle;
}

.menu-icon-close {
    display: none;
}

.hamburger-menu.active .menu-icon-open {
    display: none;
}

.hamburger-menu.active .menu-icon-close {
    display: inline-block;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-button svg {
    margin-right: 5px;
}

.hamburger-label {
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
    margin-top: 5px;
}

.nav-menu .menu-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
    overflow-y: auto; /* Keep this for scrolling */
    counter-reset: menu-counter;
    height: auto;
    position: relative;
    flex: 1;
    max-height: calc(100vh - 100px); /* Ensure proper height for scrolling */
}

.nav-menu .menu-list li {
    margin: 0;
    padding: 0;
    position: relative;
    counter-increment: menu-counter;
    height: 40px;
}

/* Remove list markers and numbers */
.nav-menu .menu-list li::marker,
.nav-menu .menu-list li::-webkit-details-marker {
    display: none;
    content: none;
}

.nav-menu .menu-list li::before {
    display: none;
}

.nav-menu .menu-list li::after {
    display: none;
}

/* Ensure links are clickable */
.nav-menu .menu-list li a,
.nav-menu .menu-list li a.menu-link,
.nav-menu .menu-list li a.dropdown-trigger {
    text-decoration: none;
    color: #fff;
    transition: 0.3s;
    display: flex;
    align-items: center;
    padding: 0;
    height: 40px;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
    width: 100%;
    font-weight: 500;
}

/* Ensure typography inheritance */
.nav-menu .menu-list li a,
.nav-menu .menu-list li a.menu-link,
.nav-menu .menu-list li a.dropdown-trigger {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.nav-menu .menu-list li a.menu-link {
    pointer-events: auto !important;
    cursor: pointer !important;
    width: 100%;
    display: block;
    position: relative;
    z-index: 3;
}

.nav-menu .menu-list li a:hover {
    opacity: 0.8;
}

/* Remove any interference */
.nav-menu .menu-list li::before,
.nav-menu .menu-list li::after,
.nav-menu .menu-list li a::before,
.nav-menu .menu-list li a::after {
    display: none;
}

/* Ensure dropdown triggers are properly styled */
.nav-menu .menu-list li a.dropdown-trigger {
    display: flex !important;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    padding: 10px 15px;
}

.nav-menu .menu-list li a.dropdown-trigger svg,
.nav-menu .menu-list li a.dropdown-trigger i {
    margin: 0 !important;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* For RTL support */
.rtl .nav-menu .menu-list li a.dropdown-trigger {
    flex-direction: row-reverse;
}

/* Remove any pointer-events interference */
.nav-menu .menu-list li {
    pointer-events: auto !important;
}

.nav-menu .menu-list,
.hamburger-mega-menu-wrapper .menu-list,
ol.menu-list {
    pointer-events: auto !important;
    overflow: hidden !important; /* Remove scrolling from menu-list */
    max-height: none !important; /* Prevent scrolling */
    height: auto !important; /* Auto height to prevent scrolling */
}

.nav-menu {
    pointer-events: auto !important;
}

/* Menu item with arrow icon alignment */
.hamburger-mega-menu-wrapper .menu-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    position: relative;
}

/* Improve menu-items scrolling appearance */
.nav-menu .menu-items::-webkit-scrollbar,
.sub-menu-panel .menu-items::-webkit-scrollbar {
    width: 5px;
}

.nav-menu .menu-items::-webkit-scrollbar-track,
.sub-menu-panel .menu-items::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu .menu-items::-webkit-scrollbar-thumb,
.sub-menu-panel .menu-items::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 2px solid transparent;
}

/* Additional rules to ensure menu-list never scrolls */
.nav-menu .menu-list::-webkit-scrollbar,
.hamburger-mega-menu-wrapper .menu-list::-webkit-scrollbar,
ol.menu-list::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Force menu-items to be the only scrollable element */
.nav-menu .menu-items {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

.hamburger-mega-menu-wrapper .menu-list li a i.fa-chevron-right {
    margin-left: 10px;
    font-size: 14px;
    line-height: inherit;
    display: flex;
    align-items: center;
}

/* For RTL support */
.rtl .hamburger-mega-menu-wrapper .menu-list li a i.fa-chevron-right {
    margin-left: 0;
    margin-right: 10px;
    transform: rotate(180deg);
}

/* Combined typography styles for both main menu and submenu items */
/* Ensure menu-list doesn't scroll on any device */
.hamburger-mega-menu-wrapper .menu-list,
.nav-menu .menu-list,
ol.menu-list {
    overflow: hidden !important;
    max-height: none !important;
    height: auto !important;
    display: block !important;
}

.hamburger-mega-menu-wrapper .menu-list li a,
.hamburger-mega-menu-wrapper .sub-menu-panel .column a {
    font-family: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: #fff;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 15px;
    position: relative;
    text-decoration: none;
}

/* Main menu font size */
.hamburger-mega-menu-wrapper .menu-list li a {
    font-size: inherit; /* This will use the main menu font size */
}

/* Submenu font size - can be controlled separately */
.hamburger-mega-menu-wrapper .sub-menu-panel .column a {
    font-size: var(--submenu-font-size, inherit); /* This allows separate control */
}

/* Hover effect for both main and sub menu items */
.hamburger-mega-menu-wrapper .menu-list li a:hover,
.hamburger-mega-menu-wrapper .sub-menu-panel .column a:hover {
    font-weight: 600;
    color: #ffffff;
}

/* Arrow icon alignment for both menu types */
.hamburger-mega-menu-wrapper .menu-list li a i.fa-chevron-right,
.hamburger-mega-menu-wrapper .sub-menu-panel .column a i.fa-chevron-right {
    margin-left: 10px;
    font-size: 14px;
    line-height: inherit;
    display: flex;
    align-items: center;
}

/* RTL support for both menu types */
.rtl .hamburger-mega-menu-wrapper .menu-list li a i.fa-chevron-right,
.rtl .hamburger-mega-menu-wrapper .sub-menu-panel .column a i.fa-chevron-right {
    margin-left: 0;
    margin-right: 10px;
    transform: rotate(180deg);
}

/* Responsive styles for both menu types */
@media (max-width: 767px) {
    /* Ensure menu-list doesn't scroll on mobile */
    .hamburger-mega-menu-wrapper .menu-list,
    .nav-menu .menu-list,
    ol.menu-list {
        overflow: hidden !important;
        max-height: none !important;
        height: auto !important;
        display: block !important;
    }
    
    .hamburger-mega-menu-wrapper .menu-list li a,
    .hamburger-mega-menu-wrapper .sub-menu-panel .column a {
        font-size: 15px;
        line-height: 18px;
        padding: 6px 0;
    }
}

/* Submenu Arrow Icon positioning */
.hamburger-mega-menu-wrapper .dropdown-trigger {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding-right: 0 !important;
}

.hamburger-mega-menu-wrapper .dropdown-trigger svg,
.hamburger-mega-menu-wrapper .dropdown-trigger i {
    margin-left: 10px !important;
    margin-right: 0 !important;
    width: 12px;
    height: 12px;
}

/* For RTL support */
.rtl .hamburger-mega-menu-wrapper .dropdown-trigger svg,
.rtl .hamburger-mega-menu-wrapper .dropdown-trigger i {
    margin-left: 0 !important;
    margin-right: 10px !important;
}

/* Fixed pixel-based spacing for menu items regardless of font size */
.nav-menu .menu-list li:not(:last-child) {
    margin-bottom: 0px !important;
}

.nav-menu .menu-list li {
    padding: 0 !important;
}

.nav-menu .menu-list li a,
.nav-menu .menu-list li a.menu-link,
.nav-menu .menu-list li a.dropdown-trigger {
    padding: 5px 15px !important; /* Reduced padding from 10px to 5px */
    height: auto !important; /* Override any height settings */
    min-height: 34px !important; /* Reduced minimum height from 44px to 34px */
    display: flex !important;
    align-items: center !important;
}

/* Fixed pixel-based spacing for submenu items */
.menu-item-has-children .sub-menu li a {
    padding: 8px 15px !important; /* Slightly smaller padding for submenu items */
    min-height: 36px !important; /* Smaller minimum height for submenu items */
    margin: 2px 0 !important; /* Fixed margin in pixels */
}

/* Override any font-size based spacing */
.nav-menu .menu-list,
.nav-menu .menu-list li,
.nav-menu .menu-list li a,
.menu-item-has-children .sub-menu,
.menu-item-has-children .sub-menu li,
.menu-item-has-children .sub-menu li a {
    line-height: normal !important; /* Override line-height */
}
@media (min-width: 1200px) and (max-width: 1439px) {
    .view-all-btn{
        margin-right: 200px !important;
    }
  }

  @media (min-width: 1440px) {
    .view-all-btn{
        margin-right: 200px !important;
    }
  }