/* Floating header (Figma "Main Pages" / "Main service home"): a frosted, rounded bar
   that sits over the hero. Opt-in with <body class="mlm-header-floating">. */

body.mlm-header-floating .mlm-site-header {
    top: 16px;
    width: auto;
    max-width: 1439px;
    margin: 68px calc(80px * var(--svp-zoom, 1)) 0;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .5);
    box-shadow: 0 4px 42.5px rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: blur(31px);
    backdrop-filter: blur(31px);
}

@media (min-width: 1599px) {
    body.mlm-header-floating .mlm-site-header {
        margin-right: auto;
        margin-left: auto;
    }
}

body.mlm-header-floating .mlm-site-header.is-scrolled {
    background: rgba(255, 255, 255, .82);
}

body.mlm-header-floating .mlm-site-header__inner {
    max-width: none;
    min-height: 73px;
    padding: 0 37px 0 39px;
}

body.mlm-header-floating .mlm-site-header__brand img {
    width: 150px;
}

body.mlm-header-floating .mlm-site-nav>a,
body.mlm-header-floating .mlm-site-nav__dropdown-toggle {
    color: #5c5c5c;
    font-size: 15px;
    font-weight: 600;
}

body.mlm-header-floating .mlm-site-nav>a.is-current,
body.mlm-header-floating .mlm-site-nav__dropdown-toggle.is-current {
    color: #0888a7 !important;
}

body.mlm-header-floating .mlm-site-header__contact {
    min-width: 0;
    padding-left: 0;
    border-left: 0;
}

body.mlm-header-floating .mlm-site-header__tabs {
    gap: 4px;
}

body.mlm-header-floating .mlm-site-header__tab {
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 500;
    line-height: 15px;
}

body.mlm-header-floating .mlm-site-header__phone {
    margin-top: 4px;
    padding: 5px 14px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 500;
    line-height: 15px;
}

/* Mega menus open just below the floating bar. The bar's backdrop-filter makes it the containing
   block of the fixed menus, so top is measured from the bar itself: 10px below its bottom edge. */
@media (min-width: 901px) {
    body.mlm-header-floating .mlm-site-nav__dropdown--mega .mlm-site-nav__dropdown-menu {
        top: calc(100% + 10px);
    }

    body.mlm-header-floating .mlm-site-nav__dropdown--mega.is-open .mlm-site-nav__dropdown-menu,
    body.mlm-header-floating .mlm-site-nav__dropdown--mega:hover .mlm-site-nav__dropdown-menu,
    body.mlm-header-floating .mlm-site-nav__dropdown--mega:focus-within .mlm-site-nav__dropdown-menu {
        transform: translate(-50%, 0) !important;
    }
}

@media (max-width: 900px) {
    body.mlm-header-floating .mlm-site-header {
        top: 10px;
        margin: 16px 10px 0;
    }

    body.mlm-header-floating .mlm-site-header__inner {
        min-height: 64px;
        padding: 0 14px;
    }

    body.mlm-header-floating .mlm-site-header__brand img {
        width: 140px;
    }
}

/* The legacy theme sets overflow:hidden auto on html/body, which turns body into a scroll
   container and stops position:sticky. clip hides sideways overflow without that side effect. */
html:has(body.mlm-header-floating),
body.mlm-header-floating {
    overflow-x: clip;
    overflow-y: visible;
}

/* Desktop bar as in the Figma header (1439 x 73): logo 64px in, the menu centred (its centre sits
   32px right of the bar's centre, as designed), the contact block 63px from the right edge. */
@media (min-width: 1340px) {
    body.mlm-header-floating .mlm-site-header__inner {
        position: relative;
        padding: 0 63px 0 64px;
    }

    body.mlm-header-floating .mlm-site-header__brand img {
        width: 165px;
    }

    /* Centred without a transform (a transform would become the mega menus' containing block):
       right:-64px moves the centre 32px right; top:4px nudges it 2px down. */
    body.mlm-header-floating .mlm-site-nav {
        position: absolute;
        top: 4px;
        right: -64px;
        bottom: 0;
        left: 0;
        width: max-content;
        height: max-content;
        gap: 16px;
        margin: auto;
    }

    body.mlm-header-floating .mlm-site-nav>a[href="/"] {
        min-width: 49px;
        text-transform: uppercase;
    }

    /* Contact block: 61px + 96px tabs, 161px number bar, teal outlines, -5% tracking. */
    body.mlm-header-floating .mlm-site-header__tab,
    body.mlm-header-floating .mlm-site-header__phone {
        padding: 4px 0;
        border-color: #0888a7;
        letter-spacing: -0.05em;
        text-align: center;
    }

    body.mlm-header-floating .mlm-site-header__tab {
        width: 61px;
        color: #0888a7;
    }

    body.mlm-header-floating .mlm-site-header__tab+.mlm-site-header__tab {
        width: 96px;
    }

    body.mlm-header-floating .mlm-site-header__phone {
        width: 161px;
        padding: 5px 0;
        background: #0888a7;
    }

    body.mlm-header-floating .mlm-site-nav>a,
    body.mlm-header-floating .mlm-site-nav__dropdown-toggle {
        gap: 0;
        padding: 0;
        font-size: 15px;
        font-weight: 600;
        line-height: 15px;
        letter-spacing: -0.05em;
    }

    /* Caret: 7px chevron, 12px after the label and 9px before the next item. */
    body.mlm-header-floating .mlm-site-nav__dropdown-toggle::after {
        width: 5px;
        height: 5px;
        margin: 0 -7px 0 14px;
        border-right-width: 2px;
        border-bottom-width: 2px;
    }
}

/* Pages that were not laid out under the bar (home, about, blog, policies...) get the same floating
   header, just closer to the top than the service heroes' 68px. */
body.mlm-header-floating.mlm-header-flow .mlm-site-header {
    margin-top: 16px;
}

@media (max-width: 900px) {
    body.mlm-header-floating.mlm-header-flow .mlm-site-header {
        margin-top: 10px;
    }
}
