/* =============================================================================
 * Sulminas — Listagens públicas de imóveis
 * Fase 52A (topo compacto) + Fase 52B (cards premium).
 * Carregado SÓ nas páginas de listagem/taxonomia/busca de imóveis
 * (enqueue condicional em houzez-child/functions.php). Não afeta home/single.
 * SEO preservado: nada de display:none em <h1> ou na descrição do termo.
 * Não altera tema pai, query, Elementor, Yoast nem o conteúdo dos imóveis.
 * ========================================================================== */

/* ---- Fase 59A — Design system de verde #A8CF45 (alinhado ao tema pai) -----
   Carrega só em listagens públicas → não vaza p/ CRM. #a8cf45 é claro: texto
   usa o tom escuro (--smcp-green-ink) para legibilidade. */
:root {
    --smcp-green:      #a8cf45;
    --smcp-green-ink:  #4f6e14;
    --smcp-green-hover:#93b833;
    --smcp-green-soft: rgba(168, 207, 69, .18);
}

/* ---- 52A — Topo compacto (migrado do wp_head) ---------------------------- */
.page-title-wrap {
    padding-top: 0 !important;
    padding-bottom: 8px !important;
}
.page-title-wrap .breadcrumb-wrap,
.page-title-wrap .breadcrumb { margin-bottom: 2px !important; }
.page-title h1,
.page-title .page-title-mobile { font-size: 24px !important; line-height: 1.25 !important; }
.taxonomy-description { margin: 6px 0 10px !important; font-size: 13.5px !important; line-height: 1.5 !important; color: #5b6573 !important; }
.taxonomy-description p { margin-bottom: 6px !important; }
.taxonomy-description p:last-child { margin-bottom: 0 !important; }
.listing-tools-wrap { margin-top: 6px !important; margin-bottom: 10px !important; }
.main-wrap.houzez-main-wrap-v2 { padding-top: 0 !important; } 
.listing-wrap { padding-top: 0 !important; }

/* ---- 52B — Cards premium (escopados à grade principal .listing-wrap) ----- */
.listing-wrap .item-listing-wrap {
    background: #fff;
    border-radius: 14px;
    /* sem overflow:hidden — evita cortar labels/badges absolutos (.labels-wrap) do tema pai */
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    transition: box-shadow .18s ease, transform .18s ease;
}
.listing-wrap .item-listing-wrap:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
    transform: translateY(-2px);
}

/* Imagem com preenchimento consistente + cantos arredondados (sem overflow no card) */
.listing-wrap .item-header img { object-fit: cover; border-radius: 10px; }

/* Preço em destaque (verde da marca #a8cf45 em tom escuro p/ contraste sobre branco) */
.listing-wrap .item-price-wrap .item-price {
    font-weight: 800;
    color: var(--smcp-green-ink);
    letter-spacing: -.01em;
}

/* Título mais limpo */
.listing-wrap .item-title a {
    font-weight: 700;
    line-height: 1.3;
    color: #1f2937;
    /* Fase 69K-C — só nos cards das listagens públicas (.listing-wrap): CAIXA ALTA,
       UMA linha, excesso com reticências, sem aumentar a altura do card. A single do
       imóvel NÃO usa .listing-wrap, então o título da página individual não é afetado. */
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
    max-width: 100%;
}
/* Fase 69K-C (correção do estouro) — o ellipsis só age se a cadeia flex puder ENCOLHER.
   Todo flex item tem `min-width:auto` por padrão e não reduz abaixo do conteúdo `nowrap`,
   então o título empurrava o card e invadia a lateral. Damos `min-width:0` ao corpo do
   card, à linha do título (.d-flex) e ao h2.item-title. Escopado a .listing-wrap → não
   afeta a single (título = h1.page-title, fora de .listing-wrap). */
.listing-wrap .item-body,
.listing-wrap .item-body > .d-flex,
.listing-wrap .item-title { min-width: 0; max-width: 100%; }
.listing-wrap .item-title { width: 100%; }
.listing-wrap .item-title a:hover { color: var(--smcp-green-ink); }

/* Localização (cidade/bairro) discreta, mas legível */
.listing-wrap .item-address { color: #6b7280; }

/* Área / quartos / banheiros / vagas legíveis */
.listing-wrap .item-amenities li,
.listing-wrap .item-amenities-text { color: #475569; }

/* Rodapé do card com leve separação */
.listing-wrap .item-footer { border-top: 1px solid #f1f5f9; }

/* ---- Mobile -------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .page-title-wrap { padding: 8px 0 !important; }
    .page-title h1,
    .page-title .page-title-mobile { font-size: 20px !important; }
    .taxonomy-description { font-size: 13px !important; margin: 5px 0 8px !important; }
    /* Removido: padding-top:6px mobile do .main-wrap.houzez-main-wrap-v2 (mesma faixa branca). */

    .listing-wrap .item-listing-wrap { border-radius: 12px; }
    .listing-wrap .item-price-wrap .item-price { font-size: 17px; }
    .listing-wrap .item-footer { padding-top: 8px; }
}

/* ---- Fase 67B — título mais largo no MODO LISTA (desktop ≥1200px) --------- */
/* Permite que o título use até 600px (vs. ~262px do pai), reduzindo quebras   */
/* desnecessárias. Só no list-view e só no desktop — mobile/grid intactos.     */
@media (min-width: 1200px) {
    .list-view .item-body .item-title { max-width: 600px; }
}

/* ── Contador de resultados: oculto p/ VISITANTES (deslogados); mantido p/ logados ──
   Centralizado via body:not(.logged-in) — cobre busca, taxonomias, arquivos e mapa,
   sem editar templates do pai. NÃO altera query/paginação/cards: só esconde o número
   + rótulo ("771 Imóveis Disponíveis", "511 Imóveis"). Usuário logado vê normalmente. */
/* Busca: <strong>N Imóveis Disponíveis</strong> dentro de .listing-tools-wrap */
body:not(.logged-in) .listing-tools-wrap .flex-grow-1 > strong,
/* Taxonomias/arquivos: <div class="listings-count">N Imóveis</div> */
body:not(.logged-in) .listing-tools-wrap .listings-count,
/* Mapa/half-map: número em #total-results */
body:not(.logged-in) #total-results {
    display: none !important;
}
/* Mapa/half-map: o rótulo "Imóveis Disponíveis" fica FORA do #total-results —
   esconde a linha inteira do título (navegadores com :has(); fallback acima cobre o número). */
body:not(.logged-in) .page-title-wrap .page-title:has(#total-results) {
    display: none !important;
}

/* ── Etiquetas (property_label): intro no topo + descrição completa pós-listagem ──
   Escopado às classes que só existem nas páginas de etiqueta. */
.tax-property_label .smcp-label-intro {
    margin: 0 0 18px;
    color: #4b5563;
    font-size: 15px;
}
.tax-property_label .smcp-label-full {
    margin: 30px auto 6px;
    padding-top: 22px;
    border-top: 1px solid #e5e7eb;
    color: #374151;
    max-width: 980px;
}
.tax-property_label .smcp-label-intro p,
.tax-property_label .smcp-label-full p {
    margin: 0 0 12px;
    line-height: 1.7;
}
.tax-property_label .smcp-label-intro a,
.tax-property_label .smcp-label-full a {
    color: #1e8e4f;
    text-decoration: underline;
}
.tax-property_label .smcp-label-intro a:hover,
.tax-property_label .smcp-label-full a:hover { color: #167a43; }

/* ── Cards de listagem (override do child em item-list-v7): ordem do card é
   Título · Descrição curta (2 linhas) · Cidade · rodapé [características à esquerda + valor
   à direita]. A ORDEM é nativa no DOM (template override); aqui só ancoramos o rodapé ao
   fundo do card e limitamos a descrição a 2 linhas. Escopado a .listing-view (não single). */
.listing-view .smcp-item-body { display: flex; flex-direction: column; height: 100%; }
.listing-view .smcp-item-body > .item-amenities:empty { display: none; } /* linha de labels vazia */
.listing-view .smcp-item-desc {
	margin: 4px 0 8px; color: #64748b; font-size: 13.5px; line-height: 1.45;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.listing-view .smcp-item-foot { margin-top: auto; }                /* fixa o rodapé do corpo ao fundo */
.listing-view .smcp-item-foot .item-price-wrap { margin-bottom: 0; white-space: nowrap; }
.listing-view .smcp-item-foot .smcp-item-foot-feats { min-width: 0; }
@media (max-width: 575.98px) {
	.listing-view .smcp-item-foot { gap: 8px; }
}
