/* BPP Developer Profile V7.1
   Exact desktop header bridge based on the live rendered markup.

   Live desktop header:
   .top-header.rpg-market-topbar
   #header.main-header.rpg-market-header.fixed-header

   The global sticky assets are already loaded by the theme. This file does not
   create or replace a header. It only prevents the Developer page from allowing
   the main white header to occupy the same top offset as the green utility bar.
*/

@media (min-width:768px){

    /* Developer page only. */
    body:has(.bpp54-developer) .top-header.rpg-market-topbar{
        position:sticky!important;
        top:0!important;
        left:auto!important;
        right:auto!important;
        bottom:auto!important;
        z-index:5100!important;

        width:100%!important;
        margin:0!important;
        transform:none!important;
        translate:none!important;
        visibility:visible!important;
        opacity:1!important;
    }

    body:has(.bpp54-developer) #header.main-header.rpg-market-header{
        position:sticky!important;
        top:var(--bpp71-developer-topbar-height, 40px)!important;
        left:auto!important;
        right:auto!important;
        bottom:auto!important;
        z-index:5090!important;

        width:100%!important;
        margin:0!important;
        transform:none!important;
        translate:none!important;
        visibility:visible!important;
        opacity:1!important;
        background:#fff!important;
    }

    /* The actual header row must remain in its own normal height. */
    body:has(.bpp54-developer)
    #header.main-header.rpg-market-header
    .header-lower.rpg-market-header__lower{
        position:relative!important;
        top:auto!important;
        right:auto!important;
        bottom:auto!important;
        left:auto!important;
        transform:none!important;
        translate:none!important;
        margin:0!important;
    }

    /* Prevent a containing block from defeating sticky positioning. */
    body:has(.bpp54-developer) #wrapper,
    body:has(.bpp54-developer) #wrapper > main{
        overflow:visible!important;
    }

    /* Remove only old mobile-header placeholders if a previous resize left one. */
    body:has(.bpp54-developer) .bpp65-global-header-placeholder,
    body:has(.bpp54-developer) .bpp68-global-header-placeholder,
    body:has(.bpp54-developer) .bpp69-global-header-placeholder,
    body:has(.bpp54-developer) .bpp70-global-header-placeholder,
    body:has(.bpp54-developer) .bpp71-global-header-placeholder{
        display:none!important;
        height:0!important;
        min-height:0!important;
        margin:0!important;
        padding:0!important;
    }

    /* Mobile bottom fallback never appears on desktop. */
    body:has(.bpp54-developer)
    .rpgx-mobile-bottom.rpgp-mobile-bottom[data-bpp68-global-bottom-fallback]{
        display:none!important;
    }
}

/* Mobile behavior remains isolated to mobile. */
@media (max-width:767px){
    body > .rpg-gmh1[data-rpg-gmh1-header]{
        position:fixed!important;
        top:max(8px,env(safe-area-inset-top,0px))!important;
        left:8px!important;
        right:8px!important;
        bottom:auto!important;
        z-index:5000!important;
        width:auto!important;
        max-width:none!important;
        margin:0!important;
        transform:none!important;
        translate:none!important;
        opacity:1!important;
        visibility:visible!important;
        pointer-events:auto!important;
    }

    .bpp71-global-header-placeholder{
        display:block!important;
        width:100%!important;
        height:var(--bpp71-mobile-header-layout-height,72px)!important;
        min-height:var(--bpp71-mobile-header-layout-height,72px)!important;
        margin:0!important;
        padding:0!important;
        border:0!important;
        background:transparent!important;
    }

    body > .rpgx-mobile-bottom.rpgp-mobile-bottom{
        position:fixed!important;
        left:8px!important;
        right:8px!important;
        bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
        top:auto!important;
        z-index:4900!important;
        width:auto!important;
        max-width:none!important;
        margin:0!important;
        transform:none!important;
        translate:none!important;
        opacity:1!important;
        visibility:visible!important;
        pointer-events:auto!important;
    }

    html body:has(.bpp54-developer){
        padding-top:0!important;
        margin-top:0!important;
        padding-bottom:96px!important;
    }

    .bpp54-developer .bpp54-tabs-shell{
        position:sticky!important;
        top:calc(
            max(8px,env(safe-area-inset-top,0px))
            + var(--bpp71-mobile-header-visual-height,56px)
            + 8px
        )!important;
        z-index:3500!important;
    }

    .bpp54-developer .bpp54-actions,
    .bpp54-developer .bpp54-feature-grid,
    .bpp54-developer .bpp71-contact-actions,
    .bpp54-developer .bpp57-available-units-overview .bpp54-property-grid{
        display:grid!important;
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
        width:100%!important;
    }

    .bpp54-developer .bpp54-actions > *:nth-child(3),
    .bpp54-developer .bpp71-contact-actions > *:nth-child(3){
        grid-column:1 / -1!important;
    }

    .bpp54-developer #featured-developments .bpp54-development-grid{
        display:grid!important;
        grid-template-columns:minmax(0,1fr)!important;
        gap:11px!important;
    }

    footer.rpg-market-footer{
        padding-bottom:104px!important;
    }

    .rpg-gmb3{
        display:none!important;
    }
}

/* ============================================================
   BPP_DEVELOPER_PREHEADER_GAP_V76
   Keep correction isolated from mobile.
   ============================================================ */

@media (min-width:768px){

    body:has(.bpp54-developer){
        margin-top:0!important;
    }

    body:has(.bpp54-developer)
    .top-header.rpg-market-topbar[data-bpp-v76-gap]{
        position:sticky!important;
        top:0!important;
    }

}

