/**
 * CSS para adicionar espaçamento nos campos de busca e layout responsivo
 */

/* Margem superior para campos de formulário de busca */
.rehomes-search-form-area .rehomes-search-form .form-control {
    margin-top: 10px !important;
    padding-top: 8px !important;
}

/* Margem superior para botão de busca */
.rehomes-search-form-area .rehomes-search-form .rehomes-search-btn {
    margin-top: 10px !important;
    padding-top: 8px !important;
}

/* Margem superior para botão de busca (classe alternativa) */
.rehomes-search-form-area .rehomes-search-form .btn {
    margin-top: 10px !important;
    padding-top: 8px !important;
}

/* Margem superior para colunas dos campos */
.rehomes-search-form-area .rehomes-search-form .row .col-12 {
    margin-top: 10px !important;
}

/* Layout responsivo para campos de busca - todos na mesma linha em telas grandes */
@media (min-width: 1200px) {
    .col-xl-1-5 {
        flex: 0 0 15%;
        max-width: 15%;
    }
}

/* Ajuste para telas médias */
@media (min-width: 992px) and (max-width: 1199px) {
    .col-lg-2 {
        flex: 0 0 18%;
        max-width: 18%;
    }
}

/* Ajuste para telas pequenas */
@media (min-width: 768px) and (max-width: 991px) {
    .col-md-3 {
        flex: 0 0 22%;
        max-width: 22%;
    }
}

/* Ajuste para telas extra pequenas */
@media (min-width: 576px) and (max-width: 767px) {
    .col-sm-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* Ajuste para mobile */
@media (max-width: 575px) {
    .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Garantir que os campos fiquem alinhados */
.rehomes-search-form-area .rehomes-search-form .row.d-flex {
    align-items: center;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

/* Mobile: manter comportamento original */
@media (max-width: 767px) {
    .rehomes-search-form-area .rehomes-search-form .row.d-flex {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }
}


/* Centralizar o container principal dos campos de busca */
.rehomes-search-form-area .rehomes-search-form {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
}

/* Garantir que o container não ultrapasse a viewport */
.rehomes-search-form-area {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Ajuste para input-groups */
.rehomes-search-form-area .input-group {
    margin-top: 10px !important;
}

/* Garantir que input-groups tenham a mesma altura dos campos normais */
.rehomes-search-form-area .input-group .form-control {
    height: 38px !important;
    border-radius: 0.25rem 0 0 0.25rem !important;
}

.rehomes-search-form-area .input-group .input-group-prepend .input-group-text {
    height: 38px !important;
    border-radius: 0 0.25rem 0.25rem 0 !important;
    border-left: 0 !important;
    background-color: #e9ecef !important;
    border-color: #ced4da !important;
    color: #495057 !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    padding: 0.375rem 0.75rem !important;
}

/* Ajuste do botão Buscar para ficar alinhado com os campos - maior especificidade */
.rehomes-search-form-area .rehomes-search-form .rehomes-search-btn {
    height: 38px !important;
    line-height: 1.5 !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #28a745 !important;
    background-color: #28a745 !important;
    color: white !important;
    transition: all 0.15s ease-in-out !important;
    text-transform: none !important;
}

/* Hover do botão Buscar */
.rehomes-search-form-area .rehomes-search-form .rehomes-search-btn:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    opacity: 1 !important;
}

/* Botão Buscar em pesquisa avançada */
.rehomes-search-form-area .btn-primary {
    height: 38px !important;
    line-height: 1.5 !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #28a745 !important;
    background-color: #28a745 !important;
    color: white !important;
}

/* Garantir que todos os campos tenham a mesma altura */
.rehomes-search-form-area .form-control,
.rehomes-search-form-area .rehomes-search-form .rehomes-search-btn,
.rehomes-search-form-area .btn-primary {
    height: 38px !important;
    box-sizing: border-box !important;
}


/* Sobrescrever estilos específicos do style.css */
.rehomes-search-form-area .rehomes-search-form .rehomes-search-btn {
    line-height: 1.5 !important;
    height: 38px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    text-transform: none !important;
}

/* Alinhamento perfeito de todos os elementos */
.rehomes-search-form-area .rehomes-search-form .row.d-flex > div {
    display: flex !important;
    align-items: center !important;
}

.rehomes-search-form-area .rehomes-search-form .row.d-flex .form-control,
.rehomes-search-form-area .rehomes-search-form .row.d-flex .rehomes-search-btn,
.rehomes-search-form-area .rehomes-search-form .row.d-flex .btn-primary,
.rehomes-search-form-area .rehomes-search-form .row.d-flex .input-group {
    width: 100% !important;
}

/* Garantir que o botão ocupe toda a largura da coluna */
.rehomes-search-form-area .rehomes-search-form .row.d-flex .col-6 .rehomes-search-btn,
.rehomes-search-form-area .rehomes-search-form .row.d-flex .col-sm-4 .rehomes-search-btn,
.rehomes-search-form-area .rehomes-search-form .row.d-flex .col-md-3 .rehomes-search-btn,
.rehomes-search-form-area .rehomes-search-form .row.d-flex .col-lg-2 .rehomes-search-btn,
.rehomes-search-form-area .rehomes-search-form .row.d-flex .col-xl-1-5 .rehomes-search-btn {
    width: 100% !important;
}

/* Forçar todos os campos a ficarem na mesma linha - IMPORTANTE */
.rehomes-search-form-area .rehomes-search-form .row.d-flex {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

/* Garantir que as colunas não quebrem */
.rehomes-search-form-area .rehomes-search-form .row.d-flex > div {
    flex-shrink: 0 !important;
    min-width: 0 !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
}


/* Espaçamento entre os campos */
.rehomes-search-form-area .rehomes-search-form .row.d-flex > div:first-child {
    padding-left: 0 !important;
}

.rehomes-search-form-area .rehomes-search-form .row.d-flex > div:last-child {
    padding-right: 0 !important;
}

/* Empilhar filtros apenas no mobile (até 575px) */
@media (max-width: 575px) {
    .rehomes-search-form-area .rehomes-search-form .row.d-flex {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }

    .rehomes-search-form-area .rehomes-search-form .row.d-flex > div {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

