/* =============================================================
   SITE PÚBLICO — componentes compartilhados
   =============================================================
   Reúne o CSS que estava embutido em <style> dentro de index.php,
   imoveis.php, terrenos.php, apartamentos.php e meus_favoritos.php.

   Os blocos de cabeçalho de página, card de imóvel, botão de favorito,
   estado vazio e botão flutuante eram IDÊNTICOS nas quatro listagens —
   cerca de 200 linhas repetidas em cada arquivo. A única diferença real
   era a cor da etiqueta `.im-tag` por tipo de imóvel, agora expressa por
   modificadores no final deste arquivo.

   Carregado DEPOIS de styles.css, preservando a mesma ordem de cascata
   que os <style> embutidos tinham.
   ============================================================= */

/* ── CABEÇALHO FIXO ────────────────────────────────────────── */

.header.fixed-top {
    /* sticky (e não fixed) mantém o cabeçalho no fluxo normal, sem
       precisar "adivinhar" a altura dele com padding-top no body — era
       o que causava o espaço em branco logo abaixo do cabeçalho. */
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    transition: all 0.3s ease;
}

.header.fixed-top.scrolled {
    background-color: rgba(25, 25, 25, 0.98);
}

.user-area .user-greeting {
    color: #fff;
    font-weight: 600;
}

/* O hambúrguer agora é um <button>: zera o visual padrão de botão e
   amplia a área de toque para 44×44 sem mudar o desenho do ícone
   (36×30, definido em styles.css). */
button.hamburger {
    box-sizing: content-box;
    padding: 7px 4px;
    margin: 0;
    border: 0;
    border-radius: 6px;
    background: none;
}

button.hamburger:focus {
    outline: none;
}

button.hamburger:focus-visible,
.header .btn-login:focus-visible {
    outline: 3px solid #ff9900;
    outline-offset: 2px;
}

/* Celular: menu, logo e login na mesma linha, com o logo centralizado.
   O styles.css esconde o login do cabeçalho nessa largura (com
   !important) e o deixa só dentro do menu; o !important aqui só existe
   para vencer aquela regra. O menu continua com a entrada de login. */
@media (max-width: 768px) {
    .header.fixed-top {
        flex-wrap: nowrap;
        align-items: center;
        min-height: 60px;
        padding: 8px 16px;
    }

    .header.fixed-top > .container {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .header.fixed-top .logo {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: 44px;
        margin: 0;
    }

    .header.fixed-top .user-area {
        display: flex !important;
        width: auto;
        margin: 0 0 0 auto;
    }

    /* "Olá, Fulano" não cabe ao lado do logo; continua no menu */
    .header.fixed-top .user-greeting {
        display: none;
    }

    .header.fixed-top .btn-login {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 14px;
    }
}

/* ── CABEÇALHO DE PÁGINA (listagens) ───────────────────────── */

.page-header {
    background: #1a1a1a;
    padding: 26px 0;
    border-bottom: 3px solid #ff9900;
}

.ph-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ph-crumb {
    font-size: 12px;
    color: rgba(255, 255, 255, .45);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ph-crumb a {
    color: #ff9900;
    text-decoration: none;
}

.ph-crumb a:hover {
    text-decoration: underline;
}

.page-header h1 {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.ph-count {
    background: rgba(255, 153, 0, .12);
    color: #ff9900;
    border: 1px solid rgba(255, 153, 0, .3);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── SEÇÃO DE LISTAGEM ─────────────────────────────────────── */

.imoveis-section {
    padding: 56px 0;
    background: #f7f7f7;
}

/* ── CARD DE IMÓVEL ────────────────────────────────────────── */

.im-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .07);
    transition: transform .3s, box-shadow .3s, opacity .35s;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.im-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .14);
}

.im-card > img {
    height: 210px;
    width: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    filter: none;
    transition: transform .45s;
}

.im-card:hover > img {
    transform: scale(1.05);
}

.im-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.im-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    background: #fff3dc;
    color: #b36a00;
    border-radius: 4px;
    padding: 3px 9px;
    margin-bottom: 8px;
}

.im-city {
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
}

.im-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.im-features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #888;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    margin-bottom: 14px;
}

.im-features span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.im-cta {
    display: block;
    margin-top: auto;
    text-align: center;
    background: #ff9900;
    color: #fff !important;
    padding: 11px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    transition: background .2s;
}

.im-cta:hover {
    background: #e08800;
}

/* Cor da etiqueta por tipo de imóvel — antes, cada página redefinia
   `.im-tag` inteira só para trocar duas cores. */
.imoveis-section--terrenos .im-tag {
    background: #edf7ed;
    color: #2e7d32;
}

.imoveis-section--apartamentos .im-tag {
    background: #e8eaf6;
    color: #3949ab;
}

/* ── BOTÃO DE FAVORITO ─────────────────────────────────────── */

.btn-favorito {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, .45);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #fff;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.btn-favorito:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.btn-favorito.ativo {
    background: #dc3545;
}

/* ── ESTADO VAZIO ──────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #aaa;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
}

.empty-state p {
    color: #aaa;
    margin-bottom: 24px;
}

.btn-browse {
    display: inline-block;
    background: #ff9900;
    color: #fff;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: background .2s;
}

.btn-browse:hover {
    background: #e08800;
    color: #fff;
}

/* ── BOTÃO FLUTUANTE DE FAVORITOS ──────────────────────────── */

#floating-favorite {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 58px;
    height: 58px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 26px;
    box-shadow: 0 4px 16px rgba(220, 53, 69, .4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

#floating-favorite:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(220, 53, 69, .5);
}

/* ── PÁGINA MEUS FAVORITOS ─────────────────────────────────── */

.empty-state--favoritos i {
    font-size: 4rem;
    color: #ddd;
}

.btn-remover {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding: 9px;
    border-radius: 8px;
    background: #fff0f0;
    color: #dc3545;
    border: 1px solid #f5c6cb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    width: 100%;
}

.btn-remover:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.fav-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: #fff;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

/* Na página de favoritos o CTA não é empurrado para o rodapé do card,
   porque abaixo dele ainda existe o botão "Remover". */
.fav-card-wrap .im-cta {
    margin-top: 0;
}

.fav-card-wrap {
    transition: opacity .35s, transform .35s;
}

.fav-card-wrap.removendo {
    opacity: 0;
    transform: scale(0.93);
}

#btn-enviar-corretor {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 26px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(37, 211, 102, .45);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all .3s;
    animation: pulse-green 2.5s infinite;
}

#btn-enviar-corretor:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 10px 28px rgba(37, 211, 102, .55);
    color: white;
    animation: none;
}

#btn-enviar-corretor i {
    font-size: 1.4rem;
}

.badge-contador {
    background: white;
    color: #128C7E;
    border-radius: 50px;
    padding: 1px 9px;
    font-size: .78rem;
    font-weight: 700;
}

@keyframes pulse-green {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(37, 211, 102, .45);
    }

    50% {
        box-shadow: 0 6px 28px rgba(37, 211, 102, .75);
    }
}

@media (max-width: 576px) {

    #btn-enviar-corretor .btn-label,
    #btn-enviar-corretor .badge-contador {
        display: none;
    }

    #btn-enviar-corretor {
        border-radius: 50%;
        padding: 16px;
        width: 60px;
        height: 60px;
        justify-content: center;
    }
}
