/* ===================================================== */
/* START MENU CSS                                         */
/* ===================================================== */
.menu .has-mega-menu {
    display: flex;
    align-items: center;
    column-gap: 6px;
}

.menu .nav-link-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #222431;
    cursor: pointer;
    line-height: 0;
    transition: color 0.25s ease;
}

.menu .nav-link-toggle svg {
    display: block;
    width: 8.511px;
    height: 10px;
    transition: transform 0.25s ease;
}

.menu .has-mega-menu:hover > a,
.menu .has-mega-menu.is-open > a,
.menu .has-mega-menu:focus-within > a {
    color: #f04e30;
    text-decoration: underline;
}

.menu .has-mega-menu > .nav-link-toggle.open,
.menu .has-mega-menu:focus-within > .nav-link-toggle {
    color: #f04e30;
}

.menu .has-mega-menu > .nav-link-toggle.open svg {
    transform: rotate(180deg);
}

@media (min-width: 1101px) {
    .menu .has-mega-menu:hover > .nav-link-toggle {
        color: #f04e30;
    }

    .menu .has-mega-menu:hover > .nav-link-toggle svg,
    .menu .has-mega-menu:focus-within > .nav-link-toggle svg {
        transform: rotate(180deg);
    }
}

.mega-menu {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

.mega-menu *,
.mega-menu *::before,
.mega-menu *::after {
    box-sizing: border-box;
}

.mega-menu p {
    margin: 0;
}

.menu .mega-menu a {
    text-decoration: none;
}

.mega-menu-inner {
    display: flex;
    background: #f7f5f5;
    border: 1px solid #e0e0e0;
    border-top: 0;
    border-radius: 20px;
    padding: 0 45px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.07));
}

.mega-menu-title {
    font-weight: 500;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #919298;
}

.mega-menu-solutions {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 34px 24px 34px 0;
    border-right: 1px solid #e0e0e0;
}

.menu .mega-menu .mega-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

/* Figma hover: rgba(229,230,233,0.6) bg, stronger icon shadow, orange arrow */
.menu .mega-menu .mega-menu-item:hover,
.menu .mega-menu .mega-menu-item:focus-visible {
    background: rgba(229, 230, 233, 0.6);
    text-decoration: none;
}

.mega-menu-list {
    display: flex;
    flex-direction: column;
}

.mega-menu-list-overview {
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.menu .mega-menu .mega-menu-overview {
    align-items: center;
}

/* Icon box - Figma "mega-menu-ico" Default / Hover */
.mega-menu-ico {
    position: relative;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 7px;
    border: 1px solid rgba(34, 36, 49, 0.14);
    background: #ffffff;
    box-shadow:
        0 4px 6.5px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.33);
    color: #b4b5b9; /* #222431 + white 66% overlay */
    overflow: hidden;
    transition:
        color 0.25s ease,
        box-shadow 0.25s ease;
}

/* gradient layer so the hover can fade in */
.mega-menu-ico::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #f04e30 0%, #f36e3a 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mega-menu-glyph {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 40px;
    height: 40px;
    max-width: none;
}

.mega-menu-item:hover .mega-menu-ico,
.mega-menu-item:focus-visible .mega-menu-ico {
    color: #ffffff;
    box-shadow:
        0 4px 6.5px rgba(0, 0, 0, 0.14),
        inset 0 1px 1px rgba(255, 255, 255, 0.33);
}

.mega-menu-item:hover .mega-menu-ico::before,
.mega-menu-item:focus-visible .mega-menu-ico::before {
    opacity: 1;
}

.mega-menu-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.mega-menu-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #222431;
}

.mega-menu-overview .mega-menu-name {
    text-decoration: underline;
    text-decoration-thickness: 5.5%;
    text-underline-offset: 2px;
}

.mega-menu-arrow {
    flex: 0 0 auto;
    width: 14px;
    height: 10px;
    color: #000000;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.mega-menu-item:hover .mega-menu-arrow {
    color: #f36e3a;
    transform: translateX(3px);
}

.mega-menu-desc {
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
    color: #7a7c83;
}

/* 3 per row - 4th+ item wraps to a new row */
.mega-menu-list.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.mega-menu-grid .mega-menu-list-item {
    min-width: 0;
    display: flex;
    position: relative;
}

.menu .mega-menu .mega-menu-grid .mega-menu-item {
    flex: 1 1 auto;
}

/* horizontal divider above each new row */
.mega-menu-grid .mega-menu-list-item:nth-child(n + 4)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -4px;
    height: 1px;
    background: #e0e0e0;
}

/* vertical divider between columns (not on the first item of a row) */
.mega-menu-grid .mega-menu-list-item:not(:nth-child(3n + 1))::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e0e0e0;
}

.mega-menu-cta {
    flex: 0 0 540px;
    width: 540px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 34px 24px 34px 44px;
}

.mega-menu-cta-box {
    flex: 1 1 auto;
    display: flex;
    gap: 32px;
    align-items: stretch;
}

.mega-menu-cta-img {
    flex: 1 1 0;
    min-width: 0;
    min-height: 190px;
    border-radius: 5px;
    overflow: hidden;
}

.mega-menu-cta-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mega-menu-cta-content {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mega-menu-cta-title {
    font-weight: 600;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #222431;
}

.mega-menu .mega-menu-cta-text {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: #7a7c83;
}

.menu .mega-menu .mega-menu-cta-btn {
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 6px 6px 6px 22px;
    border-radius: 24px;
    background: #222431;
    color: #f7f5f5;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Figma hover: gradient sheen + white text glow + raised arrow circle */
.menu .mega-menu .mega-menu-cta-btn:hover {
    background: #f36e3a;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.75),
        0 0 10px rgba(255, 255, 255, 0.75);
}
.menu .mega-menu .mega-menu-cta-btn svg rect,
.menu .mega-menu .mega-menu-cta-btn svg path {
    transition: all 0.2s ease-in-out;
}
.menu .mega-menu .mega-menu-cta-btn:hover svg {
    left: 5px;
    filter: drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.5));
}

.menu .mega-menu .mega-menu-cta-btn:hover rect {
    fill: #f7f5f5;
}

.menu .mega-menu .mega-menu-cta-btn:hover path {
    fill: #f04e30;
}

/* Desktop: open on hover */
@media (min-width: 1101px) {
    .menu > li > a {
        white-space: nowrap;
    }
    .menu .has-mega-menu {
        position: static;
    }

    .mega-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 50%;
        width: calc(100% - 90px);
        max-width: 1350px;
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate(-50%, 10px);
        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0s linear 0.25s;
    }

    /* invisible bridge so the cursor can travel from the link to the panel */
    .mega-menu::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: 40px;
    }

    .menu .has-mega-menu:hover > .mega-menu,
    .menu .has-mega-menu:focus-within > .mega-menu,
    .menu .has-mega-menu.is-open > .mega-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0);
        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0s linear 0s;
    }
}

@media (min-width: 1101px) and (max-width: 1199px) {
    .mega-menu {
        width: calc(100% - 40px);
    }

    .mega-menu-inner {
        padding: 0 24px;
    }

    .mega-menu-cta {
        flex-basis: 340px;
        width: 340px;
        padding-left: 24px;
    }

    .mega-menu-cta-img {
        display: none;
    }

    .menu .mega-menu .mega-menu-grid .mega-menu-item {
        flex-direction: column;
    }
}

/* Mobile: open on arrow click */
@media (max-width: 1100px) {
    #site-navigation {
        max-height: 76vh;
        overflow: auto;
    }
    .menu .has-mega-menu {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .menu .has-mega-menu > a {
        flex: 1 1 auto;
    }

    .menu .nav-link-toggle {
        width: 32px;
        height: 32px;
        margin: -8px -8px -8px 0;
    }

    .menu .nav-link-toggle svg {
        width: 12px;
        height: 14px;
    }

    /* hidden by default, opened with jQuery slideDown */
    .mega-menu {
        display: none;
        flex: 0 0 100%;
        width: 100%;
    }

    .mega-menu-inner {
        flex-direction: column;
        padding: 0;
        margin-top: 16px;
        border: 0;
        border-radius: 0;
        filter: none;
        background: transparent;
    }

    .mega-menu-solutions {
        padding: 0 0 16px;
        border-right: 0;
        border-bottom: 1px solid #e0e0e0;
        gap: 8px;
    }

    .menu .mega-menu .mega-menu-item {
        padding: 12px 8px;
    }

    .mega-menu-list-overview {
        padding-bottom: 0;
    }

    .mega-menu-list.mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .mega-menu-grid .mega-menu-list-item::before,
    .mega-menu-grid .mega-menu-list-item::after {
        display: none;
    }

    .mega-menu-grid .mega-menu-list-item + .mega-menu-list-item {
        border-top: 1px solid #e0e0e0;
    }

    .mega-menu-cta {
        flex: 0 0 auto;
        width: 100%;
        padding: 16px 0 0;
    }

    .mega-menu-cta-box {
        flex-direction: column;
        gap: 16px;
    }

    .mega-menu-cta-img {
        flex: 0 0 auto;
        aspect-ratio: 16 / 9;
        min-height: 0;
    }

    .mega-menu-cta-title {
        font-size: 18px;
    }

    .menu .mega-menu .mega-menu-cta-btn {
        margin-top: 16px;
    }
}
/* ===================================================== */
/* END MENU CSS                                           */
/* ===================================================== */
