/* Fixed-height header bar; logo spills upward and onto hero when LogoWidth increases. */
.theme-main-menu,
.theme-main-menu > .inner-content,
.theme-main-menu .b2b-band {
    overflow: visible;
}

.theme-main-menu .top-header {
    height: 56px;
    max-height: 56px;
    overflow: visible;
    position: relative;
    z-index: 2;
}

.theme-main-menu .top-header > .d-flex.align-items-center {
    width: 100%;
    max-width: 100%;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
    align-items: center !important;
    gap: 12px;
    overflow: visible;
}

.theme-main-menu .top-header .right-widget {
    flex: 0 0 auto;
    min-width: 0;
}

.theme-main-menu .top-header .logo.tenant-logo-slot {
    --tenant-logo-effective-width: var(--tenant-logo-max-width, 200px);
    flex: 0 0 auto;
    align-self: center;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
    max-width: var(--tenant-logo-effective-width);
    position: relative;
    z-index: 3;
}

.theme-main-menu .top-header .logo.tenant-logo-slot > a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: var(--tenant-logo-effective-width);
    line-height: 0;
    overflow: visible;
}

.theme-main-menu .top-header .logo.tenant-logo-slot .tenant-logo-img {
    max-width: var(--tenant-logo-effective-width) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: left center;
    display: block;
}

/* Tablet — admin-controlled width via --tenant-logo-tablet-width (falls back to auto cap). */
@media (max-width: 991px) {
    .theme-main-menu .top-header,
    .theme-main-menu .top-header > .d-flex.align-items-center {
        height: 44px;
        min-height: 44px;
        max-height: 44px;
        gap: 8px;
    }

    .theme-main-menu .top-header .logo.tenant-logo-slot {
        --tenant-logo-effective-width: var(--tenant-logo-tablet-width, min(var(--tenant-logo-max-width, 200px), 38vw, 150px));
        flex: 0 1 auto;
        min-width: 0;
        height: 44px;
        max-width: min(var(--tenant-logo-effective-width), calc(100% - 168px));
    }

    .theme-main-menu .top-header .logo.tenant-logo-slot > a {
        max-width: 100%;
    }

    .theme-main-menu .top-header .logo.tenant-logo-slot .tenant-logo-img {
        max-width: 100% !important;
    }

    .theme-main-menu .top-header .right-widget {
        flex: 1 1 auto;
        max-width: calc(100% - min(var(--tenant-logo-effective-width), calc(100% - 168px)) - 8px);
    }
}

/* Phone — admin-controlled width via --tenant-logo-mobile-width (falls back to auto cap). */
@media (max-width: 575px) {
    .theme-main-menu .top-header,
    .theme-main-menu .top-header > .d-flex.align-items-center {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        gap: 6px;
    }

    .theme-main-menu .top-header .logo.tenant-logo-slot {
        --tenant-logo-effective-width: var(--tenant-logo-mobile-width, min(var(--tenant-logo-max-width, 200px), 34vw, 118px));
        height: 40px;
        max-width: min(var(--tenant-logo-effective-width), calc(100% - 132px));
    }

    .theme-main-menu .top-header .right-widget {
        max-width: calc(100% - min(var(--tenant-logo-effective-width), calc(100% - 132px)) - 6px);
        font-size: 11px !important;
    }

    .theme-main-menu .top-header .right-widget .jobs-header-link {
        padding: 0.25rem 0.4rem;
        font-size: 0;
        gap: 0;
    }

    .theme-main-menu .top-header .right-widget .jobs-header-link i {
        font-size: 14px;
        margin: 0 !important;
    }

    .theme-main-menu .top-header .right-widget #globalCurrencySelector {
        max-width: 72px;
        font-size: 10px !important;
        padding: 1px 2px !important;
    }
}
