/* CA Filtro de Cidades por Páginas - front-end
   Os seletores são propositalmente específicos (e algumas propriedades usam !important)
   porque temas e o Elementor costumam sobrescrever h3, p, input, button e links. */

.cafc-wrap {
    --cafc-cor: #1e6fd9;
    --cafc-cor-texto: #0f172a;
    --cafc-cor-titulo: #0f172a;
    --cafc-cor-subtitulo: #64748b;
    --cafc-cor-contador: #64748b;
    --cafc-cor-botao-texto: #ffffff;
    --cafc-x-fundo: #f1f5f9;
    --cafc-x-cor: #64748b;
    --cafc-radius: 14px;
    --cafc-largura: 620px;
    --cafc-largura-campo: 100%;
    --cafc-borda: #e2e8f0;
    --cafc-suave: #f8fafc;
    --cafc-mudo: #64748b;

    display: block;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.cafc-wrap *,
.cafc-wrap *::before,
.cafc-wrap *::after {
    box-sizing: border-box;
}

.cafc-wrap .cafc-box {
    position: relative;
    width: 100%;
    max-width: var(--cafc-largura);
}

.cafc-align-center .cafc-box { margin: 0 auto; text-align: center; }
.cafc-align-left   .cafc-box { margin: 0 auto 0 0; text-align: left; }
.cafc-align-right  .cafc-box { margin: 0 0 0 auto; text-align: right; }

/* ---------- Títulos ---------- */

.cafc-wrap .cafc-box h3.cafc-titulo {
    margin: 0 0 8px;
    padding: 0;
    font-size: clamp(20px, 2.4vw, 28px);
    line-height: 1.25;
    font-weight: 700;
    color: var(--cafc-cor-titulo) !important;
}

.cafc-wrap .cafc-box p.cafc-subtitulo {
    margin: 0 0 18px;
    padding: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--cafc-cor-subtitulo) !important;
}

/* ---------- Campo ---------- */

/* Área do campo: define a largura do campo E do painel de resultados, que fica ancorado nela. */
.cafc-wrap .cafc-area {
    position: relative;
    width: var(--cafc-largura-campo);
    max-width: 100%;
}

.cafc-align-center .cafc-area { margin-left: auto; margin-right: auto; }
.cafc-align-right  .cafc-area { margin-left: auto; }

.cafc-wrap .cafc-campo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    padding: 6px 8px 6px 16px;
    background: #fff;
    border: 1.5px solid var(--cafc-borda);
    border-radius: calc(var(--cafc-radius) + 6px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
    transition: border-color .18s ease, box-shadow .18s ease;
    text-align: left;
}

.cafc-wrap .cafc-campo--com-botao { padding-right: 6px; }

.cafc-wrap .cafc-campo:hover {
    border-color: color-mix(in srgb, var(--cafc-cor) 40%, var(--cafc-borda));
}

.cafc-wrap .cafc-campo:focus-within {
    border-color: var(--cafc-cor);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--cafc-cor) 16%, transparent),
                0 10px 26px rgba(15, 23, 42, .10);
}

.cafc-wrap .cafc-icone {
    display: inline-flex;
    flex: 0 0 auto;
    color: var(--cafc-cor);
}

.cafc-wrap .cafc-icone svg { width: 22px; height: 22px; }

.cafc-wrap input.cafc-input,
.cafc-wrap input[type="text"].cafc-input {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 46px;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0;
    font-size: 16px;
    line-height: 46px;
    color: var(--cafc-cor-texto) !important;
    font-family: inherit;
}

.cafc-wrap .cafc-input::placeholder { color: #94a3b8; opacity: 1; }
.cafc-wrap .cafc-input:focus { outline: 0; box-shadow: none !important; }

.cafc-wrap button.cafc-limpar,
.cafc-wrap button[type="button"].cafc-limpar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    background: var(--cafc-x-fundo) !important;
    background-color: var(--cafc-x-fundo) !important;
    background-image: none !important;
    color: var(--cafc-x-cor) !important;
    cursor: pointer;
    transition: filter .15s ease;
}

.cafc-wrap button.cafc-limpar:hover { filter: brightness(.94); }
.cafc-wrap .cafc-limpar svg { width: 15px; height: 15px; stroke: currentColor; }
.cafc-wrap .cafc-limpar[hidden] { display: none; }

.cafc-wrap .cafc-spinner {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    border: 2px solid color-mix(in srgb, var(--cafc-cor) 25%, transparent);
    border-top-color: var(--cafc-cor);
    border-radius: 50%;
    animation: cafc-girar .7s linear infinite;
}

.cafc-wrap .cafc-spinner[hidden] { display: none; }

@keyframes cafc-girar { to { transform: rotate(360deg); } }

/* ---------- Botão opcional ---------- */

.cafc-wrap .cafc-botao,
.cafc-wrap a.cafc-botao,
.cafc-wrap button.cafc-botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 42px;
    padding: 0 22px;
    border: 0 !important;
    border-radius: calc(var(--cafc-radius) + 2px);
    background-color: var(--cafc-cor) !important;
    background-image: none !important;
    color: var(--cafc-cor-botao-texto) !important;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
    transition: filter .15s ease, transform .15s ease;
}

.cafc-wrap .cafc-botao:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cafc-wrap .cafc-botao:active { transform: translateY(0); }

/* ---------- Painel de resultados ---------- */

.cafc-wrap .cafc-painel {
    position: absolute;
    z-index: 9999;
    left: 0;
    right: 0;
    margin-top: 8px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--cafc-borda);
    border-radius: var(--cafc-radius);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
    text-align: left;
    animation: cafc-surgir .16s ease;
}

.cafc-wrap .cafc-painel[hidden] { display: none; }

@keyframes cafc-surgir {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cafc-wrap .cafc-lista {
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cafc-wrap a.cafc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: calc(var(--cafc-radius) - 4px);
    color: var(--cafc-cor-texto) !important;
    text-decoration: none !important;
    font-size: 15.5px;
    line-height: 1.3;
    transition: background .13s ease;
}

.cafc-wrap a.cafc-item:hover,
.cafc-wrap a.cafc-item.is-ativo {
    background: color-mix(in srgb, var(--cafc-cor) 8%, #fff);
}

.cafc-wrap .cafc-item-pin {
    display: inline-flex;
    flex: 0 0 auto;
    color: color-mix(in srgb, var(--cafc-cor) 70%, #94a3b8);
}

.cafc-wrap .cafc-item-pin svg { width: 17px; height: 17px; }

.cafc-wrap .cafc-item-nome {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cafc-wrap .cafc-item mark {
    background: transparent;
    color: var(--cafc-cor);
    font-weight: 700;
    padding: 0;
}

.cafc-wrap .cafc-uf {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--cafc-suave);
    border: 1px solid var(--cafc-borda);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--cafc-mudo);
}

.cafc-wrap .cafc-item-seta {
    display: inline-flex;
    flex: 0 0 auto;
    color: #cbd5e1;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .15s ease, transform .15s ease;
}

.cafc-wrap .cafc-item:hover .cafc-item-seta,
.cafc-wrap .cafc-item.is-ativo .cafc-item-seta {
    opacity: 1;
    transform: translateX(0);
    color: var(--cafc-cor);
}

.cafc-wrap .cafc-item-seta svg { width: 16px; height: 16px; }

/* ---------- Estado vazio ---------- */

.cafc-wrap .cafc-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 26px 20px 24px;
    text-align: center;
}

.cafc-wrap .cafc-vazio-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: var(--cafc-suave);
    color: var(--cafc-mudo);
}

.cafc-wrap .cafc-vazio-icone svg { width: 21px; height: 21px; }

.cafc-wrap .cafc-vazio strong {
    font-size: 16px;
    color: var(--cafc-cor-texto);
}

.cafc-wrap .cafc-vazio span {
    font-size: 14px;
    line-height: 1.5;
    color: var(--cafc-mudo);
    max-width: 42ch;
}

.cafc-wrap a.cafc-cta {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    border-radius: 999px;
    background: var(--cafc-cor);
    color: var(--cafc-cor-botao-texto) !important;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: filter .15s ease, transform .15s ease;
}

.cafc-wrap a.cafc-cta:hover { filter: brightness(1.07); transform: translateY(-1px); }

/* ---------- Rodapé e lista completa ---------- */

.cafc-wrap .cafc-box p.cafc-contador {
    margin: 12px 0 0;
    padding: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--cafc-cor-contador) !important;
}

.cafc-wrap .cafc-contador strong { color: inherit; font-weight: 700; }

.cafc-wrap .cafc-todas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.cafc-align-center .cafc-todas { justify-content: center; }
.cafc-align-right  .cafc-todas { justify-content: flex-end; }

.cafc-wrap a.cafc-todas-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--cafc-borda);
    border-radius: 999px;
    background: #fff;
    color: var(--cafc-cor-texto) !important;
    font-size: 14px;
    text-decoration: none !important;
    transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.cafc-wrap a.cafc-todas-item:hover {
    border-color: var(--cafc-cor);
    color: var(--cafc-cor) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .07);
}

.cafc-wrap .cafc-todas-item .cafc-uf { padding: 2px 6px; font-size: 10.5px; }

/* ---------- Responsivo ---------- */

@media (max-width: 600px) {
    .cafc-wrap .cafc-campo { padding-left: 13px; }
    .cafc-wrap input.cafc-input { height: 42px; line-height: 42px; font-size: 16px; }
    .cafc-wrap .cafc-lista { max-height: 260px; }
    .cafc-wrap a.cafc-item { padding: 12px 10px; }
    .cafc-wrap .cafc-botao { height: 38px; padding: 0 16px; font-size: 14px; }
}

/* Navegadores sem color-mix: cores sólidas de reserva. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .cafc-wrap .cafc-campo:focus-within { box-shadow: 0 10px 26px rgba(15, 23, 42, .12); }
    .cafc-wrap a.cafc-item:hover,
    .cafc-wrap a.cafc-item.is-ativo { background: #f1f5f9; }
    .cafc-wrap .cafc-item-pin { color: #94a3b8; }
}
