/* ==========================================================================
   BPP PROPERTY SEARCH GRID — METADATA + CONTACT ROW V2.1

   Confirmed structure:
   - location ........ days ago
   - role ............ Active Listing / Verified Listing
   - name + verified tick
   - Call | WhatsApp | Chat on ONE row

   Metadata is copied from the existing LIST renderer for the SAME property.
   Search GRID only. LIST itself is not redesigned.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. LOCATION + DAYS AGO
   -------------------------------------------------------------------------- */

body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466]
.bpp-search-owner-card-v466__location.bpp-grid-location-meta-v21 {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466
.bpp-search-owner-card-v466__location.bpp-grid-location-meta-v21
> span:not(.bpp-grid-days-v21) {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-days-v21 {
    margin-left: auto !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    color: #7a8982 !important;
    font-size: 11px !important;
    line-height: 16px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-days-v21 svg {
    width: 13px !important;
    height: 13px !important;
    flex: 0 0 13px !important;
}

/* --------------------------------------------------------------------------
   2. LISTER ROLE + LISTING STATUS / NAME + VERIFIED CHECK
   -------------------------------------------------------------------------- */

body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466
.bpp-search-owner-card-v466__identity-copy.bpp-grid-identity-copy-v21 {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    gap: 3px !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-role-row-v21 {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-role-row-v21
.bpp-search-owner-card-v466__role {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-listing-status-v21 {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    min-height: 22px !important;
    padding: 3px 7px !important;
    margin: 0 !important;
    border: 1px solid #d9eee3 !important;
    border-radius: 999px !important;
    background: #edf9f2 !important;
    color: #087847 !important;
    font-size: 9.5px !important;
    line-height: 14px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-listing-status-v21.is-active {
    background: #e7f8ef !important;
    border-color: #ccebd9 !important;
    color: #06713f !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-listing-status-v21 svg {
    width: 12px !important;
    height: 12px !important;
    flex: 0 0 12px !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-name-row-v21 {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    width: 100% !important;
    gap: 5px !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-name-row-v21
.bpp-search-owner-card-v466__name {
    min-width: 0 !important;
    flex: 0 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-owner-verified-v21 {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: #1597f2 !important;
    color: #fff !important;
    vertical-align: middle !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
.bpp-grid-owner-verified-v21 svg {
    width: 12px !important;
    height: 12px !important;
    display: block !important;
    stroke: currentColor !important;
    stroke-width: 3 !important;
    fill: none !important;
}

/* If the old grid badge exists, V2.1 hides it only after the exact list tick
   has been copied beside the name. */
body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466.bpp-grid-has-list-check-v21
.bpp-search-owner-card-v466__badge {
    display: none !important;
}

/* --------------------------------------------------------------------------
   3. CALL | WHATSAPP | CHAT — ONE ROW
   -------------------------------------------------------------------------- */

body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466]
.property-contact-actions.property-contact-actions--card {
    display: grid !important;
    grid-template-columns:
        repeat(var(--bpp-contact-action-count, 3), minmax(0, 1fr)) !important;
    grid-auto-flow: column !important;
    width: 100% !important;
    gap: 8px !important;
    align-items: stretch !important;
}

body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466
.property-contact-actions--card
.property-contact-action {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
}

/* Keep text compact enough for three desktop columns. */
body.rpg-properties-exact-v2
.rpgp2-property-grid
article.bpp-search-owner-card-v466
.property-contact-actions--card
.property-contact-action > span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Existing mobile requirement remains: icon-only contacts, but all 3 stay
   on one line. */
@media (max-width: 767px) {
    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    article.bpp-search-owner-card-v466
    .property-contact-actions.property-contact-actions--card {
        gap: 5px !important;
        grid-template-columns:
            repeat(var(--bpp-contact-action-count, 3), minmax(0, 1fr)) !important;
    }

    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    article.bpp-search-owner-card-v466
    .property-contact-actions--card
    .property-contact-action {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    .bpp-grid-listing-status-v21 {
        min-height: 19px !important;
        padding: 2px 5px !important;
        font-size: 8px !important;
        line-height: 12px !important;
        gap: 3px !important;
    }

    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    .bpp-grid-listing-status-v21 svg {
        width: 10px !important;
        height: 10px !important;
        flex-basis: 10px !important;
    }

    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    .bpp-grid-days-v21 {
        font-size: 9px !important;
        line-height: 13px !important;
        gap: 3px !important;
    }

    body.rpg-properties-exact-v2
    .rpgp2-property-grid
    .bpp-grid-days-v21 svg {
        width: 11px !important;
        height: 11px !important;
        flex-basis: 11px !important;
    }
}

/* BPP_PROPERTY_SEARCH_CARD_ALIGNMENT_CANONICAL_V213_START */
/* Uses only the DOM already produced by the existing metadata runtimes. */
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-search-owner-card-v466__location {
    display:flex !important; align-items:center !important; gap:7px !important; min-width:0 !important; flex-wrap:nowrap !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-search-owner-card-v466__location > svg { flex:0 0 auto !important; }
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-search-owner-card-v466__location > span:not(.bpp-grid-days-v21):not(.bpp-universal-card-age-v1) {
    min-width:0 !important; overflow:hidden !important; text-overflow:ellipsis !important; white-space:nowrap !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-days-v21,
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-age-v1 {
    margin-left:auto !important; flex:0 0 auto !important; white-space:nowrap !important; display:inline-flex !important; align-items:center !important; gap:5px !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-role-row-v21,
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-role-row-v1 {
    width:100% !important; min-width:0 !important; display:flex !important; align-items:center !important; gap:7px !important; flex-wrap:nowrap !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-role-row-v21 .bpp-search-owner-card-v466__role,
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-role-row-v1 .bpp-search-owner-card-v466__role {
    min-width:0 !important; overflow:hidden !important; text-overflow:ellipsis !important; white-space:nowrap !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-listing-status-v21,
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-listing-status-v1 {
    margin-left:auto !important; flex:0 0 auto !important; white-space:nowrap !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-name-row-v21,
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-name-row-v1 {
    width:100% !important; min-width:0 !important; display:flex !important; align-items:center !important; justify-content:flex-start !important; gap:5px !important; flex-wrap:nowrap !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-name-row-v21 .bpp-search-owner-card-v466__name,
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-name-row-v1 .bpp-search-owner-card-v466__name {
    min-width:0 !important; overflow:hidden !important; text-overflow:ellipsis !important; white-space:nowrap !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-name-row-v21:has(.bpp-grid-owner-verified-v21) .bpp-search-owner-card-v466__badge,
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-name-row-v1:has(.bpp-grid-owner-verified-v21) .bpp-search-owner-card-v466__badge {
    display:none !important;
}
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-owner-verified-v21,
body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-search-owner-card-v466__badge {
    flex:0 0 auto !important; margin:0 !important; display:inline-flex !important; align-items:center !important; justify-content:center !important;
}
@media (max-width:767.98px) {
    body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-days-v21,
    body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-age-v1 { font-size:12px !important; }
    body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-grid-listing-status-v21,
    body.rpg-properties-exact-v2 .rpgp2-property-grid article.bpp-search-owner-card-v466[data-bpp-search-owner-card-v466] .bpp-universal-card-listing-status-v1 { max-width:52% !important; overflow:hidden !important; text-overflow:ellipsis !important; }
}
/* BPP_PROPERTY_SEARCH_CARD_ALIGNMENT_CANONICAL_V213_END */
