/* ============================================================
   Favorites — CSS (Updated to match Client Design)
   ============================================================ */

/* ── Heart icon on property cards ──────────────────────────── */
.favorite-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.30);
    transition: background 0.2s;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.favorite-icon:hover,
.favorite-icon:focus {
    background: #fff;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.favorite-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.favorite-icon .e-far-heart path,
.favorite-icon svg path {
    fill: transparent;
    stroke: black !important;
    stroke-width: 20px;
    transition: fill 0.2s, stroke 0.2s;
}

.property-listing-card.is-favorited .favorite-icon {
    background: rgba(231, 76, 60, 0.15);
}

.property-listing-card.is-favorited .favorite-icon svg path,
.property-listing-card.is-favorited .favorite-icon .e-far-heart path {
    fill: #e74c3c;
    stroke: #e74c3c;
    stroke-width: 0;
}

/* ── Header trigger button ──────────────────────────────────── */
.immo-fav-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.immo-fav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 24px;
    transition: background 0.2s;
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.immo-fav-trigger:hover,
.immo-fav-trigger:focus {
    background: rgba(52, 152, 219, 0.10);
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.immo-fav-trigger-icon {
    width: 22px;
    height: 22px;
    fill: #e74c3c;
    display: block;
}

.immo-fav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #3498db;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
    transition: transform 0.15s;
}


/* ── Overlay & modal ────────────────────────────────────────── */
.immo-fav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    z-index: 999999;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 24px;
    overflow-y: auto;
}

.immo-fav-overlay.active {
    display: flex;
}

body.immo-fav-open {
    overflow: hidden;
}

.immo-fav-modal {
    background: #fff;
    border-radius: 4px; /* Updated for client design */
    width: 100%;
    max-width: 900px; /* Updated for wider layout */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    animation: immoFavSlideIn 0.22s ease;
    margin-bottom: 40px;
    overflow: hidden;
}

@keyframes immoFavSlideIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Modal header ───────────────────────────────────────────── */
.immo-fav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.immo-fav-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    font-family: 'Poppins', sans-serif;
}

.immo-fav-close {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    border: none;
    background: #f3f4f6;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.immo-fav-close:hover,
.immo-fav-close:focus {
    background: #e5e7eb;
    color: #111827;
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ── Property list ──────────────────────────────────────────── */
.immo-fav-list {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding: 0;
}

/* ── Individual property item ───────────────────────────────── */
.immo-fav-item {
    display: flex;
    align-items: flex-start;
    gap: 25px; /* Updated for client design */
    padding: 25px 30px; /* Updated for client design */
    border-bottom: 1px solid #eaeaea; /* Updated for client design */
    transition: background 0.15s;
}

.immo-fav-item:last-child {
    border-bottom: none;
}

.immo-fav-item:hover {
    background: #f8fafc;
}

/* Thumbnail */
.immo-fav-thumb {
    width: 280px; /* Updated for client design */
    height: 180px; /* Updated for client design */
    border-radius: 0; /* Updated for client design */
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
}

.immo-fav-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.immo-fav-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
}

/* Property info */
.immo-fav-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.immo-fav-item-title {
    font-size: 18px; /* Updated for client design */
    font-weight: 400; 
    color: #333;
    font-family: 'Poppins', sans-serif;
    margin: 0 0 8px 0;
}

.immo-fav-item-loc {
    display: none; /* Merged into title in JS now */
}

.immo-fav-meta {
    font-size: 14px;
    color: #666;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 15px;
}

/* Bed / bath / built icons in the popup meta line — same icons as the
   listing cards, sized to sit inline with the 14px meta text. */
.immo-fav-meta .immo-fav-ico {
    display: inline-flex;
    vertical-align: -2px;
}
.immo-fav-meta .immo-fav-ico svg {
    width: 15px;
    height: 15px;
    fill: #3582B5;
}

.immo-fav-price-black {
    font-size: 15px;
    font-weight: 700;
    color: #000;
}

.immo-fav-desc {
    font-size: 14px;
    color: #555;
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Action buttons column */
.immo-fav-actions {
    display: flex;
    flex-direction: row; /* Updated for client design */
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.immo-fav-view-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px; /* Updated for client design */
    background-image: linear-gradient(180deg, #3583B6 0%, #35A7D6 100%); 
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    transition: background 0.2s;
    white-space: nowrap;
}

.immo-fav-view-btn:hover,
.immo-fav-view-btn:focus {
    background-image: linear-gradient(180deg, #3583B6 0%, #35A7D6 100%);
    color: #fff;
    outline-offset: 2px;
}

.immo-fav-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 4px; /* Updated for client design */
    border: none;
    background: #e74c3c; /* Updated for client design */
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s;
    white-space: nowrap;
}

.immo-fav-remove-btn svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    flex-shrink: 0;
}

.immo-fav-remove-btn:hover,
.immo-fav-remove-btn:focus {
    background: #c0392b;
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* ── Empty / loading / error states ────────────────────────── */
.immo-fav-empty,
.immo-fav-loading,
.immo-fav-error {
    text-align: center;
    padding: 40px 24px;
    color: #6b7280;
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    line-height: 1.6;
}

.immo-fav-empty svg {
    width: 48px;
    height: 48px;
    fill: #cbd5e1;
    margin: 0 auto 16px;
    display: block;
}

.immo-fav-empty p {
    margin: 0 0 6px;
}

.immo-fav-error {
    color: #991b1b;
}
h2.immo-fav-title span {
    font-weight: 400;
    color: #7d7d7d;
    font-size: 15px;
}

/* ── Mobile breakpoint ──────────────────────────────────────── */
@media (max-width: 768px) {
    .immo-fav-item {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .immo-fav-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .immo-fav-actions {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .immo-fav-view-btn,
    .immo-fav-remove-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .immo-fav-overlay {
        padding: 16px 8px;
        align-items: flex-end;
    }

    .immo-fav-modal {
        border-radius: 4px 4px 0 0;
        margin-bottom: 0;
    }
}