/**
 * Mapa Interativo - Design Premium
 * AlmeidaImob - Sistema de Mapa de Imóveis
 */

/* ===== LAYOUT PRINCIPAL ===== */
.mapa-page {
    display: flex;
    flex-direction: column;
    /* Altura fixa: 100vh menos header do site (72px) */
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    margin-top: 72px;
    overflow: hidden;
    background: #f8fafb;
}

/* ===== HEADER DO MAPA ===== */
.mapa-header {
    background: linear-gradient(135deg, #1a5f4a 0%, #0d3d2e 100%);
    padding: 0.625rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.mapa-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.mapa-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mapa-title h1 {
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.mapa-title .badge-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.mapa-title .badge-count i {
    margin-right: 6px;
    color: #ffd700;
}

/* Stats rápidos */
.mapa-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.stat-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.875rem;
}

.stat-item .stat-value {
    font-weight: 700;
    font-size: 1rem;
    color: white;
}

/* ===== CONTAINER PRINCIPAL ===== */
.mapa-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== SIDEBAR DE FILTROS ===== */
.mapa-sidebar {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
    transition: width 0.3s ease, margin-left 0.3s ease, min-width 0.3s ease, max-width 0.3s ease;
    box-sizing: border-box;
}

.mapa-sidebar.collapsed {
    width: 0;
    margin-left: -1px;
}

/* Toggle Sidebar */

/* Filtros */
.filtros-section {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
}

.filtros-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filtros-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.btn-limpar-filtros {
    font-size: 0.75rem;
    color: #6c757d;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.btn-limpar-filtros:hover {
    color: #10b981;
}

/* Busca por localização */
.busca-localizacao {
    position: relative;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.busca-localizacao input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
    min-width: 0;
}

.busca-localizacao input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.busca-localizacao i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Filtros Grid */
.filtros-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.filtro-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtro-select {
    padding: 0.625rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.filtro-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Faixa de preço */
.price-range-container {
    padding: 0.5rem 0;
    width: 100%;
    box-sizing: border-box;
}

.price-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.price-inputs input {
    padding: 0.5rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.price-inputs input:focus {
    outline: none;
    border-color: #10b981;
}

.price-separator {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Tipos de imóvel (checkboxes visuais) */
.tipos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.tipo-checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.tipo-checkbox:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.tipo-checkbox.active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.tipo-checkbox input {
    display: none;
}

.tipo-checkbox i {
    font-size: 1rem;
    color: #6c757d;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.tipo-checkbox.active i {
    color: #10b981;
}

.tipo-checkbox span {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.tipo-checkbox.active span {
    color: #10b981;
}

/* ===== LISTA DE IMÓVEIS ===== */
.imoveis-lista-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Ocupa todo espaço disponível na sidebar */
    flex: 1;
    min-height: 0;
}

.lista-header {
    padding: 0.75rem 1rem;
    background: #f8fafb;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.lista-header h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.lista-count {
    font-size: 0.7rem;
    color: #6c757d;
    background: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.imoveis-lista {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Card do imóvel na lista */
.imovel-card-mini {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.imovel-card-mini:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    transform: translateX(4px);
}

.imovel-card-mini.highlighted {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.imovel-card-mini .card-image {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.imovel-card-mini .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.imovel-card-mini .card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.imovel-card-mini .card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 0.15rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.imovel-card-mini .card-location {
    font-size: 0.7rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}

.imovel-card-mini .card-location i {
    color: #10b981;
    font-size: 0.65rem;
}

.imovel-card-mini .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.imovel-card-mini .card-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: #10b981;
}

.imovel-card-mini .card-badges {
    display: flex;
    gap: 3px;
}

.imovel-card-mini .badge-mini {
    font-size: 0.55rem;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.imovel-card-mini .badge-mini.sale {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.imovel-card-mini .badge-mini.rent {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* ===== ÁREA DO MAPA ===== */
.mapa-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

#mapa-imoveis {
    flex: 1;
    width: 100%;
    z-index: 1;
}

/* Controles do mapa */
.mapa-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mapa-control-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #374151;
}

.mapa-control-btn:hover {
    background: #10b981;
    color: white;
    transform: scale(1.05);
}

.mapa-control-btn.active {
    background: #10b981;
    color: white;
}

/* Tipo de mapa toggle */
.map-type-toggle {
    position: absolute;
    bottom: 2rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.map-type-btn {
    padding: 0.625rem 1rem;
    background: white;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-type-btn:not(:last-child) {
    border-right: 1px solid #e2e8f0;
}

.map-type-btn:hover {
    background: #f1f5f9;
}

.map-type-btn.active {
    background: #10b981;
    color: white;
}

/* Info do zoom */
.zoom-info {
    position: absolute;
    bottom: 2rem;
    right: 1rem;
    z-index: 1000;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-size: 0.75rem;
    color: #6c757d;
}

/* ===== POPUP MODERNO ===== */
.leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.leaflet-popup-tip {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.popup-modern {
    overflow: hidden;
}

.popup-modern .popup-image {
    width: 100%;
    height: 160px;
    position: relative;
    overflow: hidden;
}

.popup-modern .popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-modern .popup-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
}

.popup-modern .popup-badge {
    padding: 4px 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    color: white;
}

.popup-modern .popup-badge.sale {
    background: #10b981;
}

.popup-modern .popup-badge.rent {
    background: #3b82f6;
}

.popup-modern .popup-code {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
}

.popup-modern .popup-content {
    padding: 1rem;
}

.popup-modern .popup-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.popup-modern .popup-location {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.popup-modern .popup-location i {
    color: #10b981;
}

.popup-modern .popup-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 0.75rem;
}

.popup-modern .popup-price .period {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6c757d;
}

.popup-modern .popup-features {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.popup-modern .popup-feature {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #6c757d;
}

.popup-modern .popup-feature i {
    color: #9ca3af;
}

.popup-modern .popup-action {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.popup-modern .popup-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    color: white;
}

/* ===== MARCADORES CUSTOMIZADOS ===== */
.marker-custom {
    background: #10b981;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    transition: all 0.2s ease;
}

.marker-custom:hover {
    transform: scale(1.2);
}

.marker-custom.casa {
    background: #10b981;
}

.marker-custom.apartamento {
    background: #3b82f6;
}

.marker-custom.comercial {
    background: #f59e0b;
}

.marker-custom.terreno {
    background: #8b5cf6;
}

.marker-custom.rural {
    background: #059669;
}

.marker-custom.lancamento {
    background: #ef4444;
}

/* Cluster */
.marker-cluster {
    background: rgba(16, 185, 129, 0.6) !important;
}

.marker-cluster div {
    background: #10b981 !important;
    color: white !important;
    font-weight: 700 !important;
}

/* ===== LOADING STATE ===== */
.mapa-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.mapa-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.mapa-loading p {
    color: #6c757d;
    font-size: 0.875rem;
}

/* ===== EMPTY STATE ===== */
.lista-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.lista-empty i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.lista-empty h4 {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.lista-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* Hint da lista */
.lista-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    margin: 0;
    font-size: 0.7rem;
    color: #6c757d;
    background: #f0fdf4;
    border-bottom: 1px solid #dcfce7;
}

.lista-hint i {
    color: #10b981;
    font-size: 0.75rem;
}

/* ===== GEOLOCALIZAÇÃO ===== */
.btn-geolocate {
    position: absolute;
    bottom: 5rem;
    right: 1rem;
    z-index: 1000;
}

.user-location-marker {
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3), 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: pulse-location 2s infinite;
}

@keyframes pulse-location {
    0% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3), 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(59, 130, 246, 0.1), 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    100% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3), 0 2px 10px rgba(0, 0, 0, 0.3);
    }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1199px) {
    .mapa-sidebar {
        width: 320px;
        min-width: 320px;
    }


    .tipos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .mapa-sidebar {
        width: 300px;
        min-width: 300px;
    }

    .mapa-stats {
        display: none;
    }

    .tipo-checkbox {
        padding: 0.5rem 0.6rem;
    }

    .tipo-checkbox span {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .mapa-page {
        /* Altura total menos header fixo */
        min-height: 100vh;
        height: auto;
        padding-top: 72px;
    }

    .mapa-container {
        flex-direction: column;
    }

    .mapa-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .mapa-sidebar.collapsed {
        max-height: 0;
        width: 100%;
        min-width: 100%;
        margin-left: 0;
    }

    .tipos-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tipo-checkbox {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .tipo-checkbox span {
        font-size: 0.65rem;
    }

    .filtros-section {
        padding: 0.75rem;
    }

    .imoveis-lista-section {
        display: none;
    }

    .map-type-toggle {
        bottom: 1rem;
        left: 0.5rem;
    }

    .zoom-info {
        display: none;
    }

    .mapa-controls {
        top: 0.5rem;
        right: 0.5rem;
    }
}

@media (max-width: 575px) {
    .mapa-title h1 {
        font-size: 1.25rem;
    }

    .tipos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tipo-checkbox {
        flex-direction: row;
        padding: 0.5rem 0.6rem;
        gap: 0.4rem;
    }

    .tipo-checkbox i {
        font-size: 0.9rem;
    }

    .tipo-checkbox span {
        font-size: 0.7rem;
    }
}

/* ===== SCROLLBAR CUSTOMIZADA ===== */
.imoveis-lista::-webkit-scrollbar {
    width: 6px;
}

.imoveis-lista::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.imoveis-lista::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.imoveis-lista::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ===== MOBILE ENHANCEMENTS ===== */

/* Botões de controle maiores (48px) para touch */
@media (max-width: 768px) {
    .mapa-control-btn {
        width: var(--touch-target-comfortable, 48px);
        height: var(--touch-target-comfortable, 48px);
        border-radius: 12px;
        font-size: 1rem;
    }

    .map-type-btn {
        min-height: var(--touch-target-min, 44px);
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }

    /* Popup otimizado para mobile */
    .leaflet-popup-content {
        width: 260px !important;
    }

    .popup-modern .popup-image {
        height: 140px;
    }

    .popup-modern .popup-content {
        padding: 0.875rem;
    }

    .popup-modern .popup-title {
        font-size: 0.9375rem;
    }

    .popup-modern .popup-price {
        font-size: 1.125rem;
    }

    .popup-modern .popup-action {
        min-height: var(--touch-target-min, 44px);
        padding: 0.875rem;
        font-size: 0.9375rem;
    }

    /* Header do mapa mais compacto */
    .mapa-header {
        padding: 0.875rem 0;
    }

    .mapa-title h1 {
        font-size: 1.25rem;
    }

    .mapa-title .badge-count {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Breakpoint 480px - Mobile Small */
@media (max-width: 480px) {
    .mapa-header {
        padding: 0.75rem 0;
    }

    .mapa-header-content {
        padding: 0 var(--mobile-padding-sm, 0.75rem);
    }

    .mapa-title h1 {
        font-size: 1.125rem;
    }

    .mapa-title .badge-count {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Sidebar como drawer */
    .mapa-sidebar {
        max-height: 45vh;
    }

    .filtros-section {
        padding: 0.625rem;
    }

    .filtros-header h3 {
        font-size: 0.875rem;
    }

    .filtro-label {
        font-size: 0.7rem;
    }

    .filtro-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .busca-localizacao input {
        padding: 0.625rem 0.875rem 0.625rem 2.25rem;
        font-size: 0.8125rem;
    }

    .price-inputs input {
        font-size: 0.75rem;
        padding: 0.375rem;
    }

    /* Popup mais compacto */
    .leaflet-popup-content {
        width: 240px !important;
    }

    .popup-modern .popup-image {
        height: 120px;
    }

    .popup-modern .popup-title {
        font-size: 0.875rem;
    }

    .popup-modern .popup-location {
        font-size: 0.75rem;
    }

    .popup-modern .popup-price {
        font-size: 1rem;
    }

    .popup-modern .popup-features {
        gap: 0.75rem;
        font-size: 0.75rem;
    }

    .map-type-toggle {
        left: 0.375rem;
        bottom: 0.75rem;
    }

    .map-type-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .mapa-controls {
        top: 0.375rem;
        right: 0.375rem;
        gap: 0.375rem;
    }

    .mapa-control-btn {
        width: 44px;
        height: 44px;
    }
}

/* Breakpoint 375px - Mobile Very Small */
@media (max-width: 375px) {
    .mapa-title h1 {
        font-size: 1rem;
    }

    .mapa-sidebar {
        max-height: 40vh;
    }

    .tipos-grid {
        gap: 0.375rem;
    }

    .tipo-checkbox {
        padding: 0.4rem;
        gap: 0.3rem;
    }

    .tipo-checkbox span {
        font-size: 0.65rem;
    }

    .leaflet-popup-content {
        width: 220px !important;
    }

    .popup-modern .popup-image {
        height: 100px;
    }

    .popup-modern .popup-content {
        padding: 0.75rem;
    }
}

/* Mobile drawer toggle - mostrar lista como card flutuante */
@media (max-width: 768px) {
    .imoveis-lista-section.mobile-visible {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 40vh;
        background: white;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 1100;
        animation: slideUp 0.3s ease-out;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .imoveis-lista-section.mobile-visible .lista-header {
        border-radius: 16px 16px 0 0;
        padding: 0.875rem 1rem;
    }

    .imoveis-lista-section.mobile-visible .imoveis-lista {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .mapa-control-btn:active {
        transform: scale(0.95);
        background: #10b981;
        color: white;
    }

    .map-type-btn:active {
        background: #e5e7eb;
    }

    .tipo-checkbox:active {
        background: rgba(16, 185, 129, 0.15);
    }

    .imovel-card-mini:active {
        transform: translateX(4px);
        border-color: #10b981;
    }

    .popup-modern .popup-action:active {
        transform: scale(0.98);
    }
}

/* Safe area para notch devices */
@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .map-type-toggle {
            bottom: calc(1rem + env(safe-area-inset-bottom));
        }
    }
}

/* Acessibilidade */
.mapa-control-btn:focus-visible,
.map-type-btn:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.tipo-checkbox:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}