/* ==========================================================================
   Shared Listing Cards (ads_grid.php)
   Purpose:
   - Provide consistent styling for the shared grid partial `partials/ads_grid.php`
   - Used by: listing.php, search.php, location.php, and any page that includes ads_grid.php
   Notes:
   - Scoped to `.listing-item-col` so we don't unintentionally restyle homepage cards
     that also use `.listing-card` with different markup.
   ========================================================================== */

.listing-item-col .listing-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    position: relative;
}

.listing-item-col .listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.10);
    border-color: #667eea;
}

.listing-item-col .listing-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background-color: #e2e8f0;
}

.listing-item-col .listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.listing-item-col .listing-card:hover .listing-image img {
    transform: scale(1.05);
}

.listing-item-col .listing-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 12;
}

.listing-item-col .listing-card:hover .listing-overlay {
    opacity: 1;
}

/* On touch devices, keep actions visible (no hover). */
@media (hover: none) {
    .listing-item-col .listing-overlay {
        opacity: 1;
    }
}

/* Favorite button (used inside listing-overlay) */
.listing-item-col .fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.listing-item-col .fav-btn i {
    color: #666;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.listing-item-col .fav-btn:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    transform: scale(1.08);
}

.listing-item-col .fav-btn:hover i {
    color: #1d283a;
}

.listing-item-col .fav-btn.active {
    background: #f59e0b;
    border-color: #f59e0b;
}

.listing-item-col .fav-btn.active i {
    color: #1d283a;
}

.listing-item-col .listing-content {
    padding: 1rem;
}

.listing-item-col .listing-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.listing-item-col .listing-title a {
    color: #212529;
    text-decoration: none;
    display: block;
}

.listing-item-col .listing-title a:hover {
    color: #667eea;
}

.listing-item-col .listing-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #198754;
    margin-bottom: 0.6rem;
}

.listing-item-col .listing-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 0.6rem;
    color: #475569;
    font-size: 0.82rem;
}

.listing-item-col .listing-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: #6c757d;
}

.listing-item-col .listing-meta > a,
.listing-item-col .listing-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.listing-item-col .listing-meta i {
    font-size: 0.9rem;
    width: 16px;
}

/* Responsive tweaks */
@media (max-width: 991px) {
    .listing-item-col .listing-image {
        height: 150px;
    }
    .listing-item-col .listing-content {
        padding: 0.85rem;
    }
    .listing-item-col .listing-title {
        font-size: 0.95rem;
    }
    .listing-item-col .listing-price {
        font-size: 1.1rem;
    }
}

@media (max-width: 575.98px) {
    .listing-item-col .listing-image {
        height: 126px;
    }
    .listing-item-col .listing-content {
        padding: 0.75rem;
    }
}


