/* ════════════════════════════════════════════════════════════════════════
   IMOBPRO • PUBLIC CSS
   Páginas públicas: perfil do corretor + página do imóvel
   ══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg:            #f8fafc;
    --surface:       #ffffff;
    --surface-2:     #f1f5f9;
    --text:          #0f172a;
    --text-muted:    #64748b;
    --text-subtle:   #94a3b8;
    --border:        #e2e8f0;
    --border-strong: #cbd5e1;
    --primary:       #4f46e5;
    --primary-soft:  #e0e7ff;
    --whatsapp:      #25d366;
    --whatsapp-dark: #1faa52;
    --shadow-sm:     0 1px 2px 0 rgb(15 23 42 / .04);
    --shadow:        0 1px 3px 0 rgb(15 23 42 / .06), 0 1px 2px -1px rgb(15 23 42 / .04);
    --shadow-md:     0 4px 12px -2px rgb(15 23 42 / .08);
    --shadow-lg:     0 20px 40px -12px rgb(15 23 42 / .15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── HEADER ───────────────────────────────────────────────────────────── */
.public-header {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.public-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: flex; align-items: center; gap: 10px;
}
.brand-mark {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800;
    font-size: 13px;
}
.brand-text {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.02em;
    color: var(--text);
}
.brand-text span { color: var(--primary); }

.header-cta {
    background: var(--whatsapp);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    display: flex; align-items: center; gap: 6px;
    transition: background .15s;
}
.header-cta:hover { background: var(--whatsapp-dark); }

.header-back {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}
.header-back:hover { color: var(--text); }

/* ═══ PERFIL PÚBLICO ════════════════════════════════════════════════════ */

/* ─── HERO ─────────────────────────────────────────────────────────────── */
.public-hero {
    padding: 56px 0 40px;
    background:
        radial-gradient(ellipse at top right, rgba(79,70,229,.08) 0%, transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(124,58,237,.06) 0%, transparent 60%),
        var(--bg);
}

.hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.hero-avatar {
    width: 120px; height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    display: grid; place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 48px;
    box-shadow: 0 12px 32px -8px rgba(79,70,229,.4);
    flex-shrink: 0;
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.hero-eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
}
.hero-info h1 {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin-bottom: 14px;
}

.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag {
    background: var(--text);
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.tag--ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.hero-bio {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 580px;
}

/* ─── BOTÃO WHATSAPP GRANDE ────────────────────────────────────────────── */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--whatsapp);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: background .15s, transform .1s;
    border: 0;
    cursor: pointer;
}
.btn-whatsapp:hover { background: var(--whatsapp-dark); transform: translateY(-1px); }
.btn-whatsapp--lg { padding: 14px 24px; font-size: 15px; border-radius: 12px; }
.btn-whatsapp--block { width: 100%; }

/* ─── LISTAGEM ─────────────────────────────────────────────────────────── */
.public-listings { padding: 24px 0 80px; }

.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
}
.listings-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.listings-count { color: var(--text-muted); font-size: 14px; font-weight: 500; }

.public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.public-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
    display: flex; flex-direction: column;
}
.public-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.public-card-thumb {
    aspect-ratio: 4/3;
    background: var(--surface-2);
    position: relative;
    overflow: hidden;
}
.public-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.public-card:hover .public-card-thumb img { transform: scale(1.05); }
.thumb-placeholder {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    color: var(--text-subtle);
}
.thumb-placeholder svg { width: 48px; height: 48px; }
.thumb-placeholder--lg svg { width: 80px; height: 80px; }

.public-tag {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(15,23,42,.85);
    color: #fff;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    backdrop-filter: blur(8px);
}

.public-card-info { padding: 16px 18px 18px; }
.public-preco {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 6px;
}
.public-titulo {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    min-height: 2.7em;
}
.public-meta { font-size: 13px; color: var(--text-muted); }
.public-features {
    display: flex; flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.empty-public {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

/* ═══ PÁGINA DO IMÓVEL ═════════════════════════════════════════════════ */

.imovel-detail { padding: 32px 0 80px; }

.imovel-cover {
    aspect-ratio: 21/9;
    background: var(--surface-2);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
}
.imovel-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-tag {
    position: absolute;
    top: 16px; left: 16px;
    background: rgba(255,255,255,.95);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    backdrop-filter: blur(10px);
}

.imovel-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

.imovel-localidade {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.imovel-h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin: 8px 0 20px;
}
.imovel-price-big {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -.02em;
    margin-bottom: 24px;
}

.imovel-features-row {
    display: flex; flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.feature-pill {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 8px 12px;
    border-right: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}
.feature-pill:last-child { border-right: 0; }
.feature-pill strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2px;
}

.imovel-desc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}
.imovel-desc h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}
.imovel-desc p {
    color: var(--text-muted);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ─── SIDEBAR DO CORRETOR ──────────────────────────────────────────────── */
.imovel-sidebar { position: sticky; top: 88px; }

.corretor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.corretor-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800;
    font-size: 28px;
    margin-bottom: 14px;
}
.corretor-avatar img { width: 100%; height: 100%; object-fit: cover; }

.corretor-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}
.corretor-info h3 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin: 4px 0 6px;
}
.corretor-creci {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 18px;
}

.btn-link-block {
    display: block;
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}
.btn-link-block:hover { text-decoration: underline; }

/* ─── FOOTER ───────────────────────────────────────────────────────────── */
.public-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 48px;
    background: var(--surface);
}
.public-footer p {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ─── RESPONSIVO ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 28px 20px;
    }
    .hero-avatar { margin: 0 auto; width: 96px; height: 96px; font-size: 36px; }
    .hero-tags { justify-content: center; }
    .hero-info h1 { font-size: 28px; }
    .hero-bio { margin-left: auto; margin-right: auto; }

    .imovel-grid { grid-template-columns: 1fr; gap: 24px; }
    .imovel-sidebar { position: static; }
    .imovel-h1 { font-size: 26px; }
    .imovel-price-big { font-size: 26px; }
    .imovel-cover { aspect-ratio: 16/10; border-radius: 14px; }
}

@media (max-width: 560px) {
    .public-hero { padding: 24px 0; }
    .container { padding: 0 16px; }
    .feature-pill { flex: 1 1 calc(50% - 5px); border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
    .feature-pill:nth-last-child(-n+2) { border-bottom: 0; }
    .public-grid { grid-template-columns: 1fr; }
}
