.map-imovel-leaflet-popup .leaflet-popup-content-wrapper {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid #dfe6ef;
    background: #f4f6f8;
    box-shadow: 0 22px 42px rgba(18, 28, 45, 0.26);
}

.map-imovel-leaflet-popup .leaflet-popup-content {
    margin: 0;
    width: 390px !important;
    min-width: 360px;
}

.map-imovel-leaflet-popup .leaflet-popup-tip-container {
    display: none;
}

.map-imovel-leaflet-popup .leaflet-popup-close-button {
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #6f747b;
    font-size: 26px;
    line-height: 26px;
    font-weight: 300;
    z-index: 3;
}

.map-imovel-leaflet-popup .leaflet-popup-close-button:hover {
    background: #edf1f5;
    color: #32363b;
}

.map-imovel-popup {
    max-height: min(78vh, 730px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #f4f6f8;
    color: #252b33;
}

.map-imovel-popup-toolbar {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 4rem 0.75rem 1.25rem;
    background: #f8fafc;
}

.map-imovel-popup-heading {
    margin: 0;
    color: #20242a;
    font-size: 1.12rem;
    line-height: 1;
    font-weight: 800;
}

.map-imovel-popup-heading-group {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.map-entorno-btn {
    min-height: 28px;
    border: 1px solid #b7cff4;
    border-radius: 999px;
    background: #eaf2ff;
    color: #174bab;
    padding: 0.2rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

.map-entorno-btn:hover,
.map-entorno-btn:focus-visible {
    border-color: #174bab;
    background: #dceaff;
    color: #0e3770;
}

.map-imovel-popup-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.25rem 0.6rem;
    border: 1px solid #cbd8e8;
    border-radius: 999px;
    background: #edf3fa;
    color: #263d5a;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.map-imovel-popup-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.map-imovel-popup-nav {
    width: 28px;
    height: 28px;
    border: 1px solid #b8c4d2;
    border-radius: 5px;
    background: #f8fafc;
    color: #637081;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.map-imovel-popup-nav:hover {
    border-color: #2b5ec8;
    background: #edf4ff;
    color: #174bab;
}

.map-imovel-popup-scroll {
    min-height: 0;
    overflow: auto;
    padding: 0 1rem 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: #8b929c transparent;
}

.map-imovel-popup-card {
    border: 1px solid #e0e6ed;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(24, 34, 48, 0.03);
    padding: 0.9rem 1rem;
}

.map-imovel-popup-card + .map-imovel-popup-card {
    margin-top: 0.8rem;
}

.map-imovel-popup-card-featured {
    border-color: #cfddf1;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0) 36%),
        linear-gradient(135deg, #eef5ff 0%, #dfeeff 100%);
}

.map-imovel-field + .map-imovel-field {
    margin-top: 0.54rem;
}

.map-imovel-field span,
.map-imovel-card-label,
.map-imovel-popup-grid span {
    display: block;
    color: #6f7782;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.map-imovel-field strong {
    display: block;
    margin-top: 0.18rem;
    color: #252b33;
    font-size: 1.22rem;
    line-height: 1.1;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.map-imovel-popup-chips {
    margin-top: 0.78rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.map-imovel-popup-chips span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    border-radius: 999px;
    border: 1px solid #c8d7ea;
    background: rgba(255, 255, 255, 0.58);
    color: #293340;
    padding: 0.24rem 0.72rem;
    font-size: 0.68rem;
    font-weight: 800;
}

.map-imovel-card-title {
    display: block;
    margin-top: 0.35rem;
    color: #252b33;
    font-size: 0.92rem;
    line-height: 1.22;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.map-imovel-popup-card p {
    margin: 0.34rem 0 0;
    color: #68707b;
    font-size: 0.8rem;
    line-height: 1.35;
}

.map-imovel-popup-grid {
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.64rem;
}

.map-imovel-popup-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.map-imovel-popup-grid div {
    min-width: 0;
    border: 1px solid #dbe8fb;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef6ff, #f7fbff);
    padding: 0.72rem 0.78rem;
}

.map-imovel-popup-grid .map-imovel-field-wide {
    grid-column: 1 / -1;
}

.map-imovel-popup-grid .map-imovel-field-highlight {
    border-color: #a9c8ff;
    background: linear-gradient(135deg, #e3efff, #f1f7ff);
}

.map-imovel-popup-grid .map-imovel-field-highlight strong {
    font-size: 1rem;
}

.map-imovel-popup-grid strong {
    display: block;
    margin-top: 0.34rem;
    color: #242a31;
    font-size: 0.9rem;
    line-height: 1.16;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.map-imovel-popup-footer {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    border-top: 1px solid #dfe6ef;
    background: #f8fafc;
    padding: 0.62rem 1rem 0.72rem 1.25rem;
}

.map-imovel-popup-footer > span {
    min-width: 0;
    color: #5d6672;
    font-size: 0.78rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-imovel-popup-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.42rem;
}

.map-lookup-action-pair {
    display: flex;
    flex: 1 0 100%;
    min-width: 0;
    gap: 0.45rem;
}

.map-lookup-action-pair > button {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
}

.map-owner-lookup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 38px;
    border: 1px solid #284ec8;
    border-radius: 11px;
    background: linear-gradient(135deg, #2447c6 0%, #315fe0 100%);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0 0.45rem;
    cursor: pointer;
}

.map-lookup-action-pair .map-portal-debitos-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    gap: 0.32rem;
    padding-right: 0.4rem;
    font-size: 0.68rem;
    white-space: nowrap;
}

.map-owner-lookup-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.map-owner-lookup-count[data-owner-lookup-count="0"] {
    border-color: rgba(255, 255, 255, 0.72);
    background: #f3b326;
    color: #27364a;
}

.map-owner-lookup-btn:disabled {
    cursor: wait;
    opacity: 0.72;
}

.map-owner-lookup-popup {
    padding: 0.85rem 0.9rem;
    color: #252b33;
    background: #ffffff;
}

.map-owner-lookup-popup h3 {
    margin: 0 0 0.55rem;
    font-size: 0.98rem;
    font-weight: 850;
}

.map-owner-lookup-popup-section {
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    background: #f8fafc;
    padding: 0.68rem 0.72rem;
}

.map-owner-lookup-popup-section + .map-owner-lookup-popup-section {
    margin-top: 0.55rem;
}

.map-owner-lookup-popup span {
    display: block;
    color: #6f7782;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.map-owner-lookup-popup strong {
    display: block;
    margin-top: 0.18rem;
    color: #252b33;
    font-size: 0.86rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.map-owner-lookup-phone {
    margin-top: 0.42rem;
    border-radius: 10px;
    background: #eef6ff;
    padding: 0.5rem 0.58rem;
}

.map-popup-link,
.map-popup-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #7ea8ea;
    background: linear-gradient(135deg, #0b3f8f, #1f6feb 52%, #2e89ff);
    color: #ffffff !important;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    box-shadow: 0 8px 16px rgba(11, 63, 143, 0.24);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.map-popup-icon-link {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border-color: #9aa5b3;
    background: #ffffff;
    color: #4d5662 !important;
    font-size: 1rem;
    padding: 0;
    box-shadow: none;
}

.map-popup-link:hover,
.map-popup-icon-link:hover {
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 11px 20px rgba(10, 43, 91, 0.28);
    filter: saturate(1.05) brightness(1.03);
    text-decoration: none;
}

.map-popup-icon-link:hover {
    color: #1f3b67 !important;
    background: #eef4ff;
    box-shadow: 0 8px 14px rgba(15, 63, 138, 0.12);
}

.map-popup-link.map-popup-link-secondary {
    background: #eef4ff;
    color: #15468d !important;
    border-color: #bfd5ff;
    box-shadow: none;
}

.map-popup-link.map-popup-link-secondary:hover {
    color: #0e3770 !important;
    background: #e2edff;
    box-shadow: 0 8px 14px rgba(15, 63, 138, 0.12);
}

.map-area-popup {
    padding: 0.82rem 0.84rem;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    color: #1a3157;
}

.map-area-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.map-area-popup-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #bdd4ff;
    background: #ebf3ff;
    color: #0f4ca2;
    padding: 0.2rem 0.58rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.map-area-popup-count {
    font-size: 0.74rem;
    font-weight: 700;
    color: #446792;
}

.map-area-popup-title {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.3;
    font-weight: 800;
    color: #123d7e;
}

.map-area-popup-metric-label {
    margin-top: 0.52rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6281aa;
}

.map-area-popup-metric-value {
    margin-top: 0.12rem;
    font-size: 1rem;
    font-weight: 800;
    color: #0d7a3f;
}

.map-lote-leaflet-popup .leaflet-popup-content {
    min-width: 320px;
}

.map-lote-popup {
    padding: 0.88rem 0.9rem;
    background:
        linear-gradient(135deg, rgba(235, 246, 255, 0.9), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
    color: #173257;
}

.map-lote-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}

.map-lote-popup-chip,
.map-lote-popup-code {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    border-radius: 999px;
    padding: 0.2rem 0.58rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.map-lote-popup-chip {
    border: 1px solid #9fd9ff;
    background: #e7f7ff;
    color: #075985;
    text-transform: uppercase;
}

.map-lote-popup-code {
    max-width: 58%;
    border: 1px solid #c7d7ee;
    background: #f3f7fc;
    color: #315276;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-lote-popup-title {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.28;
    font-weight: 850;
    color: #0f3d70;
}

.map-lote-popup-subtitle {
    margin: 0.22rem 0 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #587397;
}

.map-lote-popup-grid {
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.34rem;
}

.map-lote-popup-row {
    display: grid;
    grid-template-columns: minmax(6.1rem, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 0.56rem;
    padding: 0.36rem 0.42rem;
    border: 1px solid #dce8f7;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.map-lote-popup-row span {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6783a5;
}

.map-lote-popup-row strong {
    min-width: 0;
    font-size: 0.76rem;
    line-height: 1.3;
    font-weight: 800;
    color: #1d416d;
    overflow-wrap: anywhere;
    text-align: right;
}

@media (max-width: 575.98px) {
    .leaflet-popup-content-wrapper {
        border-radius: 12px;
    }

    .leaflet-popup-content {
        min-width: 0;
        width: min(72vw, 250px);
        max-width: min(72vw, 250px);
    }

    .map-imovel-leaflet-popup .leaflet-popup-content {
        min-width: 0;
        width: min(88vw, 360px) !important;
        max-width: min(88vw, 360px);
    }

    .map-imovel-popup {
        max-height: min(76vh, 620px);
        padding: 0;
    }

    .map-imovel-popup-toolbar {
        min-height: 54px;
        padding: 0.9rem 3.5rem 0.65rem 1rem;
    }

    .map-imovel-popup-heading {
        font-size: 1rem;
    }

    .map-imovel-popup-scroll {
        padding: 0 0.72rem 0.72rem;
    }

    .map-imovel-popup-card {
        border-radius: 13px;
        padding: 0.72rem 0.78rem;
    }

    .map-imovel-field strong {
        font-size: 1rem;
    }

    .map-imovel-popup-grid,
    .map-imovel-popup-grid-three {
        grid-template-columns: 1fr;
        gap: 0.46rem;
    }

    .map-imovel-popup-grid div {
        padding: 0.58rem 0.64rem;
    }

    .map-imovel-popup-footer {
        min-height: 48px;
        padding: 0.55rem 0.72rem;
    }

    .public-imovel-popup,
    .map-area-popup,
    .map-lote-popup {
        padding: 0.5rem 0.54rem;
    }

    .map-imovel-popup-head,
    .public-imovel-popup-head {
        gap: 0.3rem;
        margin-bottom: 0.3rem;
    }

    .map-imovel-popup-code,
    .public-imovel-popup-code {
        padding: 0.14rem 0.42rem;
        font-size: 0.62rem;
    }

    .map-imovel-popup-price,
    .public-imovel-popup-price {
        font-size: 0.68rem;
    }

    .map-imovel-popup-title,
    .public-imovel-popup-title,
    .map-area-popup-title {
        font-size: 0.76rem;
        line-height: 1.24;
    }

    .map-imovel-popup-address,
    .public-imovel-popup-address {
        font-size: 0.67rem;
    }

    .map-imovel-popup-meta,
    .public-imovel-popup-owner {
        font-size: 0.65rem;
    }

    .map-imovel-popup-actions,
    .public-imovel-popup-actions {
        margin-top: 0.4rem;
        padding-top: 0.36rem;
        gap: 0.24rem;
    }

    .map-popup-link,
    .leaflet-popup-content .public-imovel-popup-actions .public-imovel-detail-link {
        width: 100%;
        padding: 0.24rem 0.46rem;
        font-size: 0.66rem;
    }

    .map-area-popup-head {
        gap: 0.3rem;
        margin-bottom: 0.32rem;
    }

    .map-area-popup-chip,
    .map-area-popup-count,
    .map-area-popup-metric-label,
    .map-area-popup-metric-value {
        font-size: 0.66rem;
    }

    .map-lote-leaflet-popup .leaflet-popup-content {
        min-width: 0;
    }

    .map-lote-popup-head {
        gap: 0.3rem;
        margin-bottom: 0.35rem;
    }

    .map-lote-popup-chip,
    .map-lote-popup-code {
        padding: 0.14rem 0.42rem;
        font-size: 0.6rem;
    }

    .map-lote-popup-title {
        font-size: 0.78rem;
    }

    .map-lote-popup-subtitle {
        font-size: 0.66rem;
    }

    .map-lote-popup-grid {
        margin-top: 0.46rem;
        gap: 0.25rem;
    }

    .map-lote-popup-row {
        grid-template-columns: 1fr;
        gap: 0.12rem;
        padding: 0.3rem 0.34rem;
    }

    .map-lote-popup-row span {
        font-size: 0.58rem;
    }

    .map-lote-popup-row strong {
        font-size: 0.66rem;
        text-align: left;
    }
}
