/* BPP PROPERTY SEARCH GRID — EMPTY FACTS GLOBAL V1.9
   Global /properties GRID fix for every pagination/filter page.

   When a card has no bed/bath/area facts, JS removes the empty meta node and
   marks the card with .bpp-grid-no-facts-v19. These rules then remove any
   remaining height/margin reservation from the card/body/identity.

   Scope:
   - property-search GRID only
   - mobile + tablet + desktop
   - every pagination/filter/search result page
   - LIST view untouched
*/

html body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466.bpp-grid-no-facts-v19 {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: start !important;
}

html body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466.bpp-grid-no-facts-v19
> .bpp-search-owner-card-v466__body {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

html body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466.bpp-grid-no-facts-v19
.bpp-search-owner-card-v466__identity {
    margin-top: 5px !important;
}

/* Defensive rule in case an empty meta node is reinserted by AJAX before JS
   processes the redraw. Whitespace text does not count as an element child. */
html body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466
.bpp-search-owner-card-v466__meta:not(:has(> span)) {
    display: none !important;
    visibility: hidden !important;
    flex: 0 0 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    height: 0 !important;
    min-block-size: 0 !important;
    max-block-size: 0 !important;
    block-size: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

/* Preserve the approved tight mobile rhythm after the empty row disappears. */
@media (max-width: 767px) {
    html.bpp-property-search-grid-mobile-v1
    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    article.bpp-search-owner-card-v466.bpp-grid-no-facts-v19
    .bpp-search-owner-card-v466__price,
    html.bpp-property-search-grid-mobile-v1
    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    article.bpp-search-owner-card-v466.bpp-grid-no-facts-v19
    .bpp-search-owner-card-v466__location,
    html.bpp-property-search-grid-mobile-v1
    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    article.bpp-search-owner-card-v466.bpp-grid-no-facts-v19
    .bpp-search-owner-card-v466__identity {
        margin-top: 5px !important;
    }
}
