:root {
    --elsh-header-h: 86px;
    --elsh-header-h-scrolled: 68px;
    --elsh-mobile-h: 72px;
    --elsh-mobile-h-scrolled: 60px;
    --elsh-navy: #071a39;
    --elsh-blue: #087cff;
}

/* Hide common theme/page-builder headers so this plugin becomes the global header. */
body.everyloan-sticky-header-active #masthead,
body.everyloan-sticky-header-active header.site-header,
body.everyloan-sticky-header-active .site-header:not(.elsh-header),
body.everyloan-sticky-header-active .elementor-location-header,
body.everyloan-sticky-header-active [data-elementor-type="header"] {
    display: none !important;
}

html.elsh-menu-open,
body.elsh-menu-open {
    overflow: hidden !important;
}

body.everyloan-sticky-header-active {
    padding-top: var(--elsh-header-h) !important;
}

.elsh-header,
.elsh-header * {
    box-sizing: border-box;
}

.elsh-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 999990;
    height: var(--elsh-header-h);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(7, 26, 57, 0.07);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    transition: height .24s ease, box-shadow .24s ease, background-color .24s ease;
}

.elsh-header.is-scrolled {
    height: var(--elsh-header-h-scrolled);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 34px rgba(7, 26, 57, 0.11);
}

.elsh-header-inner {
    position: relative;
    width: min(100% - 48px, 1480px);
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.elsh-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-decoration: none;
}

.elsh-logo {
    display: block;
    width: 255px;
    height: auto;
    max-height: 64px;
    object-fit: contain;
    transition: width .24s ease, transform .24s ease;
}

.elsh-header.is-scrolled .elsh-logo {
    width: 220px;
}

.elsh-menu-toggle {
    display: none;
}

.elsh-backdrop,
.elsh-drawer {
    display: none;
}

@media (max-width: 767px) {
    body.everyloan-sticky-header-active {
        padding-top: var(--elsh-mobile-h) !important;
    }

    .elsh-header {
        height: var(--elsh-mobile-h);
    }

    .elsh-header.is-scrolled {
        height: var(--elsh-mobile-h-scrolled);
    }

    .elsh-header-inner {
        width: 100%;
        padding: 0 18px;
    }

    .elsh-logo-link {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .elsh-logo {
        width: 184px;
        max-height: 52px;
    }

    .elsh-header.is-scrolled .elsh-logo {
        width: 166px;
    }

    .elsh-menu-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        position: absolute;
        left: 17px;
        top: 50%;
        width: 42px;
        height: 42px;
        transform: translateY(-50%);
        padding: 9px;
        margin: 0;
        border: 0;
        border-radius: 13px;
        background: transparent;
        box-shadow: none;
        cursor: pointer;
        z-index: 2;
        -webkit-tap-highlight-color: transparent;
    }

    .elsh-menu-toggle span {
        width: 23px;
        height: 2px;
        border-radius: 999px;
        background: var(--elsh-navy);
        transition: transform .2s ease, opacity .2s ease;
    }

    .elsh-menu-toggle:focus-visible,
    .elsh-close:focus-visible {
        outline: 3px solid rgba(8, 124, 255, .24);
        outline-offset: 2px;
    }

    .elsh-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 999991;
        background: rgba(2, 12, 30, .38);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .elsh-drawer {
        display: block;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 999992;
        width: min(86vw, 360px);
        padding: max(22px, env(safe-area-inset-top)) 22px 28px;
        background: rgba(255, 255, 255, .98);
        box-shadow: 26px 0 70px rgba(5, 24, 54, .16);
        transform: translateX(-104%);
        transition: transform .3s cubic-bezier(.2,.8,.2,1);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        overflow-y: auto;
    }

    .elsh-menu-open .elsh-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .elsh-menu-open .elsh-drawer {
        transform: translateX(0);
    }

    .elsh-drawer-top {
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(7, 26, 57, .08);
        margin-bottom: 16px;
    }

    .elsh-drawer-title {
        color: var(--elsh-navy);
        font: 700 18px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    .elsh-close {
        position: relative;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .elsh-close span {
        position: absolute;
        top: 19px;
        left: 10px;
        width: 22px;
        height: 2px;
        border-radius: 99px;
        background: var(--elsh-navy);
    }

    .elsh-close span:first-child { transform: rotate(45deg); }
    .elsh-close span:last-child { transform: rotate(-45deg); }

    .elsh-menu-list,
    .elsh-menu-list ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .elsh-menu-list > li {
        border-bottom: 1px solid rgba(7, 26, 57, .075);
    }

    .elsh-menu-list a {
        display: block;
        padding: 15px 2px;
        color: var(--elsh-navy);
        text-decoration: none;
        font: 650 16px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    .elsh-menu-list .sub-menu {
        padding: 0 0 10px 14px;
    }

    .elsh-menu-list .sub-menu a {
        padding: 9px 0;
        font-size: 14px;
        font-weight: 550;
        opacity: .78;
    }
}

@media (prefers-reduced-motion: reduce) {
    .elsh-header,
    .elsh-logo,
    .elsh-drawer,
    .elsh-backdrop {
        transition: none !important;
    }
}
