/* Rentals browse cards — loads AFTER style.min.css so overrides win.
   Fixes: stretched h-100/400px tiles, 40% image band gaps, missing View Details stroke. */

body.rentals-page.categories-page .listing-card,
body.rentals-page.categories-page .listing-card.h-100 {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Image link must not absorb leftover flex space */
body.rentals-page.categories-page .listing-card > a:has(img.listing-image),
body.rentals-page.categories-page .listing-card > a:has(.listing-image) {
    flex: 0 0 auto !important;
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
}

body.rentals-page.categories-page .listing-card .listing-image,
body.rentals-page.categories-page .listing-card img.listing-image,
body.rentals-page.categories-page .listing-image {
    width: 100% !important;
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    aspect-ratio: unset !important;
    object-fit: cover !important;
    object-position: center !important;
    flex: none !important;
    display: block !important;
    margin-bottom: 0.5rem !important;
}

body.rentals-page.categories-page .listing-card .listing-user-row {
    flex: 0 0 auto !important;
    margin-top: 0 !important;
}

body.rentals-page.categories-page .listing-card .listing-title {
    flex: 0 0 auto !important;
    min-height: 0 !important;
}

body.rentals-page.categories-page .listing-card .listing-description {
    flex: 0 1 auto !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}

body.rentals-page.categories-page .listing-card .listing-price {
    flex: 0 0 auto !important;
}

body.rentals-page.categories-page .listing-card .px-3,
body.rentals-page.categories-page .listing-card .px-3.pb-3 {
    margin-top: 0.5rem !important;
    padding-top: 0.5rem !important;
    flex: 0 0 auto !important;
}

/* Red stroke on View Details (white fill, red text + border) */
body.rentals-page.categories-page .listing-card .btn-primary,
body.rentals-page.categories-page .listing-card a.btn.btn-primary,
body.buysell-page.categories-page .listing-card .btn-primary,
body.buysell-page.categories-page .listing-card a.btn.btn-primary {
    background: #fff !important;
    color: #ff3c3c !important;
    border: 1px solid #ff3c3c !important;
    box-shadow: none !important;
    border-radius: 8px !important;
}

body.rentals-page.categories-page .listing-card .btn-primary:hover,
body.rentals-page.categories-page .listing-card .btn-primary:focus,
body.rentals-page.categories-page .listing-card .btn-primary:active,
body.rentals-page.categories-page .listing-card a.btn.btn-primary:hover,
body.rentals-page.categories-page .listing-card a.btn.btn-primary:focus,
body.rentals-page.categories-page .listing-card a.btn.btn-primary:active,
body.buysell-page.categories-page .listing-card .btn-primary:hover,
body.buysell-page.categories-page .listing-card .btn-primary:focus,
body.buysell-page.categories-page .listing-card .btn-primary:active,
body.buysell-page.categories-page .listing-card a.btn.btn-primary:hover,
body.buysell-page.categories-page .listing-card a.btn.btn-primary:focus,
body.buysell-page.categories-page .listing-card a.btn.btn-primary:active {
    background: #ff3c3c !important;
    color: #fff !important;
    border-color: #ff3c3c !important;
    box-shadow: none !important;
}
