/* app.css - estilos base para a lista de imóveis */
:root {
    --accent: #16736d;
    --muted: #6b7280;
    --card-bg: #ffffff
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: system-ui,-apple-system,Roboto,Segoe UI,Arial,sans-serif;
    background: #eef3f2;
    color: #08332f;
    display: flex;
    justify-content: center
}
/* app-shell simula tela de app centrada no desktop */
.app-shell {
    width: 100%;
    max-width: 420px;
    margin: 18px 12px;
    background: transparent
}
/* conteúdo interno com cantos e sombra */
.app-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(6,22,19,0.08);
    overflow: hidden;
    border: 1px solid rgba(15,59,54,0.04)
}

main {
    padding: 0
}

.app-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f4f3;
    background: linear-gradient(90deg,var(--accent),#0f7b6f);
    color: #fff
}

.app-title {
    font-weight: 700;
    font-size: 17px
}

.app-sub {
    font-size: 13px;
    opacity: 0.95
}

.count-badge {
    background: rgba(255,255,255,0.12);
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 700
}

.content {
    padding: 12px
}

.count {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px
}

.filters-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 20px;
    overflow-x: auto;
    padding: 8px 4px;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(0,0,0,0.03)
}

    .filters-container::-webkit-scrollbar {
        display: none
    }

.uf-filter {
    flex-shrink: 0;
    position: relative
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font: inherit;
    border: 2px solid rgba(22,115,109,0.18);
    background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2316736d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 12px;
    padding: 12px 38px 12px 18px;
    border-radius: 16px;
    font-weight: 800;
    color: var(--accent);
    cursor: pointer;
    font-size: 15px;
    min-width: 90px;
    transition: all .2s ease;
    box-shadow: 0 3px 10px rgba(22,115,109,0.08);
}

    .filter-select:hover {
        border-color: var(--accent);
        background-color: rgba(22,115,109,0.03);
        transform: translateY(-1px)
    }

    .filter-select:focus {
        outline: 2px solid rgba(22,115,109,0.25);
        outline-offset: 1px
    }

    .filter-select::-ms-expand {
        display: none
    }

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* permitir quebra em várias linhas para mostrar todos os botões */
    align-items: center
}

/* botão de filtro — bloco único (antes havia duplicata que causava conflito de cascata) */
.filter-btn {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font: inherit;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis: none;
    white-space: nowrap;
    border: 2px solid rgba(6,22,19,0.06);
    padding: 12px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    background: #fff;
    color: inherit;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.03);
    transition: all .2s ease;
}

    .filter-btn::-moz-focus-inner {
        border: 0;
        padding: 0
    }

    .filter-btn:focus {
        outline: 2px solid rgba(22,115,109,0.2);
        outline-offset: 1px;
        box-shadow: none
    }

    .filter-btn:hover:not(.active) {
        transform: translateY(-1px);
        border-color: rgba(0,0,0,0.1)
    }

    .filter-btn.active {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
        box-shadow: 0 4px 12px rgba(22,115,109,0.25);
    }

.more-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(22,115,109,0.06);
    color: var(--accent);
}

    .more-filters-btn svg {
        width: 16px;
        height: 16px
    }

    .more-filters-btn.active {
        background: rgba(22,115,109,0.15);
        color: var(--accent);
        border-color: var(--accent)
    }

.advanced-filters-panel {
    background: #fff;
    border-radius: 18px;
    padding: 16px;
    margin: 0 0 20px;
    border: 2px solid rgba(22,115,109,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

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

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px
}

    .filter-field label {
        font-size: 12px;
        font-weight: 800;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.5px
    }

.filter-select-full, .filter-input-full {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font: inherit;
    width: 100%;
    border: 2px solid rgba(0,0,0,0.05);
    background: #f9fafb;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    color: #08332f;
    font-weight: 600;
}

.filter-select-full {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

    .filter-select-full::-ms-expand {
        display: none
    }

    .filter-select-full:focus, .filter-input-full:focus {
        outline: none;
        border-color: var(--accent);
        background-color: #fff;
    }

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px
}

.clear-btn {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font: inherit;
    flex: 1;
    background: rgba(180,35,24,0.05);
    color: #b42318;
    border: 1px solid rgba(180,35,24,0.1);
    padding: 14px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
}

    .clear-btn:hover {
        background: rgba(180,35,24,0.1);
        transform: translateY(-1px)
    }

    .clear-btn:focus {
        outline: 2px solid rgba(180,35,24,0.2);
        outline-offset: 1px
    }

/* better touch appearance and contrast on mobile */
@media (hover: none) and (pointer: coarse) {
    .filter-btn {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 999px
    }

        .filter-btn.active {
            background: var(--accent);
            color: #fff;
            border-color: var(--accent);
            box-shadow: 0 6px 18px rgba(6,22,19,0.06)
        }

        .filter-btn:active {
            transform: translateY(1px);
            opacity: .98
        }
}

/* remove default tap highlight and improve touch response */
.filter-btn, .filter-btn * {
    -webkit-tap-highlight-color: transparent;
}

.filters-sep {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg,rgba(0,0,0,0.04),rgba(0,0,0,0.02));
    margin: 12px 0
}

.list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.item {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 0;
    border-radius: 12px;
    background: linear-gradient(180deg,#ffffff,#fcfffd);
    border: 1px solid rgba(15,59,54,0.04);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

    .item:active {
        transform: scale(.998)
    }

.thumb {
    width: 100%;
    aspect-ratio: 1/1;
    height: auto;
    border-radius: 0;
    overflow: hidden;
    background: #e9efec;
    display: block
}

    .thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block
    }

.body {
    flex: 1;
    min-width: 0;
    padding: 12px
}

.title {
    font-weight: 800;
    font-size: 17px;
    color: #08332f;
    display: block;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis
}

.meta {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center
}

.price {
    color: var(--accent);
    font-weight: 800
}

.address {
    display: block;
    color: #234;
    font-size: 14px;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.chev {
    color: var(--muted);
    flex: 0 0 18px;
    text-align: center
}

.prices {
    display: flex;
    flex-direction: column;
    gap: 4px
}

    .prices .price {
        color: var(--accent);
        font-weight: 700
    }

    .prices .min-price {
        color: var(--muted);
        font-weight: 600;
        font-size: 13px
    }

    .prices .date {
        color: #4b5563;
        font-size: 13px;
        font-weight: 600
    }

.leilao {
    color: #0b5b52;
    font-size: 13px;
    font-weight: 700
}

.leilao-date {
    color: #4b5563;
    font-size: 13px
}

.attrs {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
    flex-wrap: wrap
}

.attrs-left {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}

.attrs .tag {
    background: rgba(16,78,74,0.06);
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
    color: #0f3b36;
    font-weight: 600
}

.attrs-right {
    display: flex;
    align-items: center;
    justify-content: flex-end
}

.tag {
    position: relative
}

    .tag .hint {
        position: absolute;
        right: 0;
        bottom: calc(100% + 8px);
        background: #fff;
        color: #0f172a;
        padding: 8px 10px;
        border-radius: 8px;
        box-shadow: 0 6px 18px rgba(8,20,20,0.12);
        font-size: 13px;
        max-width: 260px;
        display: none;
        z-index: 50
    }

    .tag.show .hint {
        display: block
    }

@media (hover:hover) {
    .tag:hover .hint {
        display: block
    }
}
/* icons for acceptance flags (✅ / 🚫) */
.accept {
    font-size: 15px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

    .accept[title] {
        cursor: help
    }

    .accept.no {
        opacity: 0.85
    }
/* modalidade uses same .tag style now; no separate badge style */
.areas {
    color: #334155;
    font-size: 13px;
    margin: 8px 0 0 0;
    padding: 0
}

.description {
    color: #334155;
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.3em;
    max-height: 3.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical
}

/* acceptance grid at bottom of card */
.accept-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 8px;
    margin-top: 10px
}

.accept-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(16,78,74,0.03);
    border-radius: 8px;
    border: 1px solid rgba(15,59,54,0.04)
}

.accept {
    font-size: 16px
}

.accept-label {
    font-size: 13px;
    color: #0f3b36;
    font-weight: 700
}

/* row actions (buttons for edital/matricula) */
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.05)
}

.action-link {
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 80px;
    text-align: center;
    transition: opacity 0.2s;
}

.action-btn {
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 80px;
    cursor: pointer;
    transition: background 0.2s;
}

.action-link:hover { opacity: 0.9 }
.action-btn:hover { background: rgba(22,115,109,0.05) }

.leiloeiro-container, .external-links-container {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.leiloeiro-text-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s;
}

.leiloeiro-text-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px 0;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(22,115,109,0.2);
}

@media (min-width:700px) {
    .app-shell {
        margin: 28px auto
    }
}
