/* =============================================================
   LISTAGEM — SÉRGIO CORRÊA IMÓVEIS
   Valores finais da cascata do site antigo (imoveis-para-venda.php / imoveis-para-locacao.php:
   Bootstrap 5 + tema + css/personalizados/imoveis.css).
   ============================================================= */

.listagem-area {
    padding-top: 50px;
    padding-bottom: 120px;
}

.listagem-fluido {
    width: 100%;
    padding: 0 3rem;
}

.grid-listagem {
    display: grid;
    grid-template-columns: 335px 1fr;
    column-gap: 12px;
}

.listagem-lateral {
    min-width: 0;
}

.busca-lateral--lateral {
    display: none;
}

@media (min-width: 992px) {
    .busca-lateral--lateral {
        display: block;
        height: 100%;
    }
}

@media (max-width: 991px) {
    .grid-listagem {
        display: flex;
        flex-direction: column;
    }
}

/* =============================================================
   BUSCA LATERAL
   ============================================================= */
.busca-imoveis {
    position: sticky;
    top: 80px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 92px);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
}

.busca-imoveis__corpo {
    flex: 1 1 auto;
    padding: 14px 18px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.busca-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.filtro,
.sessao {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 4px;
}

.filtro__topo,
.sessao__topo {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    user-select: none;
}

.filtro__rotulo strong {
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
}

.filtro__rotulo span {
    display: block;
    margin-top: 2px;
    color: rgba(42, 15, 15, .65);
    font-size: 12px;
    font-weight: 700;
}

.filtro__seta,
.sessao__seta {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, .05);
    border-radius: 12px;
    transition: .18s ease;
}

.filtro__seta svg,
.sessao__seta svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.filtro.is-aberto .filtro__seta,
.sessao.is-aberto .sessao__seta {
    background: rgb(17 72 251 / 12%);
    transform: rotate(180deg);
}

.filtro__conteudo,
.sessao__conteudo {
    display: none;
    padding: 12px;
    border-top: 1px solid rgba(0, 0, 0, .06);
}

.filtro.is-aberto .filtro__conteudo,
.sessao.is-aberto .sessao__conteudo {
    display: block;
}

.filtro__busca-interna {
    margin-bottom: 10px;
}

/* CAMPOS DE TEXTO (PALAVRA-CHAVE, CÓDIGO E AS PESQUISAS DE CIDADE/BAIRRO) */
.input-busca {
    width: 100%;
    height: 47px;
    margin: 0;
    padding: 0 0 0 10px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    color: #333;
    font-family: var(--fonte);
    font-size: 14px;
    font-weight: 400;
    outline: none;
}

.input-busca::placeholder {
    color: #333;
}

.filtro__busca-interna .input-busca {
    font-weight: 700;
}

.filtro__busca-interna .input-busca:focus {
    /* CONTORNO NO AZUL DO SITE (O TEMA ANTIGO USAVA VERMELHO) */
    box-shadow: 0 0 0 4px rgba(28, 109, 175, .12);
}

/* VALORES E PESQUISA DAS CARACTERÍSTICAS */
.campo-texto {
    width: 100%;
    height: 47px;
    margin: 0;
    padding: 0 0 0 10px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-family: var(--fonte);
    font-size: 16px;
    font-weight: 700;
    outline: none;
}

.campo-texto::placeholder {
    color: #9f9f9f;
    font-size: 14px;
}

/* LISTAS DE OPÇÕES */
.checkbox-list {
    max-height: 300px;
    margin: 0;
    padding: 0 4px 0 0;
    overflow-y: auto;
    list-style: none;
}

.checkbox-list li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eee;
    color: var(--cor-site-5);
}

.checkbox-list li:last-child {
    margin-bottom: 10px;
}

.dropdown-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 9px 9px 41px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s ease;
}

.dropdown-option:hover {
    background: rgba(0, 0, 0, .03);
}

.checkbox-list li:hover .dropdown-option {
    color: var(--cor-site-1);
}

.dropdown-option input {
    position: absolute;
    width: 0;
    height: 0;
    margin: 0;
    opacity: 0;
}

.dropdown-checkmark {
    position: absolute;
    top: 10px;
    left: 16px;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.dropdown-option:hover .dropdown-checkmark,
.dropdown-option input:checked ~ .dropdown-checkmark {
    background-color: var(--cor-site-1);
}

.dropdown-option input:checked ~ .dropdown-checkmark {
    border-color: var(--cor-site-1);
}

.dropdown-option input:active ~ .dropdown-checkmark {
    transform: scale(.96);
}

.dropdown-option input:checked ~ .dropdown-checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    display: block;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* CARACTERÍSTICA SEM IMÓVEL NO RESULTADO ATUAL (PEDIDO DO MESSIAS; O SITE ANTIGO NÃO TEM) */
.checkbox-list li.indisponivel .dropdown-option {
    color: #0f172a;
    opacity: .4;
    cursor: not-allowed;
}

.checkbox-list li.indisponivel .dropdown-option:hover {
    background: none;
}

.checkbox-list li.indisponivel .dropdown-option:hover .dropdown-checkmark {
    background-color: #fff;
}

.dropdown-option input:focus-visible ~ .dropdown-checkmark {
    outline: 2px solid var(--cor-site-1);
    outline-offset: 2px;
}

.busca-imoveis__cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.busca-imoveis__reload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background: var(--cor-site-1);
    border: 1px solid #dedede;
    border-radius: 10px;
    color: #fff;
}

.busca-imoveis__reload:hover {
    color: #fff;
}

/* =============================================================
   TÍTULO, TOTAL E ORDENAÇÃO
   ============================================================= */
.listagem-imoveis {
    min-width: 0;
}

.listagem-imoveis__titulo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: .5rem;
    padding-bottom: 1rem;
}

.page-title {
    position: relative;
    margin: 0;
    padding-bottom: 5px;
    color: #202020;
    font-size: 2rem;
    font-weight: 700;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 5%;
    width: 50px;
    height: 3px;
    background: var(--cor-site-1);
    border-radius: 3px;
    transform: translateX(-50%);
}

.ltn__shop-options {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d1dae0;
}

.ltn__shop-options > ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0;
}

.ltn__shop-options > ul > li {
    margin-top: 0;
    margin-right: 30px;
    color: var(--cor-site-5);
    line-height: 50px;
    list-style: none;
}

.ltn__shop-options > ul > li:last-child {
    margin-right: 0;
}

.showing-product-number {
    font-size: 14px;
    font-weight: 700;
}

.showing-product-number span {
    color: var(--cor-site-5);
    font-size: 14px;
}

.nice-select {
    position: relative;
    display: block;
    float: left;
    min-width: 190px;
    height: 47px;
    padding-right: 30px;
    padding-left: 18px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    line-height: 46px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    outline: 0;
    user-select: none;
    transition: all .2s ease-in-out;
}

.nice-select::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    display: block;
    width: 5px;
    height: 5px;
    margin-top: -4px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    pointer-events: none;
    transform: rotate(45deg);
    transform-origin: 66% 66%;
    transition: all .15s ease-in-out;
}

.nice-select.open::after {
    transform: rotate(-135deg);
}

.nice-select .current {
    color: var(--cor-site-5);
    font-weight: 700;
}

.nice-select .list {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9;
    min-width: 100%;
    margin-top: 4px;
    padding: 0;
    overflow: hidden;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(68, 68, 68, .11);
    opacity: 0;
    pointer-events: none;
    transform: scale(.75) translateY(-21px);
    transform-origin: 50% 0;
    transition: all .2s cubic-bezier(.5, 0, 0, 1.25), opacity .15s ease-out;
}

.nice-select.open .list {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

.nice-select .option {
    min-height: 40px;
    padding-right: 5px;
    padding-left: 10px;
    color: var(--cor-site-5);
    font-weight: 400;
    line-height: 40px;
    list-style: none;
    outline: 0;
    cursor: pointer;
    transition: all .2s;
}

.nice-select .option:hover,
.nice-select .option:focus {
    background-color: #d3d8d8;
}

.nice-select .option.selected {
    font-weight: 700;
}

/* =============================================================
   GRADE DE CARTÕES, AVISOS E "CARREGANDO"
   ============================================================= */
.grid-imoveis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(345px, 1fr));
}

.grid-imoveis .property-card-container {
    padding: 8px;
}

.listagem-aviso h4 {
    margin: 20px 0;
}

.listagem-carregando {
    margin-top: 1rem;
    text-align: center;
}

.listagem-carregando--grade {
    grid-column: 1 / -1;
}

.listagem-carregando p {
    margin: .5rem 0 0;
}

.listagem-carregando__roda {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: .25em solid var(--cor-site-1);
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -.125em;
    animation: rodaListagem .75s linear infinite;
}

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

/* =============================================================
   CELULAR (VALORES DO SITE ANTIGO: imoveis.css + offcanvas do Bootstrap 5)
   ============================================================= */

/* BOTÕES "FILTRAR IMÓVEIS" / "LIMPAR FILTROS" PRESOS NO PÉ DA TELA (O FUNDO VEM DE UMA VARIÁVEL INEXISTENTE NO
   SITE ANTIGO: FICA TRANSPARENTE, SÓ COM O DESFOQUE). */
.botao-busca-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-top: 3px solid var(--cor-site-1);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 25px rgba(4, 17, 19, .1);
    transform: translateY(100%);
    animation: botoesSobem .5s cubic-bezier(.25, .46, .45, .94) forwards;
    backdrop-filter: blur(15px);
}

@keyframes botoesSobem {
    to {
        transform: translateY(0);
    }
}

.btn-mobile {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 14px 20px;
    overflow: hidden;
    background: var(--cor-site-1);
    border: none;
    border-radius: 7px;
    color: var(--cor-site-2);
    font-size: .95rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all .4s cubic-bezier(.175, .885, .32, 1.275);
}

.btn-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
    transition: all .6s ease;
}

.btn-mobile:hover {
    /* SOMBRA NO AZUL DO SITE (#1C6DAF); O TEMA ANTIGO USAVA O VERMELHO #DF0209, QUE FICAVA ESTRANHO NOS BOTÕES AZUIS */
    box-shadow: 0 7px 20px rgba(28, 109, 175, .35);
    color: var(--cor-site-2);
    transform: translateY(-3px);
}

.btn-mobile:hover::before {
    left: 100%;
}

.btn-mobile .ic {
    margin-right: 8px;
    font-size: 1.1rem;
    transition: transform .3s ease;
}

.btn-mobile:hover .ic {
    transform: scale(1.1);
}

@media (min-width: 992px) {
    .botao-busca-mobile {
        display: none;
    }
}

@media (max-width: 400px) {
    .btn-mobile {
        padding: 12px 15px;
        font-size: .85rem;
    }

    .btn-mobile .ic {
        margin-right: 5px;
        font-size: 1rem;
    }
}

/* PAINEL "FILTROS" (OFFCANVAS DO BOOTSTRAP 5, PELA ESQUERDA) */
.filtros-celular {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    width: 400px;
    max-width: 100%;
    background-color: #fff;
    border-right: 1px solid rgba(0, 0, 0, .2);
    outline: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .3s ease-in-out, visibility .3s;
}

.filtros-celular.aberto {
    visibility: visible;
    transform: none;
}

.filtros-celular__topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
}

.filtros-celular__titulo {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
}

.filtros-celular__fechar {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    margin: -.5rem -.5rem -.5rem auto;
    padding: .5rem;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center / 1em auto no-repeat;
    border: 0;
    border-radius: .25rem;
    opacity: .5;
}

.filtros-celular__fechar:hover {
    opacity: .75;
}

.filtros-celular__fechar:focus-visible {
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
    opacity: 1;
    outline: 0;
}

.filtros-celular__corpo {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* NO PAINEL O FORMULÁRIO NÃO TEM A CAIXA DA LATERAL (busca-imoveis__corpo p-0 NO ANTIGO). */
.busca-imoveis--celular {
    position: static;
    max-height: none;
    overflow: visible;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.busca-imoveis--celular .busca-imoveis__corpo {
    padding: 0;
    overflow: visible;
}

.filtros-celular__fundo {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background-color: #000;
    opacity: .5;
}

.filtros-celular__fundo[hidden] {
    display: none;
}

@media (max-width: 1024px) {
    .listagem-fluido {
        padding: 0 10px;
    }
}

@media (max-width: 600px) {
    .campo-texto {
        height: 60px;
    }
}

/* NA LISTAGEM O WHATSAPP E O "VOLTAR AO TOPO" SOBEM PARA NÃO COBRIR OS BOTÕES DO PÉ. O SITE ANTIGO SÓ FAZIA ISSO ATÉ
   768PX E O WHATSAPP FICAVA EM CIMA DO "LIMPAR FILTROS" DE 769 A 991; AQUI VALE ENQUANTO OS BOTÕES APARECEM (PEDIDO DO MESSIAS). */
@media (max-width: 991px) {
    body[data-pagina="listagem"] .whatsapp-container {
        right: 10px;
        bottom: 80px;
    }

    body[data-pagina="listagem"] .voltar-topo {
        right: 12px;
        bottom: 135px;
    }
}

/* COM O CHATBOT DO PAINEL LIGADO: O CHAT TAMBÉM SOBE ACIMA DOS BOTÕES DO PÉ (NÃO COBRE O "LIMPAR FILTROS"), O WHATSAPP
   FICA LOGO ACIMA DELE E O VOLTAR AO TOPO ACIMA DO WHATSAPP — 12PX ENTRE CADA UM, NO EIXO DO CHAT. O id VENCE A REGRA
   DO PAINEL, QUE VEM DEPOIS DESTE CSS. */
@media (max-width: 991px) {
    body.tem-chat[data-pagina="listagem"] #sami-chat-raiz {
        right: 20px;
        bottom: 80px;
    }

    body.tem-chat[data-pagina="listagem"] .whatsapp-container {
        right: 20px;
        bottom: 152px;
    }

    body.tem-chat[data-pagina="listagem"] .voltar-topo {
        right: 27px;
        bottom: 224px;
    }
}

@media (max-width: 768px) {
    body.tem-chat[data-pagina="listagem"] .whatsapp-container {
        right: 25px;
    }

    body.tem-chat[data-pagina="listagem"] .voltar-topo {
        bottom: 214px;
    }
}

@media (max-width: 480px) {
    body.tem-chat[data-pagina="listagem"] #sami-chat-raiz {
        right: 12px;
    }

    body.tem-chat[data-pagina="listagem"] .whatsapp-container {
        right: 17px;
    }

    body.tem-chat[data-pagina="listagem"] .voltar-topo {
        right: 19px;
    }
}
