.real-estate-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 15, 15, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeIn 0.3s ease-out;
}

/* PC Layout: Grid of Capsules */
.real-estate-popup {
    width: 100%;
    max-width: 1400px;
    height: 85vh;
    display: grid;
    grid-template-columns: 1fr 440px;
    grid-template-rows: 1fr auto;
    gap: 16px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

/* 1. Main Image Capsule */
.real-estate-popup__gallery {
    background: transparent;
    display: contents;
}

.real-estate-popup__main-image-wrap {
    grid-column: 1 / 2;
    grid-row: 1 / 2;

    background: #000;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    cursor: crosshair;
    /* Indicate zoom availability */
}

.real-estate-popup__main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease-out;
    /* Smooth zoom entry/exit */
    transform-origin: var(--zoom-origin, 50% 50%);
}

/* Zoom Effect on Hover */
.real-estate-popup__main-image-wrap:hover .real-estate-popup__main-image {
    transform: scale(2);
}

/* 2. Thumbnails Capsule */
.real-estate-popup__thumbnails {
    grid-column: 1 / 2;
    grid-row: 2 / 3;

    height: 140px;
    background: #1a1a1a;
    border-radius: 24px;
    padding: 16px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* 3. Sidebar (Info) Capsule */
.real-estate-popup__sidebar {
    grid-column: 2 / 3;
    grid-row: 1 / 3;

    background: #f5f5f5;
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    position: relative;
}

.real-estate-popup__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f0f0f;
    transition: background 0.2s;
    z-index: 10;
}

.real-estate-popup__close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.real-estate-popup__nav-btn {
    position: absolute;
    bottom: 24px;
    width: 64px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #0f0f0f;
    z-index: 2;
}

.real-estate-popup__nav-btn:hover {
    background: #ffffff;
    transform: scale(1.05);
}

.real-estate-popup__nav-btn--prev {
    right: 90px;
}

.real-estate-popup__nav-btn--next {
    right: 24px;
}

.real-estate-popup__thumbnail {
    flex: 0 0 160px;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    border: 2px solid transparent;
}

.real-estate-popup__thumbnail.is-active,
.real-estate-popup__thumbnail:hover {
    opacity: 1;
}

.real-estate-popup__thumbnail.is-active {
    border-color: #ffffff;
}

.real-estate-popup__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.real-estate-popup__location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #0f0f0f;
    margin-bottom: 24px;
}

.real-estate-popup__price {
    font-family: "Metal", sans-serif;
    font-size: 42px;
    line-height: 1;
    color: #0f0f0f;
    margin: 0;
    margin-bottom: 4px;
}

.real-estate-popup__price-sqm {
    font-size: 15px;
    color: #0f0f0f;
    opacity: 0.6;
    margin-bottom: 24px;
}

.real-estate-popup__type {
    font-size: 18px;
    color: #0f0f0f;
    margin-bottom: 32px;
}

.real-estate-popup__type span {
    margin-left: 12px;
    font-weight: 500;
}

.real-estate-popup__subtitle {
    font-family: "Metal", sans-serif;
    font-size: 20px;
    margin-bottom: 12px;
    color: #0f0f0f;
}

.real-estate-popup__desc {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 24px;
}

.real-estate-popup__features {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-bottom: 32px;
}

.real-estate-popup__feature {
    position: relative;
    padding-left: 16px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.real-estate-popup__feature::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    background: #0a5bff;
    border-radius: 50%;
}

.real-estate-popup__cta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: #0a5bff;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.real-estate-popup__cta:hover {
    background: #004ad9;
    color: #fff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .real-estate-popup-overlay {
        padding: 20px;
    }

    .real-estate-popup {
        display: flex;
        flex-direction: column;
        max-height: 95vh;
        border-radius: 20px;
        background: #f5f5f5;
        gap: 0;
        overflow: hidden;
    }

    .real-estate-popup__gallery {
        display: flex;
        flex-direction: column;
        height: 40vh;
        flex: none;
        background: #000;
    }

    .real-estate-popup__main-image-wrap {
        grid-column: auto;
        grid-row: auto;
        border-radius: 0;
        box-shadow: none;
        cursor: default;
        /* Disable crosshair on mobile */
        flex: 1;
        width: 100%;
    }

    .real-estate-popup__main-image-wrap:hover .real-estate-popup__main-image {
        transform: none;
        /* Disable zoom on mobile hover */
    }

    .real-estate-popup__sidebar {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
        flex: 1;
        padding: 24px;
        border-radius: 0;
        box-shadow: none;
    }

    .real-estate-popup__thumbnails {
        display: none;
    }
}