/* Listing cards */
.listing-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: var(--bg);
}

.listing-card-click {
    cursor: pointer;
}

.listing-media {
    position: relative;
    overflow: hidden;
}

.listing-image {
    height: 240px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-image--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.listing-image--fallback .listing-label {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.listing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
}

.listing-overlay .btn {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

.overlay-action-btn {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.52rem 0.92rem;
    border-radius: 12px;
}

.listing-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.listing-photo-state {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid transparent;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    pointer-events: none;
}

.listing-photo-state i {
    font-size: 0.82rem;
}

.listing-photo-state--reserved {
    background: rgba(239, 68, 68, 0.86);
    border-color: rgba(248, 113, 113, 0.9);
    color: #fff;
}

.listing-photo-state--sold {
    background: rgba(234, 88, 12, 0.88);
    border-color: rgba(251, 146, 60, 0.92);
    color: #fff;
}

.listing-photo-state--rented {
    background: rgba(8, 145, 178, 0.86);
    border-color: rgba(34, 211, 238, 0.85);
    color: #fff;
}

.ui-badge {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.35rem 0.7rem;
}

.ui-badge--featured {
    background: rgba(255, 106, 0, 0.16);
    color: #c2410c;
    border-color: rgba(255, 106, 0, 0.48);
}

.ui-badge--available {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.55);
}

.ui-badge--project-status {
    background: rgba(59, 130, 246, 0.14);
    color: #1e3a8a;
    border-color: rgba(59, 130, 246, 0.34);
}

.ui-badge--reserved {
    background: rgba(239, 68, 68, 0.18);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.5);
}

.ui-badge--sold {
    background: rgba(234, 88, 12, 0.18);
    color: #c2410c;
    border-color: rgba(234, 88, 12, 0.45);
}

.ui-badge--rented {
    background: rgba(14, 116, 144, 0.16);
    color: #0f766e;
    border-color: rgba(14, 116, 144, 0.42);
}

.ui-badge--muted {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.4);
}

.listing-wishlist {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
}

.ui-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ui-icon-btn:hover {
    border-color: rgba(255, 106, 0, 0.6);
    color: var(--brand);
    box-shadow: 0 8px 18px rgba(255, 106, 0, 0.18);
}

.wishlist-btn.active,
.wishlist-btn:not(:disabled):not(.disabled).active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(255, 106, 0, 0.28);
}

.wishlist-btn.active:hover,
.wishlist-btn.active:focus,
.wishlist-btn:not(:disabled):not(.disabled).active:hover,
.wishlist-btn:not(:disabled):not(.disabled).active:focus {
    background: #e65f00;
    border-color: #e65f00;
    color: #fff;
}

.ui-tag {
    position: absolute;
    bottom: 16px;
    left: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2;
}

.ui-price-pill {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
    z-index: 2;
}

.ui-price-pill--dark {
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    border-color: rgba(15, 23, 42, 0.6);
}

@media (max-width: 768px) {
    .overlay-action-btn {
        font-size: 0.82rem;
        padding: 0.44rem 0.72rem;
        border-radius: 10px;
    }

    .listing-media .listing-badges {
        top: 10px;
        left: 10px;
        gap: 5px;
    }

    .listing-media .listing-badges .ui-badge {
        font-size: 0.68rem;
        padding: 0.24rem 0.5rem;
    }

    .listing-photo-state {
        top: 10px;
        left: 50%;
        font-size: 0.74rem;
        padding: 0.4rem 0.74rem;
        letter-spacing: 0.05em;
        max-width: calc(100% - 86px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .listing-media .ui-tag {
        left: 10px;
        bottom: 10px;
        font-size: 0.78rem;
        padding: 5px 11px;
        max-width: 44%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .listing-media .ui-price-pill {
        right: 10px;
        bottom: 10px;
        font-size: 0.82rem;
        padding: 6px 10px;
        max-width: 52%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.ui-card-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0 0 18px 18px;
}

.ui-card-price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

.ui-card-view {
    font-weight: 600;
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Project cards */
.project-card-click {
    cursor: pointer;
}

.project-card-link {
    text-decoration: none;
}

.project-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-media {
    position: relative;
    overflow: hidden;
}

.project-media img,
.project-media .card-img-top {
    height: 240px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.project-badges--right {
    left: auto;
    right: 16px;
}

.project-wishlist {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
}

.ui-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.4);
}

.ui-progress span {
    display: block;
    height: 100%;
    background: rgba(255, 106, 0, 0.7);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
}

.project-overlay .btn {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

.project-stats .stat-item {
    padding: 0.6rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.project-card .project-card-meta .col-6 {
    margin-bottom: 0.35rem;
}

.project-card .project-card-meta i {
    min-width: 14px;
}

@media (hover: hover) and (pointer: fine) {
    .listing-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
    }

    .listing-card:hover .listing-image {
        transform: scale(1.04);
    }

    .listing-card:hover .listing-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .project-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
    }

    .project-card:hover .project-media img,
    .project-card:hover .project-media .card-img-top {
        transform: scale(1.04);
    }

    .project-card:hover .project-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
    .listing-image {
        height: 220px;
    }

    .project-media img,
    .project-media .card-img-top {
        height: 220px;
    }
}
