/* Performance — ficha do imóvel (mobile-first) */

.page-imovel-detalhe .portal-img-desktop:not([src]) {
    background: #e8edf3;
    min-height: 12rem;
}

.page-imovel-detalhe .detail-image-main .detail-main-img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.page-imovel-detalhe .detail-thumb {
    width: 4.5rem;
    height: 3.25rem;
    object-fit: cover;
    flex-shrink: 0;
}

.portal-defer-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
}

#portal-similar-slot {
    content-visibility: auto;
    contain-intrinsic-size: auto 360px;
    min-height: 1px;
}

.portal-similar-slot--loading {
    min-height: 6rem;
}

/* Lightbox nativo (<dialog>) */
.imovel-photo-lightbox {
    border: none;
    padding: 0;
    margin: 0;
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: transparent;
    overflow: hidden;
}

.imovel-photo-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.94);
}

.imovel-photo-lightbox .imovel-photo-lightbox-sheet {
    background: linear-gradient(165deg, #121820 0%, #070a0e 55%, #030508 100%);
    color: #fff;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

body.imovel-lightbox-open .imovel-detail-wa-sticky {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

.btn-whatsapp-cta .portal-wa-icon {
    flex-shrink: 0;
    vertical-align: -0.2em;
}

.btn-whatsapp-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-portal-contact-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-portal-contact-form .portal-mail-icon {
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .page-imovel-detalhe .detail-mobile {
        display: flex;
        flex-direction: column;
    }

    .page-imovel-detalhe .detail-layout-sidebar {
        order: 2;
    }

    .page-imovel-detalhe .detail-layout-gallery {
        order: 1;
    }

    .page-imovel-detalhe .detail-layout-after-sidebar {
        order: 3;
    }
}
