/* ==========================================
   SITE PÚBLICO — ESTILO INSTITUCIONAL
   Inspirado em moreiraimobi.com.br
   ========================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333; line-height: 1.6; background: #f5f6f8;
}
a { color: var(--cor-primaria, #1a73e8); text-decoration: none; }
a:hover { opacity: 0.85; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ==========================================
   HEADER — 2 CAMADAS
   ========================================== */
.site-header { background: #fff; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }

/* -- Top Bar -- */
.top-bar { background: var(--cor-primaria, #1a73e8); color: #fff; font-size: 0.82em; padding: 6px 0; display: block; width: 100%; }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.top-bar-left { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; flex-shrink: 0; }
.top-bar-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.top-bar-link { color: rgba(255,255,255,0.9); display: inline-flex; align-items: center; gap: 5px; transition: color .2s; white-space: nowrap; flex-shrink: 0; }
.top-bar-link:hover { color: #fff; }
.top-bar-link i { font-size: 0.85em; }
.top-bar-location { opacity: 0.75; }

/* -- Main Bar -- */
.main-bar { background: #fff; padding: 8px 0; }
.main-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo-header { flex-shrink: 0; }
.logo-header img { max-height: 65px; width: auto; display: block; }
.logo-header { font-size: 1.3em; font-weight: 700; color: var(--cor-primaria, #1a73e8); }

/* Menu */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > a,
.main-nav > div > a.dropdown-trigger {
    color: #444; padding: 8px 16px; border-radius: 6px; font-size: 0.95em; font-weight: 500;
    transition: background .2s, color .2s; white-space: nowrap;
}
.main-nav > a:hover,
.main-nav > div > a.dropdown-trigger:hover { background: var(--cor-primaria, #1a73e8); color: #fff; }

/* Dropdown submenu */
.nav-item-dropdown { position: relative; }
.nav-item-dropdown .dropdown-trigger { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.nav-item-dropdown .dropdown-trigger i { font-size: 0.7em; transition: transform .2s; }
.nav-item-dropdown:hover .dropdown-trigger i { transform: rotate(180deg); }
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 180px;
    background: #fff; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    padding: 6px; z-index: 999; border: 1px solid #eee;
}
.nav-item-dropdown:hover .dropdown-menu { display: flex; flex-direction: column; }
.dropdown-menu a {
    color: #444 !important; padding: 10px 16px; border-radius: 6px; font-size: 0.92em;
    transition: background .2s; white-space: nowrap; font-weight: 400;
}
.dropdown-menu a:hover { background: #f5f5f5 !important; color: var(--cor-primaria, #1a73e8) !important; }

/* Login nav link */
.main-nav .nav-login {
    background: var(--cor-primaria, #1a73e8); color: #fff !important; padding: 8px 18px;
    border-radius: 6px; font-weight: 600;
}
.main-nav .nav-login:hover { opacity: 0.9; background: var(--cor-primaria, #1a73e8) !important; }

.menu-toggle { display: none; background: none; border: none; font-size: 1.5em; color: #444; cursor: pointer; padding: 6px; }

/* ==========================================
   FILTER BAR — DESTACADA
   ========================================== */
.filter-bar {
    background: var(--cor-primaria, #1a73e8); padding: 14px 0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}
.filter-form { width: 100%; }
.filter-row {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.filter-group { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 3px; }
.filter-label {
    font-size: 0.72em; font-weight: 600; color: rgba(255,255,255,0.85);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.filter-group select,
.filter-group input {
    width: 100%; padding: 9px 11px; border: none; border-radius: 5px;
    font-size: 0.88em; background: #e8ecf0; color: #333;
    outline: none; transition: box-shadow .2s, background .2s;
}
.filter-group select:focus,
.filter-group input:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
    background: #f0f2f5;
}
.filter-group-btn { flex: 0 0 auto; }
.btn-filter {
    padding: 10px 22px; background: #fff; color: var(--cor-primaria, #1a73e8);
    border: none; border-radius: 6px; font-size: 0.9em; font-weight: 600;
    cursor: pointer; transition: background .2s, transform .1s; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-filter:hover { background: #f0f0f0; transform: translateY(-1px); }

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    background: linear-gradient(135deg, var(--cor-primaria, #1a73e8), color-mix(in srgb, var(--cor-primaria, #1a73e8) 70%, #000));
    color: #fff; text-align: center; padding: 70px 20px;
}
.hero h1 { font-size: 2.4em; margin-bottom: 12px; font-weight: 700; }
.hero p { font-size: 1.15em; margin-bottom: 28px; opacity: 0.9; }
.hero .btn {
    display: inline-block; padding: 14px 36px; background: #fff; color: var(--cor-primaria, #1a73e8);
    border-radius: 6px; font-weight: 600; font-size: 1em; transition: transform .2s;
}
.hero .btn:hover { transform: translateY(-2px); }

/* ==========================================
   SECTIONS
   ========================================== */
.section { padding: 50px 0; }
.section h2 { margin-bottom: 28px; font-size: 1.5em; font-weight: 700; color: #222; position: relative; padding-bottom: 10px; }
.section h2::after { content: ''; position: absolute; bottom: 0; left: 0; width: 50px; height: 3px; background: var(--cor-primaria, #1a73e8); border-radius: 2px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.section-header h2 { margin-bottom: 0; }

/* ==========================================
   CARDS — GRADE 3 COLUNAS
   ========================================== */
.grid-imoveis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.card-imovel {
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); display: block; color: #333;
    transition: transform .25s, box-shadow .25s;
}
.card-imovel:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }

.card-img-wrap {
    position: relative; overflow: hidden; height: 210px;
}
.card-img-wrap img {
    width: 100%; height: 100%; object-fit: cover; transition: transform .4s;
}
.card-imovel:hover .card-img-wrap img { transform: scale(1.05); }

/* Selos sobre a foto */
.card-badges {
    position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap;
    z-index: 2;
}
.badge {
    display: inline-block; padding: 4px 10px; border-radius: 4px;
    font-size: 0.72em; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: #fff;
}
.badge-destaque { background: #f59e0b; }
.badge-lancamento { background: #10b981; }
.badge-pronto_morar { background: #3b82f6; }
.badge-finalidade {
    background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
}
.badge-venda { background: var(--cor-primaria, #1a73e8); }
.badge-aluguel { background: #e67e22; }

.card-body { padding: 16px 18px 18px; }
.card-body h3 { font-size: 1em; font-weight: 600; margin-bottom: 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-location { font-size: 0.82em; color: #888; margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.card-price { font-size: 1.25em; font-weight: 700; color: var(--cor-primaria, #1a73e8); margin-bottom: 10px; }
.card-price small { font-size: 0.6em; font-weight: 400; color: #888; }

.card-icons {
    display: flex; gap: 10px; flex-wrap: wrap; padding-top: 10px;
    border-top: 1px solid #eee; font-size: 0.82em; color: #666;
}
.card-icons span { display: inline-flex; align-items: center; gap: 4px; }
.card-icons i { color: var(--cor-primaria, #1a73e8); font-size: 0.9em; }

/* ==========================================
   LISTAGEM — PÁGINA INTEIRA
   ========================================== */
.listagem-header { margin-bottom: 25px; }
.listagem-header h1 { font-size: 1.5em; font-weight: 700; color: #222; }
.listagem-count { color: #888; font-size: 0.9em; margin-top: 4px; }

/* ==========================================
   DETALHE DO IMÓVEL
   ========================================== */
.imovel-detalhe { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; margin-top: 15px; }
.imovel-galeria { grid-column: 1; }
.imovel-info { grid-column: 2; }
.imovel-contato { grid-column: 1 / -1; }

.breadcrumb { margin-bottom: 12px; color: #888; font-size: 0.88em; }
.breadcrumb a { color: var(--cor-primaria, #1a73e8); }

.galeria-principal {
    position: relative;
}
.galeria-principal img { width: 100%; height: 420px; object-fit: cover; border-radius: 10px; transition: opacity .3s; }
.galeria-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.galeria-thumbs img { width: 84px; height: 62px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: 0.7; transition: opacity .2s, transform .2s; }
.galeria-thumbs img:hover { opacity: 1; transform: scale(1.05); }

.endereco { color: #666; margin-bottom: 12px; font-size: 0.95em; }
.preco-destaque { font-size: 1.6em; font-weight: 700; color: var(--cor-primaria, #1a73e8); margin: 12px 0; }
.caracteristicas { display: flex; gap: 10px; margin: 15px 0; flex-wrap: wrap; }
.caracteristicas span { background: #f0f2f5; padding: 6px 14px; border-radius: 6px; font-size: 0.9em; display: inline-flex; align-items: center; gap: 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag { background: #e8f0fe; color: var(--cor-primaria, #1a73e8); padding: 4px 12px; border-radius: 20px; font-size: 0.85em; }
.descricao { margin: 20px 0; line-height: 1.8; }
.descricao h3 { margin-bottom: 10px; font-size: 1.1em; }
.video iframe { width: 100%; height: 300px; border-radius: 8px; margin: 15px 0; }
.corretor-info { background: #f8f9fa; padding: 15px 20px; border-radius: 8px; margin: 15px 0; border-left: 3px solid var(--cor-primaria, #1a73e8); }
.corretor-info h3 { margin-bottom: 8px; }

/* Contato no detalhe */
.imovel-contato { background: #fff; padding: 25px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.imovel-contato h3 { margin-bottom: 15px; }
.imovel-contato form { display: grid; gap: 12px; }
.imovel-contato input, .imovel-contato textarea { padding: 11px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95em; }
.imovel-contato input:focus, .imovel-contato textarea:focus { outline: none; border-color: var(--cor-primaria, #1a73e8); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.imovel-contato .btn { width: 100%; padding: 13px; background: var(--cor-primaria, #1a73e8); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 1em; transition: opacity .2s; }
.imovel-contato .btn:hover { opacity: 0.9; }

#form-resposta { margin-top: 10px; padding: 12px 16px; border-radius: 6px; display: none; font-size: 0.95em; }
#form-resposta.form-ok { display: block; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#form-resposta.form-erro { display: block; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Share */
.share-box { margin-top: 18px; padding-top: 15px; border-top: 1px solid #eee; }
.share-box span { color: #888; font-size: 0.88em; margin-right: 10px; }
.share-box a { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; font-size: 0.9em; }

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty { text-align: center; padding: 60px 20px; color: #999; font-size: 1.05em; }
.empty i { font-size: 3em; margin-bottom: 15px; color: #ddd; }

/* ==========================================
   FOOTER — 4 COLUNAS
   ========================================== */
.site-footer {
    background: #1a1a2e; color: rgba(255,255,255,0.85); padding: 55px 0 0;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
    gap: 35px;
    margin-bottom: 35px;
}
.footer-logo { max-height: 50px; width: auto; margin-bottom: 10px; }
.footer-logo-text { font-size: 1.2em; color: #fff; margin-bottom: 8px; }
.footer-slogan { font-size: 0.88em; opacity: 0.7; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: 1em; font-weight: 600; margin-bottom: 16px; position: relative; padding-bottom: 8px; }
.footer-col h4::after { content: ''; position: absolute; bottom: 0; left: 0; width: 30px; height: 2px; background: var(--cor-primaria, #1a73e8); }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.88em; transition: color .2s; display: inline-flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: #fff; }
.footer-links a::before { content: '›'; font-weight: 700; color: var(--cor-primaria, #1a73e8); }

.footer-contact { list-style: none; }
.footer-contact li { margin-bottom: 10px; }
.footer-contact a { color: rgba(255,255,255,0.7); font-size: 0.88em; display: inline-flex; align-items: center; gap: 8px; transition: color .2s; }
.footer-contact a:hover { color: #fff; }
.footer-contact i { width: 16px; color: var(--cor-primaria, #1a73e8); }

.footer-social { display: flex; gap: 10px; margin-top: 15px; }
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.08); color: #fff;
    transition: background .2s, transform .2s;
}
.footer-social a:hover { background: var(--cor-primaria, #1a73e8); transform: scale(1.1); }

.footer-bottom {
    text-align: center; padding: 18px 0; border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.82em; opacity: 0.6;
}

/* ==========================================
   PÁGINA SOBRE — DUAS COLUNAS
   ========================================== */
.sobre-section {
    padding: 60px 0;
}

.sobre-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 50px;
    align-items: start;
}

/* Coluna esquerda */
.sobre-texto h1 {
    font-size: 28px;
    margin-bottom: 24px;
    color: #1a1a1a;
}
.sobre-texto p {
    color: #444;
    line-height: 1.8;
    margin-bottom: 18px;
    font-size: 15px;
}

/* Coluna direita: card */
.sobre-card {
    background: #eef0f3;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
}
.sobre-card-foto {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.sobre-card-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sobre-card-nome {
    font-size: 24px;
    font-weight: 700;
    color: var(--cor-primaria, #1a73e8);
    margin-bottom: 6px;
}
.sobre-card-cargo {
    font-size: 15px;
    font-weight: 600;
    color: var(--cor-primaria, #1a73e8);
    margin-bottom: 20px;
}
.sobre-card-bio {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
}

/* ==========================================
   RESPONSIVO
   ========================================== */
@media (max-width: 1024px) {
    .grid-imoveis { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    /* Header mobile */
    .top-bar { font-size: 0.75em; padding: 5px 0; }
    .top-bar-left, .top-bar-right { gap: 10px; }
    .top-bar-location { display: none; }

    .main-bar { padding: 6px 0; }
    .logo-header img { max-height: 45px; }
    .menu-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        background: #fff; flex-direction: column; padding: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-radius: 0 0 10px 10px;
        z-index: 999;
    }
    .main-nav.open { display: flex; }
    .main-nav.open > a,
    .main-nav.open .dropdown-trigger {
        padding: 10px 14px; border-radius: 6px; border-bottom: 1px solid #f0f0f0; color: #444;
    }
    .main-nav.open > a:last-of-type { border-bottom: none; }
    .main-nav.open > a:hover,
    .main-nav.open .dropdown-trigger:hover { color: #fff; }

    /* Dropdown no mobile — vira expansão inline */
    .main-nav.open .nav-item-dropdown { display: flex; flex-direction: column; }
    .main-nav.open .dropdown-menu {
        display: flex; position: static; box-shadow: none; border: none;
        padding: 0 0 0 16px; background: transparent; min-width: auto;
    }
    .main-nav.open .dropdown-menu a {
        color: #666 !important; padding: 8px 14px; font-size: 0.9em;
        border-bottom: 1px solid #f0f0f0;
    }
    .main-nav.open .dropdown-menu a:hover { background: transparent !important; color: var(--cor-primaria, #1a73e8) !important; }
    .main-nav.open .dropdown-trigger i { display: none; }
    .main-nav.open .nav-login { background: var(--cor-primaria, #1a73e8); color: #fff !important; }

    /* Filtros mobile */
    .filter-bar { padding: 10px 0; }
    .filter-row { gap: 6px; }
    .filter-group { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
    .filter-group-btn { min-width: 100%; flex: 1 1 100%; }
    .btn-filter { width: 100%; justify-content: center; }

    /* Grid */
    .grid-imoveis { grid-template-columns: 1fr; }
    .card-img-wrap { height: 200px; }

    /* Detalhe */
    .imovel-detalhe { grid-template-columns: 1fr; }
    .imovel-info { grid-column: 1; }
    .imovel-contato { grid-column: 1; }
    .galeria-principal img { height: 250px; }

    /* Hero */
    .hero { padding: 45px 20px; }
    .hero h1 { font-size: 1.6em; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 25px; }
    .footer-brand { order: -1; }

    /* Sobre */
    .sobre-grid { grid-template-columns: 1fr; }
    .sobre-card { order: -1; }
}

@media (max-width: 480px) {
    .top-bar-left .top-bar-link:nth-child(n+3) { display: none; }
    .top-bar-right .top-bar-link:first-child { display: none; }
    .card-img-wrap { height: 190px; }
    .section { padding: 30px 0; }
}
/* --- Lightbox profissional (galeria do imóvel) --- */
.imovel-lightbox { position: fixed; inset: 0; z-index: 99999; display: none; font-family: inherit; }
.imovel-lightbox .lb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.92); }
.imovel-lightbox .lb-conteudo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 92vw; max-height: 90vh; text-align: center; }
.imovel-lightbox .lb-conteudo img { max-width: 92vw; max-height: 82vh; border-radius: 8px; object-fit: contain; transition: opacity .15s; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.imovel-lightbox .lb-caption { margin-top: 10px; color: #fff; font-size: .85rem; opacity: .85; }
.imovel-lightbox .lb-close { position: absolute; top: 18px; right: 22px; z-index: 2; background: rgba(255,255,255,.12); color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 1.7rem; cursor: pointer; transition: background .2s; }
.imovel-lightbox .lb-close:hover { background: rgba(255,255,255,.25); }
.imovel-lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(255,255,255,.12); color: #fff; border: none; width: 50px; height: 70px; border-radius: 10px; font-size: 1.4rem; cursor: pointer; transition: background .2s; display:flex; align-items:center; justify-content:center; }
.imovel-lightbox .lb-nav:hover { background: rgba(255,255,255,.28); }
.imovel-lightbox .lb-prev { left: 16px; }
.imovel-lightbox .lb-next { right: 16px; }
.galeria-principal-zoom img { cursor: zoom-in; }
.galeria-principal { position: relative; }
@media (max-width: 575.98px) {
    .imovel-lightbox .lb-nav { width: 42px; height: 56px; }
    .imovel-lightbox .lb-prev { left: 6px; }
    .imovel-lightbox .lb-next { right: 6px; }
    .imovel-lightbox .lb-close { top: 10px; right: 12px; width: 40px; height: 40px; }
}
