/* Single brand logo container — replaces default Magento store logo when active */

body.utility-brand-logo-active .page-header .logo {
    display: none !important;
}

body.utility-brand-logo-active .page-header .header.content {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
}

body.utility-brand-logo-active .utility-provider-brand-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: var(--utility-logo-width, 350px);
    height: var(--utility-logo-height, 100px);
    margin: 0 auto 0 0;
    padding: 0;
    flex: 0 0 auto;
    order: 1;
}

body.utility-brand-logo-active .utility-provider-brand-logo:empty {
    display: none;
    width: 0;
    height: 0;
    margin: 0;
}

body.utility-brand-logo-active .utility-provider-brand-logo__link {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 100%;
}

body.utility-brand-logo-active .utility-provider-brand-logo__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Push search and cart to the right edge of the header row */
body.utility-brand-logo-active .page-header .header.content>.block-search {
    margin-left: auto;
    order: 2;
}

body.utility-brand-logo-active .page-header .header.content>.minicart-wrapper {
    order: 3;
}

@media screen and (min-width: 768px) {
   
    body.utility-brand-logo-active .utility-provider-brand-logo {
        margin-left: 0;
    }
}

@media screen and (max-width: 767px) {
    body.utility-brand-logo-active .page-header {
        position: relative;
        background: #fff;
        border-bottom: none;
    }

    body.utility-brand-logo-active .page-header .header.content {
        position: static;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 0;
        width: 100%;
        min-height: 60px;
        height: auto;
        margin: 0;
        padding: 12px 16px;
        box-sizing: border-box;
        overflow: visible;
        background: #fff;
        border-bottom: 1px solid #e5e5e5;
    }

    /* Reserve space for the expanded search row */
    
    body.utility-brand-logo-active .page-header .header.content > .logo {
        display: none !important;
        flex: 0 0 0;
        width: 0;
        height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        order: 99;
    }

    /* Lockup logo — left aligned */
    body.utility-brand-logo-active .utility-provider-brand-logo {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: calc(100% - 150px);
        height: auto;
        min-height: 0;
        max-height: 48px;
        margin: 0;
        padding: 0;
        position: relative;
        z-index: 1;
        overflow: hidden;
    }

    body.utility-brand-logo-active .utility-provider-brand-logo__link {
        width: 100%;
    }

    body.utility-brand-logo-active .utility-provider-brand-logo__img {
        object-fit: contain;
        object-position: left center;
    }

    /* Hide desktop search on mobile */
    body.utility-brand-logo-active .page-header .header.content > .block-search.desktop {
        display: none !important;
    }

    /* Icon group — search, cart, hamburger on the right */
    body.utility-brand-logo-active .page-header .header.content > .block-search.mobile,
    body.utility-brand-logo-active .page-header .header.content > .block-search:not(.desktop):not(.mobile) {
        order: 2;
        flex: 0 0 auto;
        position: static;
        width: auto !important;
        height: auto;
        margin: 0 0 0 auto;
        padding: 0;
        z-index: 15;
    }

    body.utility-brand-logo-active .page-header .header.content > .minicart-wrapper {
        order: 3;
        flex: 0 0 auto;
        margin: 0;
        padding: 0;
        z-index: 15;
    }

    body.utility-brand-logo-active .page-header .header.content > .nav-toggle,
    body.utility-brand-logo-active .page-header .header.content [data-action="toggle-nav"] {
        order: 4;
        flex: 0 0 auto;
        position: relative;
        display: block !important;
        width: auto;
        min-width: 44px;
        min-height: 44px;
        margin: 0 0 0 12px;
        
        z-index: 15;
        cursor: pointer;
        pointer-events: auto;
        -webkit-tap-highlight-color: transparent;
    }

    /* Search — icon stays in header row */
    
    /* Keep search icon visible when expanded */
    body.utility-brand-logo-active .page-header .block-search.mobile .form.minisearch.active .label,
    body.utility-brand-logo-active .page-header .block-search.mobile .form.minisearch:focus-within .label,
    body.utility-brand-logo-active .page-header .block-search:not(.desktop):not(.mobile) .form.minisearch.active .label,
    body.utility-brand-logo-active .page-header .block-search:not(.desktop):not(.mobile) .form.minisearch:focus-within .label {
        display: inline-flex !important;
    }

    
    /* Hamburger menu icon */
    html:not(.nav-open) body.utility-brand-logo-active .page-header .header.content > .nav-toggle,
    html:not(.nav-open) body.utility-brand-logo-active .page-header .header.content > [data-action="toggle-nav"] {
        display: block !important;
    }

   body.utility-brand-logo-active .page-header .nav-toggle > span {
        border: 0;
        clip: rect(0, 0, 0, 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }
}
