/* Estilo para autocomplete do Mapbox - Melhorado */
.mapbox-suggestions {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075), 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    margin-top: 2px;
    width: 100%;
}

.mapbox-suggestions:empty {
    display: none !important;
}

.suggestion-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

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

.suggestion-item:hover {
    background-color: #f8f9fa !important;
}

.suggestion-item.selected,
.suggestion-item:focus {
    background-color: #0d6efd !important;
    color: white !important;
}

.suggestion-item .fw-semibold {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.suggestion-item .text-muted {
    color: #6c757d;
    font-size: 0.8rem;
}

.suggestion-item.selected .text-muted,
.suggestion-item:focus .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Garantir que o container dos inputs tenha position relative */
.input-group {
    position: relative;
}

/* Evitar que o autocomplete seja cortado em modais */
.modal .mapbox-suggestions {
    z-index: 10050;
}

/* Responsivo */
@media (max-width: 576px) {
    .mapbox-suggestions {
        max-height: 150px;
    }
    
    .suggestion-item {
        padding: 0.5rem;
    }
    
    .suggestion-item .fw-semibold {
        font-size: 0.85rem;
    }
    
    .suggestion-item .text-muted {
        font-size: 0.75rem;
    }
}

/* Loading state */
.mapbox-suggestions.loading::before {
    content: "Buscando endereços...";
    display: block;
    padding: 0.75rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}

/* No results state */
.mapbox-suggestions.no-results::before {
    content: "Nenhum resultado encontrado";
    display: block;
    padding: 0.75rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}