/* --- Constante de Altura --- */
:root {
    --ifa-field-height: 35px; /* Altura única para todos os campos */
    
    --ifa-accent: #cd905b;
}

/* --- Estrutura Principal --- */
.ifa-form {
    background-color: rgba(244, 244, 244, 0.6);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(1px);
    z-index: 101px !important;
}

.ifa-form-grid {
    display: grid;
    /* Mobile-first: 1 coluna */
    grid-template-columns: 1fr;
    gap: 15px;
    align-items: flex-end;
}

.ifa-field-group {
    display: flex;
    flex-direction: column;
}

/* --- Layout Desktop (Req 1: 2 Linhas / 6 Colunas) --- */
@media (min-width: 1024px) {
    .ifa-form-grid {
        /* 6 colunas */
        grid-template-columns: repeat(6, 1fr);
    }

    /* Linha 1 */
    .ifa-field-operacao { grid-column: span 1; }
    .ifa-field-busca-termo { grid-column: span 3; }
    .ifa-field-bairro { grid-column: span 2; }

    /* Linha 2 */
    .ifa-field-tipo-imovel { grid-column: span 2; }
    .ifa-field-quartos { grid-column: span 1; }
    .ifa-field-vagas { grid-column: span 1; }
    .ifa-field-precos { grid-column: span 1; }
    .ifa-field-actions { grid-column: span 1; }
}

/* --- Estilos dos Campos (Req 2: Altura Única) --- */
.ifa-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.ifa-input,
.ifa-select {
    background: white !important;
    width: 100% !important;
    border: 1px solid #ccc !important;
    border-radius: 4px  !important;
    font-size: 15px;
    box-sizing: border-box; /* Garante padding correto */
    height: var(--ifa-field-height) !important;
    padding: 0 10px;
    outline: 0;
}

/* --- Campo de Preços Agrupado (CORRIGIDO) --- */
.ifa-field-group-split {
    display: flex;
    gap: 5px;
}
.ifa-field-group-split .ifa-input {
    height: var(--ifa-field-height);
    font-size: 14px; 
    flex: 1; /* <-- ADICIONADO: Faz os inputs dividirem o espaço */
}
/* Remove setas de input number no Firefox */
.ifa-field-group-split input[type=number] {
    -moz-appearance: textfield;
}
/* Remove setas de input number no Chrome, Safari, Edge */
.ifa-field-group-split input[type=number]::-webkit-outer-spin-button,
.ifa-field-group-split input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* --- 4. Dropdown Checkbox (Sem alterações) --- */
.ifa-field-dropdown-check {
    position: relative;
}
.ifa-dropdown-toggle {
    display: flex !important;
    justify-content: space-between;
    gap: 3px;
    align-items: center;
    width: 100%;
    text-align: left;
    background-color: #fff;
    cursor: pointer;
    font-weight: 400;
    color: black !important;
}
.ifa-dropdown-toggle-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}
.ifa-dropdown-arrow {
    font-size: 15px;
    transition: transform 0.2s ease;
}
.ifa-dropdown-toggle[aria-expanded="true"] .ifa-dropdown-arrow {
    transform: rotate(180deg);
}
.ifa-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 5px;
}
.ifa-checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 4px;
}
.ifa-checkbox-label:hover {
    background-color: #f0f0f0;
}
.ifa-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

/* --- Botões de Ação (Sem alterações) --- */
.ifa-field-actions-wrapper {
    display: flex;
    gap: 5px;
    height: var(--ifa-field-height);
}
.ifa-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--ifa-field-height) !important; /* Botão quadrado */
    height: var(--ifa-field-height);
    padding: 0;
    border-radius: 4px !important;
    cursor: pointer;
    position: relative; /* Para o tooltip */
    
    /* Propriedades do Ícone (Adicionadas) */
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 22px 22px; /* Tamanho do ícone */
    
    border: none !important;
    background-color: var(--ifa-accent) !important;
    
    opacity: .8;
    transition: opacity .2s !important;
}
.ifa-button:hover {
    opacity: 1;
}

.ifa-button-submit {
    background-color: #0073e6;
    color: white;
}
.ifa-button-clear {
    background-color: #e0e0e0;
    color: #333;
}

/* --- Ícones dos Botões (Sem alterações) --- */
.ifa-button-submit.ifa-button-icon-search {
    /* Ícone de Lupa (Branco) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

.ifa-button-clear.ifa-button-icon-clear {
    /* Ícone de X (Preto/Cinza Escuro) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z'/%3E%3C/svg%3E");
}


/* Tooltip (Sem alterações) */
.ifa-button[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%; /* Acima do botão */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1002;
}
.ifa-button[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}


/* --- AJAX (Sem alterações) --- */
.ifa-search-wrapper {
    position: relative;
}
.ifa-ajax-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #0073e6;
    border-radius: 50%;
    animation: ifa-spin 0.8s linear infinite;
}
@keyframes ifa-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.ifa-ajax-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.ifa-ajax-results ul { list-style: none; margin: 0; padding: 0; }
.ifa-ajax-results li { padding: 10px 15px; cursor: pointer; border-bottom: 1px solid #eee; }
.ifa-ajax-results li:last-child { border-bottom: none; }
.ifa-ajax-results li.selected, .ifa-ajax-results li:hover { background-color: #f0f0f0; }