/* GRID */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

/* CARD */
.listing-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* prevents text overflow issues in grid */
}

/* IMAGE: force same size */
.listing-card-image {
    display: block;
    width: 100%;
}

.listing-card-image img {
    width: 100%;
    height: 190px;
    /* ✅ consistent height */
    object-fit: cover;
    /* ✅ crops nicely */
    display: block;
}

/* Placeholder */
.img-placeholder {
    width: 100%;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    color: #667085;
    border-bottom: 1px solid #e5e7eb;
}

/* BODY */
.listing-card-body {
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* TEXT: stop overlap */
.listing-card-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* ✅ max 2 lines */
    -webkit-box-orient: vertical;
}

.listing-card-address {
    color: #667085;
    font-size: 13px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* ✅ keep one line */
}

.listing-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #374151;
}

.price {
    font-weight: 800;
    font-size: 15px;
}

.dot {
    color: #9ca3af;
}

/* ACTIONS pinned to bottom */
.listing-actions {
    margin-top: auto;
    /* ✅ pushes buttons down */
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid transparent;
}

/* ✅ EDIT button green */
.btn-edit {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.btn-edit:hover {
    filter: brightness(0.95);
}

/* Delete red */
.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(0.95);
}

/* Responsive */
@media (max-width: 950px) {
    .listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .listing-grid {
        grid-template-columns: 1fr;
    }

    .listing-card-image img,
    .img-placeholder {
        height: 170px;
    }
}
.badge {
    display: inline-flex;
    /* key */
    align-items: center;
    width: fit-content;
    /* key */
    max-width: 100%;
    white-space: nowrap;
    /* keep on one line */
}

/* If your "top row" uses flex, prevent stretching */
.listing-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.listing-top .badge {
    flex: 0 0 auto;
    /* key */
}