/* Two-tier site header: black utility bar + white main nav */

:root {
    --header-utility-h: 36px;
    --header-main-h: 64px;
    --site-header-offset: calc(var(--header-utility-h) + var(--header-main-h));
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 15, 15, 0.08);
    transition: box-shadow 0.2s ease;
}

.site-header.shrink {
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 15, 15, 0.08);
    animation: none;
}

body {
    padding-top: var(--site-header-offset);
}

/* ── Utility bar ── */
.header-utility {
    background: #111;
    color: #fff;
    height: 36px;
}

.header-utility .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-partners {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.header-partner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

.header-partner:hover,
.header-partner:focus {
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
}

.header-partner-sep {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}

.partner-mark--eccc {
    width: 10px;
    height: 10px;
    background: #2f6bff;
    flex-shrink: 0;
}

.partner-mark--mastercard {
    width: 18px;
    height: 12px;
    position: relative;
    flex-shrink: 0;
}

.partner-mark--mastercard::before,
.partner-mark--mastercard::after {
    content: '';
    position: absolute;
    top: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.partner-mark--mastercard::before {
    left: 0;
    background: #eb001b;
}

.partner-mark--mastercard::after {
    left: 7px;
    background: #f79e1b;
}

.header-utility-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
}

.header-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 8px 0 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    line-height: 1;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.header-lang-btn .bi-globe2 {
    font-size: 13px;
    line-height: 1;
    opacity: 0.95;
}

.header-lang-btn .header-lang-code {
    line-height: 1;
}

.header-lang-btn .header-lang-caret {
    font-size: 9px;
    line-height: 1;
    opacity: 0.7;
}

.header-lang-btn:hover,
.header-lang-btn:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.32);
    outline: none;
}

.header-login-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.header-login-link:hover,
.header-login-link:focus {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
}

.header-utility .dropdown-toggle::after {
    margin-left: 4px;
    vertical-align: 1px;
    border-top-color: currentColor;
}

.header-utility .dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
    padding: 6px;
    margin-top: 8px;
}

.header-utility .dropdown-item {
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
}

.header-utility .dropdown-item:hover {
    background: #f3f4f6;
    color: #111;
}

/* ── Main nav ── */
.header-main {
    background: #fff;
    min-height: 64px;
    padding-top: 0;
    padding-bottom: 0;
    position: relative;
}

.header-main .container {
    display: flex;
    align-items: center;
    position: relative;
}

.header-main .navbar-brand {
    padding: 8px 0;
    margin-right: 0;
}

.header-main .navbar-brand img {
    width: 180px;
    height: auto;
    display: block;
}

.site-header .navbar-nav .nav-item .nav-link {
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    padding: 22px 14px;
    position: relative;
    white-space: nowrap;
}

.site-header .navbar-nav .nav-item .nav-link:hover,
.site-header .navbar-nav .nav-item.show .nav-link,
.site-header .navbar-nav .nav-item .nav-link:focus,
.site-header .navbar-nav .nav-item .nav-link.active {
    color: #111;
}

.site-header .navbar-nav .nav-item .nav-link::before {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    height: 3px;
    background: #111;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.15s ease;
}

.site-header .navbar-nav .nav-item .nav-link:hover::before,
.site-header .navbar-nav .nav-item.show .nav-link::before,
.site-header .navbar-nav .nav-item .nav-link.active::before {
    transform: scaleX(1);
}

.site-header .navbar-nav .dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: 2px;
    border-top-color: currentColor;
}

.btn-free-scan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 6px;
    padding: 10px 18px;
    line-height: 1.2;
    border: none;
    white-space: nowrap;
    margin-left: 8px;
    text-decoration: none;
}

.btn-free-scan:hover,
.btn-free-scan:focus {
    background: #000;
    color: #fff !important;
    text-decoration: none;
}

.dropdown-menu-nav {
    border: none;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
    padding: 8px;
    min-width: 220px;
    margin-top: 0;
}

.dropdown-menu-nav .dropdown-item {
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
}

.dropdown-menu-nav .dropdown-item:hover,
.dropdown-menu-nav .dropdown-item:focus {
    background: #f3f4f6;
    color: #111;
}

.mobile-free-scan-button {
    margin: 0;
    background: #111;
    color: #fff;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: 100%;
    display: block;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

.mobile-free-scan-button:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

/* ── Solutions mega menu ── */
.site-header .dropdown-mega {
    position: static;
}

.site-header .solutions-mega {
    left: 15px;
    right: 15px;
    width: auto;
    min-width: 0;
    max-width: none;
    transform: none;
    top: calc(100% - 2px);
    margin: 0;
    padding: 0;
    border: 1px solid #ececec;
    border-radius: 0;
    box-shadow: 0 18px 48px rgba(15, 15, 15, 0.12);
    overflow: hidden;
}

.solutions-mega-cols {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr 0.92fr;
    align-items: stretch;
    background: #fff;
}

.solutions-mega-col {
    padding: 22px 18px 18px;
    border-right: 1px solid #eee;
    min-width: 0;
}

.solutions-mega-heading {
    margin: 0 0 12px;
    padding: 0 4px;
    color: #9aa0a6;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.3;
}

.solutions-mega .dropdown-item-enhanced {
    padding: 10px 8px;
    border-radius: 0;
    gap: 12px;
    align-items: flex-start;
}

.solutions-mega .service-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-header .solutions-mega .service-img {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.solutions-mega .dropdown-item-enhanced:hover {
    background: #f6f7f9;
    color: #111;
}

.solutions-mega .dropdown-item-enhanced:hover .service-title {
    color: #111;
}

.solutions-mega .service-title {
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

.solutions-mega .service-desc {
    font-size: 12px;
    color: #8a8f98;
}

.solutions-mega-cta {
    padding: 22px 22px 24px;
    background: #f7f8fa;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.solutions-mega-cta p {
    margin: 0 0 18px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.45;
    font-style: italic;
}

.solutions-mega-scan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 12px 16px;
    border: 1.5px solid #111;
    border-radius: 0;
    color: #111;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.solutions-mega-scan:hover,
.solutions-mega-scan:focus {
    background: #111;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 991px) {
    :root {
        --header-utility-h: 44px;
        --header-main-h: 56px;
    }

    .header-utility {
        height: auto;
        min-height: var(--header-utility-h);
        padding: 8px 0;
    }

    .header-utility .container {
        height: auto;
        min-height: 28px;
        gap: 8px 10px;
    }

    .header-partners {
        flex: 1 1 auto;
        min-width: 0;
        gap: 8px;
    }

    .header-partner {
        font-size: 10px;
        letter-spacing: 0.06em;
        gap: 6px;
        min-width: 0;
    }

    .header-partner-label {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-partner-sep {
        height: 10px;
    }

    .header-utility-actions {
        gap: 10px;
        flex-shrink: 0;
    }

    .header-lang-btn {
        padding: 0 8px;
        font-size: 11px;
        height: 26px;
    }

    .header-login-link {
        font-size: 11px;
        padding: 0 6px;
    }

    .header-main {
        min-height: 56px;
    }

    .header-main .navbar-brand img {
        width: 150px;
    }

    .header-main .container {
        justify-content: space-between;
    }
}

@media (max-width: 420px) {
    .header-partner-sep {
        display: none;
    }

    /* Keep ECCC label + Mastercard mark when space is tight */
    .header-partner--mastercard .header-partner-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .header-partner--mastercard {
        position: relative;
    }
}
