/* Senfesh approved brand assets. Keep this file after the front-shell CSS. */
.senfesh-market-header__inner {
    width: min(calc(100% - 32px), 1760px);
    grid-template-columns: auto auto minmax(360px, 1fr) auto;
}

/* Advertisement filters: override light-theme literal colors in dark mode. */
html[data-theme="dark"] body.senfesh-front-shell
:is(
    .market-product-filter__head strong,
    .market-product-filter__form label,
    .market-product-filter__check,
    .market-switch-filter__label,
    .market-dynamic-filter-section__head strong,
    .market-dynamic-filter-field > label
) {
    color: var(--tp-text) !important;
}

html[data-theme="dark"] body.senfesh-front-shell
:is(
    .market-product-filter__note,
    .market-price-filter__title > span,
    .market-price-filter__row > span,
    .market-followed-businesses-filter__note,
    .market-dynamic-filter-section__head > span,
    .market-industry-category-group__title
) {
    color: var(--tp-muted) !important;
}

html[data-theme="dark"] body.senfesh-front-shell
.market-product-filter__head > span:not(.is-hidden) {
    color: var(--tp-accent) !important;
    background: rgba(255, 160, 0, .10) !important;
}

.senfesh-market-header__brand-lockup {
    display: inline-flex;
    min-width: 300px;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.senfesh-market-header__brand {
    display: inline-flex;
    width: 104px;
    height: 38px;
    flex: 0 0 104px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
}

.senfesh-market-header__brand:focus-visible {
    outline: 2px solid var(--senfesh-primary);
    outline-offset: 3px;
}

.senfesh-market-header__brand-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 32px;
    object-fit: contain;
}

.senfesh-market-header__tagline {
    color: var(--senfesh-text);
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.senfesh-market-header__tagline--mobile {
    display: none;
}

@media (max-width: 1199px) and (min-width: 992px) {
    .senfesh-market-header__inner {
        grid-template-columns: auto auto minmax(210px, 1fr) auto;
        gap: 7px;
    }

    .senfesh-market-header__brand {
        width: 88px;
        flex-basis: 88px;
    }

    .senfesh-market-header__brand-lockup {
        min-width: 88px;
    }

    .senfesh-market-header__tagline--desktop,
    .senfesh-market-header__tagline--mobile {
        display: none;
    }
}

/* A compact brand row sits above the existing mobile search row. */
@media (max-width: 991px) {
    .senfesh-market-header__inner {
        display: block;
        width: 100%;
    }

    .senfesh-market-header__brand-lockup {
        display: flex;
        min-height: 29px;
        min-width: 0;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: -2px 2px 6px;
        padding-inline: 2px;
    }

    .senfesh-market-header__brand {
        display: inline-flex;
        width: 82px;
        height: 27px;
        flex-basis: 82px;
        justify-content: flex-start;
    }

    .senfesh-market-header__brand-image {
        max-height: 23px;
    }

    .senfesh-market-header__tagline--desktop {
        display: none;
    }

    .senfesh-market-header__tagline--mobile {
        display: block;
        overflow: hidden;
        min-width: 0;
        flex: 0 1 auto;
        color: var(--senfesh-text);
        font-size: .88rem;
        font-weight: 850;
        line-height: 1.2;
        text-align: right;
        text-overflow: ellipsis;
    }

    /*
       Make the scroll viewport itself begin below the complete fixed header.
       A padding-only offset would still let scrolled advertisements travel
       underneath the toolbar.
    */
    html body.senfesh-front-shell.mobile-advertisement-index
    > main.senfesh-main-content {
        inset:
            var(--senfesh-mobile-fixed-primary-height, 144px)
            0
            0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding-top: 0 !important;
    }

    /*
       JavaScript moves the existing toolbar into the fixed header immediately
       after the mobile search row. Its original buttons and handlers remain.
    */
    html body.senfesh-front-shell.mobile-advertisement-index
    > .senfesh-market-header:not(.d-none)
    .mobile-market-tools.senfesh-market-header__mobile-tools {
        position: static !important;
        inset: auto !important;
        display: grid !important;
        box-sizing: border-box !important;
        width: calc(100% + 20px) !important;
        max-width: none !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        margin: 0 -10px -9px !important;
        padding: 0 !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: 44px !important;
        column-gap: 0 !important;
        row-gap: 0 !important;
        overflow: hidden !important;
    }

    html body.senfesh-front-shell.mobile-advertisement-index
    > .senfesh-market-header:not(.d-none)
    .mobile-market-tools.senfesh-market-header__mobile-tools
    > .mobile-market-tools__button {
        display: inline-flex !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        align-items: center !important;
        justify-content: center !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}
