/*
 * Desktop mega menu (Services, Solutions, Accelerators, Company).
 * Markup: inc/mega-menu.php. Font and colours are the existing theme ones
 * (Poppins inherited from the page, #003D84 / #1B8AFC blues, #f2f5fb tint).
 * Every colour is set explicitly because the theme styles bare <a> tags.
 */

/* Top-level item: underline while its menu is open (same underline the hover state already uses) */
.navbar-nav > .na-mega-item > .nav-link.show:before {
    width: 100%;
}

.na-mega {
    font-size: 14px;
    background: #fff;
}

.na-mega a {
    text-decoration: none;
}

.na-mega__inner {
    display: grid;
    min-height: 480px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.na-mega--rail .na-mega__inner {
    grid-template-columns: 31% 36% 33%;
}

.na-mega--columns .na-mega__inner {
    grid-template-columns: 69% 31%;
}

.na-mega__rail {
    display: flex;
    flex-direction: column;
    padding: 40px 40px 40px 48px;
}

.na-mega__panels {
    padding: 40px 48px 40px 50px;
}

.na-mega__main {
    padding: 40px 48px 40px 48px;
}

/* Headings ("Services →", "Agentic AI & AI Consulting →") */
.na-mega .na-mega__title {
    display: block;
    width: min(100%, 384px);
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.3;
    color: #003D84;
    transition: color .2s ease;
}

.na-mega .na-mega__title--sm {
    width: 100%;
    font-size: 18px;
}

.na-mega .na-mega__title:hover {
    color: #1B8AFC;
}

/* Services: category rail */
.na-mega__cats {
    margin: 0;
    padding: 0;
    list-style: none;
}

.na-mega .na-mega__cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 432px;
    margin-bottom: 4px;
    padding: 12px 14px 12px 10px;
    border-left: 4px solid transparent;
    font-size: 14px;
    line-height: 1.4;
    color: #666;
    transition: background-color .2s ease, color .2s ease;
}

/* Selection happens on click, so hovering only changes the text colour (the tint is reserved for the selected item) */
.na-mega .na-mega__cat {
    cursor: pointer;
}

.na-mega .na-mega__cat:hover,
.na-mega .na-mega__cat:focus {
    color: #023563;
}

.na-mega .na-mega__cat.is-active {
    color: #000;
    font-weight: 500;
    background: #f2f5fb;
    border-left-color: #0d6efd;
}

.na-mega__chev {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    color: #333;
}

.na-mega .na-mega__cat.is-active .na-mega__chev {
    color: #0d6efd;
}

/* Services: the hovered category's links */
.na-mega__panel {
    display: none;
}

.na-mega__panel.is-active {
    display: block;
}

.na-mega__links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.na-mega .na-mega__link {
    display: block;
    padding: 9px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    transition: color .2s ease;
}

/* Hover: bold blue text with an arrow (arrow is hidden until hover; no layout shift) */
.na-mega .na-mega__arrow {
    opacity: 0;
    transition: opacity .2s ease;
}

.na-mega .na-mega__link:hover,
.na-mega .na-mega__link:focus-visible {
    
    color: #1B8AFC;
}

.na-mega .na-mega__link:hover .na-mega__arrow,
.na-mega .na-mega__link:focus-visible .na-mega__arrow {
    opacity: 1;
}

/* Solutions / Accelerators / Company: grouped columns */
.na-mega__groups {
    display: grid;
    column-gap: 36px;
    padding-left: 14px;
}

.na-mega__group-title {
    margin: 8px 0 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f2f5fb;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #003D84;
}

.na-mega__group.is-split .na-mega__links {
    column-count: 2;
    column-gap: 36px;
}

.na-mega__group.is-split .na-mega__links li {
    break-inside: avoid;
}

/* Right-hand tinted panel */
.na-mega__side {
    padding: 40px 48px 40px 54px;
    background: #f2f5fb;
}

.na-mega__eyebrow {
    margin-bottom: 26px;
    font-size: 14px;
    color: #666;
}

.na-mega .na-mega__feat {
    display: block;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dde3ee;
}

.na-mega .na-mega__feat:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.na-mega__feat-title,
.na-mega__side-title {
    display: block;
    margin-bottom: 8px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    color: #003D84;
    transition: color .2s ease;
}

.na-mega .na-mega__feat:hover .na-mega__feat-title {
    color: #1B8AFC;
}

.na-mega__feat-text,
.na-mega__side-text {
    display: block;
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #6c757d;
}

.na-mega .na-mega__feat-link {
    font-size: 12px;
    font-weight: 600;
    color: #1B8AFC;
}

.na-mega .na-mega__feat-link:hover {
    color: #003D84;
}

.na-mega__contact {
    margin: 0;
    padding: 0;
    list-style: none;
}

.na-mega__contact li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    font-size: 14px;
    color: #6c757d;
}

.na-mega__contact-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    object-fit: contain;
    color: #1B8AFC;
}

.na-mega .na-mega__contact a {
    color: #333;
}

.na-mega .na-mega__contact a:hover {
    color: #1B8AFC;
}

/* Narrow laptops */
@media (max-width: 1199px) {
    .na-mega__rail,
    .na-mega__main {
        padding-left: 28px;
    }

    .na-mega__panels,
    .na-mega__main {
        padding-right: 28px;
    }

    .na-mega__side {
        padding: 40px 28px;
    }

    .na-mega__groups {
        column-gap: 22px;
    }
}

/* Optional picture above a side panel card (Menu Image of the card's menu item) */
.na-mega__feat-img {
    display: block;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

.na-mega__feat-img img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: cover;
}

.na-mega__contact li > span {
    margin-left: -5px;
}

/* Get In Touch: bold heading, country flags as icons */
.na-mega__eyebrow.is-contact {
    margin-bottom: 14px;
    font-weight: 700;
    color: #222;
}

.na-mega__contact-icon.is-flag {
    flex: 0 0 24px;
    width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}

/* Get In Touch: ServiceNow certification badges */
.na-mega__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.na-mega__badges li {
    flex: 0 0 auto;
}

.na-mega__badges img {
    display: block;
    width: 78px;
    height: auto;
    border-radius: 10px;
}

/* Success Stories: shorter panel than the 480px default, cards sit left of the tinted box */
.na-mega--stories .na-mega__inner {
    grid-template-columns: 69% 31%;
    min-height: 0;
}

/* Success Stories: left-hand heading uses the same .na-mega__title style as the other menus ("Accelerators →") */
.na-mega--stories .na-mega__main .col-md-3 > .na-mega__title {
    width: 100%;
    margin-bottom: 14px;
    padding-bottom: 14px;
}

/* Services: "View all services" stays at the bottom of the left rail */
.na-mega .na-mega__viewall {
    align-self: flex-start;
    margin-top: auto;
    padding: 11px 22px;
    border-radius: 8px;
    background: #003D84;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    transition: background-color .2s ease;
}

.na-mega__rail .na-mega__cats {
    margin-bottom: 28px;
}

.na-mega .na-mega__viewall:hover {
    background: #1B8AFC;
    color: #fff;
}
