/* =================================================
   ALLCLOUD NAVIGATION STYLES - OPTIMIZED
   ================================================= */

:root {
    --nav-inner-width: 1500px;
}

/* =================================================
   MINI NAV STYLES
   ================================================= */

nav.navbar.navbar-expand-lg.fixed-top {
    display: flex;
    flex-direction: column;
}

.navbar-mini-wrap {
    height: 40px;
    min-width: 100%;
    width: 100%;
    background: #03015a;
    font-weight: 600;
    text-align: right;
    display: flex;
}

.navbar-mini-inner {
    max-width: 1445px;
    margin: 0 auto;
    width: 100%;
    align-content: center;
    padding-left: 4%;
    padding-right: 5%;
}

.nav-mini-items {
    display: flex;
    justify-content: end;
}

.nav-mini-buttons {
    display: flex;
    width: auto;
    justify-content: space-between;
}

.nav-mini-buttons > li {
    border-radius: 10px;
    padding-left: 10px;
    padding-right: 10px;
    cursor: pointer;
}

.nav-mini-buttons a,
li.nav-mini-item a {
    border-radius: 20px;
    padding: 0 15px;
    font-family: "Roboto", Sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 1.53px;
    text-transform: uppercase;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out !important;
}

/* Mini nav contact buttons */
#mini-contact-button {
    background: var(--ac-primary-orange) !important;
    border: 1px solid var(--ac-primary-orange) !important;
    color: white !important;
    margin-left: 15px;
}

#mini-contact-button:hover {
    background: transparent !important;
    border: 1px solid var(--ac-primary-orange) !important;
    color: white !important;
}

#mini-engage-portal-button {
    background: transparent !important;
    border: 1px solid white !important;
    color: white;
}

#mini-engage-portal-button:hover {
    background: white !important;
    border: 1px solid white !important;
    color: black !important;
}

@media (max-width: 991.98px) {
    .navbar-mini-wrap {
        display: none;
    }
}

/* =================================================
   MEGA MENU CORE STYLES
   ================================================= */

/* Main nav parent links */
#mega-menu-primary > li > a {
    padding-left: 10px !important;
    padding-right: 10px !important;
}

#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
    font-size: 18px !important;
    font-weight: 600 !important;
}

#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:hover {
    background: #03015a !important;
}

/* Mega menu panel positioning */
#mega-menu-primary li.mega-menu-item > a + ul.mega-sub-menu[role="presentation"] {
    position: fixed !important;
    display: flex !important;
    justify-content: center !important;
    padding: 0 !important;
    border-top: 1px solid #c6c6c6 !important;
}

span.mega-indicator {
    margin: 0 !important;
}

/* Panel container */
.nav-row {
    padding: 40px 5% !important;
    max-width: var(--nav-inner-width) !important;
    min-height: 260px !important;
}

/* Column layout */
.mega-menu-column {
    width: auto !important;
}

.mega-menu-row > ul.mega-sub-menu,
.nav-row > ul.mega-sub-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    column-gap: 3.25rem !important;
    align-items: stretch !important;
}

/* Force equal column widths (excluding widget) */
.mega-menu-column:not(.mm-widget-section-1) {
    flex: 1 1 0 !important;
    min-width: 0 !important;
}

/* Column content alignment */
.mega-menu-column:not([role="presentation"]) {
    display: flex !important;
    flex-direction: column !important;
}

.mega-menu-column:not([role="presentation"]) > ul.mega-sub-menu {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    height: 100% !important;
}

/* =================================================
   MEGA MENU TYPOGRAPHY & CONTENT
   ================================================= */

/* Title styles */
.mm-title {
    cursor: default !important;
    margin-bottom: 16px !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: flex-start !important;
}

.mm-title a {
    font-size: clamp(16px, calc(100vw * 0.011), 18px) !important;
    font-weight: 600 !important;
    color: #03015a !important;
    line-height: 1.2 !important;
}

/* Content links */
.nav-row li:not(.mm-title) > a {
    font-size: var(--ac-font-size-small) !important;
    color: black !important;
}

/* Content spacing */
.nav-row li {
    padding: 0 !important;
}

.nav-row li:not(.mm-title) {
    margin-bottom: 8px !important;
}

.nav-row li:last-child {
    margin-bottom: 0 !important;
}

/* View All / Learn More links */
.mega-mm-view-all a,
.mm-learn-more a {
    font-weight: 600 !important;
}

.mm-view-all,
.mm-learn-more {
    /*margin-top: auto !important;*/
    margin-top: 10px !important;
}

/* MM link hover effects */
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item:not(.mm-title) > a.mega-menu-link:hover {
    color: var(--ac-primary-orange) !important;
}

/* Text content in description panels */
.mega-menu-item:not(.mm-widget-section-1 *) .textwidget p:not([class]),
.mega-menu-item:not(.mm-widget-section-1 *) .textwidget span:not([class]) {
    font-size: var(--ac-font-size-small) !important;
}

/* =================================================
   VIEW ALL ARROWS & INTERACTIONS
   ================================================= */

.mm-view-all > a.mega-menu-link {
    display: inline-flex !important;
    align-items: center !important;
    color: #555 !important;
    text-decoration: none !important;
    transition: color .15s ease-in-out !important;
}

.mm-view-all > a.mega-menu-link::after {
    content: "" !important;
    width: 1em !important;
    height: 1em !important;
    display: inline-block !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 1em 1em !important;
    transition: transform .15s ease-in-out !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 19 12' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M0.875 6H18.5M18.5 6L14 1.5M18.5 6L14 10.5'/></svg>") !important;
}

.mm-view-all > a.mega-menu-link:hover,
.mm-view-all > a.mega-menu-link:focus {
    color: var(--ac-primary-orange) !important;
}

.mm-view-all > a.mega-menu-link:hover::after,
.mm-view-all > a.mega-menu-link:focus::after {
    transform: translateX(2px) !important;
}

@media (prefers-reduced-motion: reduce) {
    .mm-view-all > a.mega-menu-link,
    .mm-view-all > a.mega-menu-link::after {
        transition: none !important;
    }
}

/* =================================================
   WIDGET STYLES
   ================================================= */

/* Widget column and background */
.mm-widget-section-1 {
    min-width: 25% !important;
    position: relative !important;
    background: transparent !important;
    flex: 0 0 25% !important;
}

.mm-widget-section-1::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: -40px !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100% + 80px) !important;
    background: #f4f8fa !important;
    z-index: -1 !important;
}

.mm-widget-section-1::after {
    display: none !important;
}

/* Widget container */
.mm-widget-container {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 24px !important;
    background-color: transparent !important;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
    max-width: 400px;
}

.mm-widget-main-title {
    font-size: 16px !important;
    font-weight: 600;
    text-align: center;
    margin: 0 0 20px 0;
    color: #1a1a1a;
}

.mm-widget-inner-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    align-items: center;
}

.mm-widget-image-wrap {
    max-width: 70%;
    width: fit-content !important;
}

.mm-widget-image-wrap img {
    height: 80px;
    width: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.mm-widget-inside {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mm-widget-description {
    color: #4a5568;
    margin: 0 0 16px 0;
    line-height: 1.4;
    text-align: center;
    font-size: 14px;
}

.mm-widget-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    letter-spacing: 0.5px;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mm-widget-link:hover {
    color: var(--ac-primary-orange) !important;
}

.arrow {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.arrow svg {
    width: 1em;
    height: 1em;
}

.mm-widget-link:hover .arrow {
    transform: translateX(2px);
}

/* =================================================
   POLYLANG FLAG SWITCHER
   ================================================= */

.mega-pll-parent-menu-item > ul.mega-sub-menu {
    max-width: 100% !important;
}

#mega-menu-wrap-primary #mega-menu-primary input,
#mega-menu-wrap-primary #mega-menu-primary img {
    max-width: none !important;
}

/* =================================================
   MOBILE MENU STYLES
   ================================================= */

.desktop-menu {
    display: flex !important;
}

.mobile-menu {
    display: none !important;
}

/* Mobile subtitle styling */
.nav-mobile-sub-title {
    cursor: default !important;
    opacity: 0.8;
    font-weight: 600;
}

.mobile-menu .nav-mobile-sub-title:hover,
.mobile-menu .nav-mobile-sub-title.nav-link:hover,
.mobile-menu .nav-mobile-sub-title.dropdown-item:hover {
    background-color: transparent !important;
    background: transparent !important;
    color: inherit !important;
}

/* Mobile view all arrows */
.mobile-menu .nav-mobile-view-all .dropdown-item::after {
    content: "" !important;
    display: inline-block !important;
    width: 19px !important;
    height: 12px !important;
    margin-left: 0.5em !important;
    vertical-align: middle !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 19 12' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0.875 6H18.5M18.5 6L14 1.5M18.5 6L14 10.5'/%3E%3C/svg%3E") !important;
    transition: transform 0.15s ease-in-out !important;
}

.mobile-menu .nav-mobile-view-all .dropdown-item:hover::after {
    transform: translateX(2px) !important;
}

@media (max-width: 991.98px) {
    .desktop-menu {
        display: none !important;
    }

    .mobile-menu {
        display: flex !important;
        flex-direction: column !important;
        width: 100%;
    }

    nav .container-lg.nav-container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .mega-menu-wrap,
    .mega-menu-toggle,
    .mega-sub-menu,
    #mega-menu-primary {
        display: none !important;
    }

    #navbarCollapse {
        background-color: white;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }

    .mobile-menu .nav-item {
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
    }

    .mobile-menu .nav-link {
        padding: 12px 15px;
        color: #333;
        display: block;
        text-decoration: none;
        width: 100%;
    }

    .mobile-menu .nav-link:hover {
        background-color: #f8f9fa;
        color: #333;
    }

    .mobile-menu .dropdown-menu {
        position: static !important;
        width: 100% !important;
        background-color: #f8f9fa !important;
        border: none !important;
        display: none !important;
    }

    .mobile-menu .dropdown-menu.show {
        display: block !important;
    }

    .mobile-menu .dropdown-item {
        padding: 10px 25px !important;
        color: #666 !important;
        text-decoration: none;
    }

    .mobile-menu .dropdown-item:hover {
        background-color: #e9ecef !important;
        color: #333 !important;
    }

    .mobile-menu .dropdown-toggle {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-menu .dropdown-toggle::after {
        display: inline-block;
        margin-left: auto;
        content: "\ea01";
        font-family: "ac-webfont";
        border: 0;
        vertical-align: bottom;
        transition: transform 0.2s ease;
    }

    .mobile-menu .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }

    /* Mobile menu item styling and indentation */
    .mobile-menu .nav-mobile-sub-title .dropdown-item:hover,
    .mobile-menu .nav-mobile-sub-title .dropdown-item:active,
    .mobile-menu .nav-mobile-sub-title .dropdown-item:focus,
    .mobile-menu .nav-mobile-sub-title .dropdown-item {
        background-color: #f9f9f9 !important;
        color: black !important;
        cursor: default !important;
    }

    .mobile-menu .nav-mobile-sub-title ~ li:not(.nav-mobile-sub-title) .dropdown-item {
        padding-left: 45px !important;
    }

    .mobile-menu .nav-mobile-sub-title ~ .nav-mobile-sub-title ~ li .dropdown-item {
        padding-left: 25px !important;
    }

    .mobile-menu .nav-mobile-sub-title ~ .nav-mobile-sub-title ~ li:not(.nav-mobile-sub-title) .dropdown-item {
        padding-left: 45px !important;
    }

    .mobile-menu .nav-mobile-view-all .dropdown-item {
        color: #666 !important;
    }

    .mobile-menu .nav-mobile-view-all .dropdown-item:hover {
        color: black !important;
        background-color: #e9ecef !important;
    }

    .mobile-menu .dropdown-toggle[aria-expanded="true"] {
        background-color: #f8f9fa !important;
        color: #ff8c00 !important;
        opacity: 1 !important;
    }

    .mobile-menu .lang-item .dropdown-item {
        padding-left: 25px !important;
    }

    /* Mobile menu overlay positioning */
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        top: 0;
    }

    #navbarCollapse {
        position: fixed !important;
        top: 97px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        background: white !important;
        z-index: 1000 !important;
    }
}

@media (min-width: 992px) {
    .navbar-toggler,
    #nav-mobile-contact-button {
        display: none !important;
    }

    #navbarCollapse {
        background: transparent;
        border: none;
        margin: 0;
    }

    body.modal-open {
        overflow: auto !important;
        position: static !important;
    }
}

/* =================================================
   RESPONSIVE ADJUSTMENTS
   ================================================= */

@media (max-width: 1400px) {
    .mm-title {
        min-height: 48px !important;
    }

    .nav-row {
        min-height: 280px !important;
    }

    .mm-widget-section-1::before {
        top: -40px !important;
        height: calc(100% + 80px) !important;
    }
}

@media (max-width: 1200px) {
    .mm-title {
        min-height: 56px !important;
    }

    .nav-row {
        min-height: 300px !important;
        padding-top: 35px !important;
        padding-bottom: 35px !important;
    }

    .nav-row > ul.mega-sub-menu {
        column-gap: 2.5rem !important;
    }

    .mm-widget-section-1::before {
        top: -35px !important;
        height: calc(100% + 70px) !important;
    }


    /*SPECIAL CASES - MOBILE*/
    /*Engage Portal*/
    .mobile-menu .nav-mobile-engage-portal a {
        color: white !important;
        background: #03015a !important;
    }
    .mobile-menu .nav-mobile-engage-portal a:hover {
        opacity: 1 !important;
    }
    .mobile-menu .nav-mobile-engage-portal .nav-link::after {
        content: "" !important;
        display: inline-block !important;
        width: 19px !important;
        height: 12px !important;
        margin-left: 0.5em !important;
        vertical-align: middle !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        background-size: contain !important;
        background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOSAxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMC44NzUgNkgxOC41TTE4LjUgNkwxNCAxLjVNMTguNSA2TDE0IDEwLjUiLz48L3N2Zz4=") !important;
        transition: transform 0.15s ease-in-out !important;
    }

    /*!*Active State (Mobile)*!*/
    /*.mobile-menu .dropdown-item.active, .dropdown-item:active {*/
    /*    background: transparent !important;*/
    /*    color: var(--ac-primary-orange) !important;*/
    /*    opacity: 0.5 !important;*/
    /*}*/

}

/* Special handling for AI Solutions layout */
.mega-nav-row.text-module .mm-title {
    min-height: 32px !important;
}

.mega-nav-row.text-module {
    min-height: 240px !important;
}


/*SPECIAL CASES*/
/*Polylang*/
#mega-menu-primary .lang-item a {
    background: #ffffff !important;
}
#mega-menu-primary .lang-item a:hover {
    background: #ddd !important;
}

/*Active State (Mobile)*/
/*WAITING UNTIL EACH MENU ITEM HAS AN INDIVIDUAL PAGE, ACTIVE LINKS WILL LOOK THE SAME DUE TO THEM ACTIVATING FOR MULTIPLE MENU ITEMS (SAVE-PAGE ISSUE)*/
.mobile-menu .dropdown-item.active, .dropdown-item:active {
    /*background: transparent !important;*/
    /*color: var(--ac-primary-orange) !important;*/
    /*opacity: 0.5 !important;*/
    background: transparent !important;
    color: #666 !important;
    opacity: 1 !important;
}



/*ALTERNATE LANGUAGES*/
/*html[lang^="de"] #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-flyout ul.mega-sub-menu li.mega-menu-item a.mega-menu-link {*/
/*    font-size: 18px;*/
/*    font-weight: 600;*/
/*    background: white;*/
/*}*/
