/* === Custom ACF Menu Styles - Layout Only === */

/* --- General Header Structure --- */
.whiteBG {
    background-color: #fff;
}
.absoluteNavbar,
.fixedNavbar {
    width: 100%;
    transition: all 0.3s ease-in-out;
}

.absoluteNavbar {
    position: absolute;
    top: 0;
    left: 0;
    height: 120px; /* Initial navbar height */
    z-index: 1005;
}

.fixedNavbar {
    position: fixed;
    top: -100px; /* Initially hidden */
    left: 0;
    height: 80px; /* Scrolled navbar height */
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform: translateY(0);
    z-index: 1006;
}

body.nav-fix .fixedNavbar {
    transform: translateY(0);
    top: 0;
}
/* body.nav-fix .absoluteNavbar { opacity: 0; visibility: hidden; } */

.navbarLockup {
    min-width: 1170px;
    margin: 0 auto;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: fit-content;
}

.logoImg {
    flex-shrink: 0;
}

#menuWrapAbsolute,
#menuWrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-grow: 1;
    height: 100%;
}

/* --- Desktop Custom Main Menu (ACF) --- */
.custom-main-menu-nav-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
}

.custom-main-menu.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.custom-main-menu > .main-menu-item {
    margin-left: 20px;
    height: 100%
}

.fixedNavbar .custom-main-menu > .main-menu-item {
    margin-left: 15px;
}

.custom-main-menu > .main-menu-item > .nav-link {
    position: relative;
    display: block;
    padding: 15px 10px;
    text-decoration: none;
    white-space: nowrap;
    align-self: center;
    cursor: pointer; /* For span toggles */
}

.fixedNavbar .custom-main-menu > .main-menu-item > .nav-link {
    padding: 10px 8px;
}

.custom-main-menu > .main-menu-item.has-megamenu > .nav-link .dropdown-indicator-svg {
    transition: transform 0.2s ease-in-out;
    width: 10px;
    height: auto;
    margin-left: 5px;
    vertical-align: middle;
}
.custom-main-menu > .main-menu-item.has-megamenu:hover > .nav-link .dropdown-indicator-svg,
.custom-main-menu > .main-menu-item.has-megamenu.menu-open > .nav-link .dropdown-indicator-svg {
    transform: rotate(180deg);
}

/* Mega Menu Dropdown */
.mega-menu-dropdown {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    overflow-x: hidden;
    top: 100%;
    left: 0; /* Default: align to parent li left */
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

/* Centering dropdown content for InMoment-like style */
.main-menu-item > .mega-menu-dropdown {
    left: 50%;
    transform: translate3d(-50%, -30px, 0);
    width: 100vw; /* Occupy full viewport width to allow inner container to center */
    max-width: 100%; /* Prevent exceeding viewport if 1170px is too wide */
}

.main-menu-item.has-megamenu.activeHoverMenu > .mega-menu-dropdown,
body.hoverMenu .main-menu-item.has-megamenu:hover > .mega-menu-dropdown,
body.hoverMenu .main-menu-item.has-megamenu.menu-open > .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translate3d(-50%, 0, 0);
}

.mega-menu-inner-container {
    max-width: 1170px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 20px 15px;
}

.mega-menu-content-columns-wrapper {
    display: flex;
    flex-wrap: wrap;
    flex-grow: 1;
}

.mega-menu-content-columns-wrapper.has-cta {
    flex-basis: 79%; /* Example, adjust as needed */
}

.mega-menu-content-columns-wrapper.no-cta {
    flex-basis: 100%;
}

.mega-menu-column {
    padding: 0 15px; /* Gutter between columns */
}

.mega-menu-column.cols-full {
    flex-basis: 100%;
    padding: 0;
}

.mega-menu-column.cols-1 { flex-basis: 100%; }
.mega-menu-column.cols-2 { flex-basis: 50%; }
.mega-menu-column.cols-3 { flex-basis: 33.3333%; }

/* Remove outer padding for first/last column if inner-container handles it */
.mega-menu-content-columns-wrapper > .mega-menu-column:first-child { padding-left: 0; }
.mega-menu-content-columns-wrapper > .mega-menu-column:last-child { padding-right: 0; }

.mega-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-list-item {
    margin-bottom: 10px;
}
.mega-menu-list-item.item-type-header {
    margin-bottom: 15px;
}

.mega-menu-section-header {
    margin: 0 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    font-size: 1em; /* From PHP */
    font-weight: bold; /* From PHP */
}

.mega-menu-section-header:not(.first-child) {
    margin-top: 15px;
}

.mega-menu-link {
    position: relative;
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    padding: 5px 0;
    color: inherit;
    transition: color .2s;
}

.mega-menu-link:after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
    border-radius: 1px;
}

.mega-menu-link:hover,
.mega-menu-list-item.current-menu-item > .mega-menu-link {
    color: #007bff;
}

.mega-menu-link:hover:after,
.mega-menu-list-item.current-menu-item > .mega-menu-link:after {
    width: 100%;
}

.mega-menu-link:hover .mega-menu-link-text,
.mega-menu-list-item.current-menu-item > .mega-menu-link .mega-menu-link-text {
    text-decoration: none;
}

.mega-menu-icon {
    margin-right: 8px;
    margin-top: 2px; /* Adjust for vertical alignment with text */
    flex-shrink: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.mega-menu-icon-img {
    width: 24px; /* Default icon size */
    height: 24px;
    object-fit: contain;
}

.mega-menu-link-text-wrap {
    display: flex;
    flex-direction: column;
}

.mega-menu-link-text {
    display: inline-block;
    line-height: 1.3;
}

.mega-menu-link-description {
    display: block;
    min-height: 36px;
    font-size: 0.85em;
    opacity: 0.8;
    line-height: 1.3;
    margin-top: 2px;
    /* color: #666; */
}

.mega-menu-separator {
    margin: 15px 0;
    border: 0;
    border-top: 1px solid #eee;
}

.mega-menu-columns-group-wrapper {
    width: 100%;
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
}

/* CTA Section in Mega Menu */
.mega-menu-cta-section {
    flex-shrink: 0;
    padding: 0 0 0 30px;
    position: relative;
    z-index: 2; 
}

.mega-menu-cta-section:after {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    width: 500%;
    height: calc(100% + 40px);
    z-index: -1;
}

.mega-menu-content-columns-wrapper.has-cta + .mega-menu-cta-section {
    flex-basis: 21%; /* Example, should complement content wrapper's basis */
    border-left: 1px solid #eee;
    margin-left: 30px; /* Space from content columns */
    display: flex;
    flex-wrap: wrap;
    align-content: center;
}

.mega-menu-cta-title {
    margin: 0 0 8px 0;
}

.mega-menu-cta-content {
    font-size: 0.9em;
}

.mega-menu-cta-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 4px;
}

.mega-menu-cta-button {
    display: block;
    text-align: center;
    align-self: center;
    color: #fff !important;
    width: 100%;
    font-size: 14px;
}

/* Global Header CTA */
.header-global-cta-wrapper {
    margin-left: 30px;
}

.cta-above-text {
    display: block;
    font-size: 0.8em;
    text-align: center;
    margin-bottom: 4px;
}

/* User Menu */
.userMenu {
    margin-left: 20px;
    display: flex;
    align-items: center;
}

.userMenu .nav {
    display: flex;
    align-items: center;
}

.userMenu .nav > li ul li {
    margin-left: 15px;
}

/* === Mobile Menu Styles === */
.mobileBtn, .closeBtn {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 1007;
}
.mobileBtn span { position: relative; display: block; width: 28px; height: 4px; background: #1786bf; transition: .15s transform ease-in-out; }
.mobileBtn span::after, .mobileBtn span::before { content: ''; display: block; position: absolute; height: 4px; right: 0; width: 100%; border-bottom: 4px solid #1786bf; }
.mobileBtn span::after { top: 10px; }
.mobileBtn span::before { top: -10px; }

.closeBtn span { position: relative; display: block; width: 28px; height: 28px; }
.closeBtn span:before { transform: translateY(-2px) rotate(45deg); }
.closeBtn span:after, .closeBtn span:before { content: ''; display: block; position: absolute; height: 0; right: 0; top: 50%; width: 100%; border-bottom: 4px solid #1786bf; transform-origin: 50% 50%; }
.closeBtn span:after { transform: translateY(-2px) rotate(-45deg); }

.slideOutNav {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: #fff;
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}
body.mobile-menu-open .slideOutNav {
    transform: translateX(0);
}

#slideOutNavInner {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#mainMenuSlide { /* This is the <nav> wrapper from original HTML */
    flex-grow: 1;
}

.mobile-main-menu-acf {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}
.mobile-main-menu-acf > .mobile-menu-item {
    border-bottom: 1px solid #eee;
}
.mobile-main-menu-acf > .mobile-menu-item:last-child {
    border-bottom: none;
}
.mobile-main-menu-acf .nav-link {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    text-decoration: none;
    font-size: 18px;
    cursor: pointer; /* For span toggles */
}
.mobile-main-menu-acf .submenu-indicator {
    font-size: 1.2em;
    transition: transform 0.2s ease-in-out;
}
.mobile-main-menu-acf .mobile-submenu-toggle[aria-expanded="true"] .submenu-indicator {
    transform: rotate(90deg);
}

.mobile-submenu {
    list-style: none;
    padding: 0 0 0 20px; /* Indent */
    margin: 0;
    display: none; /* Hidden by default, JS toggles */
}
.mobile-submenu .nav-item {
    border-bottom: 1px solid #f0f0f0;
}
.mobile-submenu .nav-item:last-child {
    border-bottom: none;
}
.mobile-submenu .nav-link {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    text-decoration: none;
}
.mobile-submenu .mobile-menu-icon {
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
}
.mobile-submenu .mobile-menu-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Mobile User Menu (part of slideOutNavInner) */
.slideOutNav .userMenu {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}
.slideOutNav .userMenu .nav {
    flex-direction: column;
}
.slideOutNav .userMenu .nav li {
    width: 100%;
    margin-bottom: 10px;
}
.slideOutNav .userMenu .nav li a,
.slideOutNav .userMenu .nav li .btn {
    display: block;
    text-align: center;
    padding: 12px;
}

/* Mobile Menu New Elements Styling */
.mobile-main-menu-acf .nav-link {
    display: flex; /* Align icon and text */
    align-items: center;
    position: relative; /* For arrow positioning */
}

.mobile-main-menu-acf .mobile-menu-icon {
    margin-right: 8px;
    line-height: 1; /* Helps align SVGs and font icons better */
}

.mobile-main-menu-acf .mobile-menu-icon svg,
.mobile-main-menu-acf .mobile-menu-icon i {
    width: 18px; /* Adjust as needed */
    height: 18px; /* Adjust as needed */
    vertical-align: middle;
}

.mobile-main-menu-acf .mobile-arrow-indicator {
    margin-left: auto; /* Pushes arrow to the right */
    font-size: 16px; /* Adjust as needed */
    transition: transform 0.3s ease;
}

.mobile-main-menu-acf .nav-link.mobile-submenu-toggle[aria-expanded="true"] .mobile-arrow-indicator {
    transform: rotate(180deg);
}

.mobile-submenu {
    padding-left: 20px; /* Indent sub-menu items */
    /* display: none; Should be handled by inline style in PHP or JS */
}

.mobile-submenu-column-header {
    padding: 8px 10px;
    font-weight: bold;
    color: #555; /* Adjust color as needed */
    margin-top: 5px;
    font-size: 0.9em;
    text-transform: uppercase;
    list-style-type: none; /* If not already handled by list-unstyled */
}

.mobile-submenu .mobile-menu-link-text {
    flex-grow: 1; /* Allow text to take available space */
}

.mobile-submenu .mobile-menu-link-description {
    display: block; /* Make description take its own line */
    font-size: 0.85em;
    color: #777; /* Adjust color as needed */
    margin-top: 5px; /* Align with text, assuming icon width + margin is around 26px */
    padding-bottom: 5px;
    line-height: 1.3;
}

/* Ensure sub-menu icons are also aligned */
.mobile-submenu .mobile-menu-icon.sub-item-icon {
    flex-shrink: 0; /* Prevent icon from shrinking */
}

/* RWD Breakpoints */
@media (max-width: 991px) {
    .absoluteNavbar,
    .fixedNavbar #menuWrap,
    .header-global-cta-wrapper,
    .custom-main-menu-nav-wrapper {
        display: none !important;
    }
    .fixedNavbar {
        top: 0;
        transform: translateY(0);
        height: 70px;
    }
    .fixedNavbar .navbarLockup {
        justify-content: space-between;
    }
    #menuWrap {
        flex-grow: 0;
    }
    .mobileBtn { display: block; }
    body.mobile-menu-open .mobileBtn { display: none; }
    body.mobile-menu-open .closeBtn { display: block; }

    .slideOutNav .userMenu {
        margin-left: 0;
    }

    .menu-header {
        width: 100%;
    }

    .mobile-submenu .mobile-menu-link-description {
        width: 100%;
        margin-top: 0;
    }

    .mobile-main-menu-acf .mobile-menu-icon {
        margin-right: 2px;
    }

    .mobile-submenu .nav-link {
      padding: 8px 0;
    }

    .mobile-sub-menu-item.li-has-icon .mobile-menu-link-description {
        padding-left: 36px;
    }
}

/* Blur effect */
body.custom-menu-blur-enabled.mega-menu-is-active #page,
body.custom-menu-blur-enabled.mobile-menu-is-active #page { /* #page is placeholder for your main content wrapper */
    filter: blur(5px);
    transition: filter 0.3s ease-in-out;
}
body.custom-menu-blur-enabled #page {
    transition: filter 0.3s ease-in-out; /* For smooth transition back */
}

/* Ensure current menu item styles are applied */
.custom-main-menu > .main-menu-item.current-menu-item > .nav-link,
.custom-main-menu > .main-menu-item.current-menu-ancestor > .nav-link,
.mega-menu-list-item.current-menu-item > .mega-menu-link .mega-menu-link-text,
.mobile-main-menu-acf > .mobile-menu-item.current-menu-item > .nav-link,
.mobile-main-menu-acf > .mobile-menu-item.current-menu-ancestor > .nav-link,
.mobile-submenu > .mobile-menu-item.current-menu-item > .nav-link {
    /* color: var(--your-active-menu-color); */
    /* font-weight: bold; or other indication */
}

/* Example from your theme for active menu underline */
.custom-main-menu > .main-menu-item > .nav-link:after {
    position: absolute;
    z-index: 1;
    line-height: 1;
    right: 50%;
    left: 50%;
    bottom: 0px; /* Adjust to be under the text */
    width: 0;
    height: 2px;
    content: "";
    transition: .25s all ease;
    background-color: #1786bf; /* Your theme's active color */
}

.fixedNavbar .custom-main-menu > .main-menu-item > .nav-link::after {
  bottom: -10px; /* Adjust for fixed nav to be below item */
}

.custom-main-menu > .main-menu-item.current-menu-parent > a:after,
.custom-main-menu > .main-menu-item.current-menu-item > a:after,
.custom-main-menu > .main-menu-item.current_page_item > a:after, /* If using WP classes */
.custom-main-menu > .main-menu-item:hover > a:after {
    width: 100%;
    left: 0;
    right: 0;
}

.custom-menu-blur-enabled main {
    transition: filter 0.3s ease-in-out;
    filter: blur(0px);
}

.custom-menu-blur-enabled.hoverMenu main {
    filter: blur(10px);
}

.custom-menu-blur-enabled.hoverMenu .animate{
    opacity: 0;
    visibility: hidden;
}

/* Text blocks in mega menu (desktop) */
.mega-menu-text-block {
    padding: 8px 0;
    line-height: 1.5;
}

.mega-menu-text-content {
    font-weight: 400;
    color: inherit;
}

.mega-menu-text-description {
    font-size: 0.85em;
    opacity: 0.8;
    margin-top: 4px;
    color: inherit;
}

/* Text blocks in mobile menu */
.mobile-submenu-text-item {
    padding: 10px 15px;
    line-height: 1.5;
}

.mobile-submenu-text-item.noHover {
    padding-left: 0;
}

.mobile-menu-text-content {
    font-weight: 400;
    color: inherit;
}

.mobile-menu-text-description {
    font-size: 0.85em;
    opacity: 0.8;
    margin-top: 4px;
    color: inherit;
}

/* Ensure no hover effects on text blocks */
.mega-menu-text-block,
.mobile-submenu-text-item {
    cursor: default;
}

/* Make sure links within text blocks are styled appropriately */
.mega-menu-text-content a,
.mobile-menu-text-content a {
    color: inherit;
    text-decoration: underline;
}

.mega-menu-text-content a:hover,
.mobile-menu-text-content a:hover {
    opacity: 0.8;
}
