/* ── Wrapper geral ── */
.detalhe-wrap {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 20px 40px;
}

.detalhe-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.detalhe-topbar-acoes {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .detalhe-topbar {
        gap: 10px;
    }
    .detalhe-topbar-acoes {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        background: #f8fafc;
        border: 1px solid #eef2f6;
        border-radius: 12px;
        padding: 10px;
    }
    .detalhe-topbar-acoes > * { flex: 0 1 auto; justify-content: center; }
}

.btn-voltar {
    font-size: 14px;
    color: #0066b2;
    text-decoration: none;
    font-weight: 600;
}

.btn-voltar:hover { text-decoration: underline; }

.btn-editar {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #0066b2;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background .18s;
}

.btn-editar:hover { background: #00508f; }

/* ── Layout 2 colunas ── */
.detalhe-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 28px;
    align-items: start;
    align-items: start;
}

.detalhe-col-esq {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* título duplicado para mobile — escondido no desktop */
.info-titulo-mobile { display: none; }

@media (max-width: 820px) {
    .detalhe-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* dissolve a coluna esquerda para que seus filhos diretos
       participem da grade e possam ser reordenados */
    .detalhe-col-esq {
        display: contents;
    }

    /* ordem mobile: título → galeria → valor/stats/endereço → descrição/características */
    .info-titulo-mobile { display: block; order: 1; }
    .galeria             { order: 2; }
    .info-card           { order: 3; }
    .detalhe-descricao   { order: 4; }

    /* esconde título e badges que ficam no info-card no desktop */
    .info-card .info-badges,
    .info-card h1 { display: none; }
}

/* ── Galeria ── */
.galeria-viewer {
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.galeria-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s, background .2s;
}

.galeria-viewer:hover .galeria-arrow { opacity: 1; }
.galeria-arrow:hover { background: rgba(0,0,0,.7); }
.galeria-arrow-esq { left: 10px; }
.galeria-arrow-dir { right: 10px; }

.galeria-principal {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.galeria-principal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: opacity .2s;
}

.galeria-principal video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    border-radius: 10px;
}

/* ── Lightbox ── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

.lightbox.ativo {
    opacity: 1;
    pointer-events: all;
}

.lightbox-img-wrap {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrap img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 40px rgba(0,0,0,.6);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    opacity: .8;
    transition: opacity .15s;
    line-height: 1;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s;
}

.lightbox-arrow:hover { background: rgba(255,255,255,.3); }
.lightbox-arrow-esq   { left: 20px; }
.lightbox-arrow-dir   { right: 20px; }

.lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.75);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .5px;
    user-select: none;
}

.galeria {
    overflow: hidden;
    min-width: 0;
}

.galeria-thumbs-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    min-width: 0;
}

.thumb-nav-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,.30);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: background .18s, opacity .18s;
    opacity: .75;
}

.thumb-nav-btn:hover:not(:disabled)  { background: rgba(0,0,0,.60); opacity: 1; }
.thumb-nav-btn:disabled              { opacity: .2; cursor: default; }

.galeria-thumbs {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.galeria-thumbs::-webkit-scrollbar { display: none; }

.thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: .65;
    transition: opacity .2s, border-color .2s;
    display: block;
}

.thumb:hover  { opacity: .9; }
.thumb.ativa  { border-color: #0066b2; opacity: 1; }

.thumb-video {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: .65;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    transition: opacity .2s, border-color .2s;
    flex-shrink: 0;
}

.thumb-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.thumb-video-icon {
    position: absolute;
    color: #fff;
    font-size: 20px;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
    pointer-events: none;
}

.thumb-video:hover { opacity: .9; }
.thumb-video.ativa { border-color: #0066b2; opacity: 1; }

.thumb-wrap {
    position: relative;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: inline-flex;
}

.thumb-capa-badge {
    position: absolute;
    bottom: 3px;
    left: 3px;
    background: rgba(249,168,37,.9);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    padding: 3px 4px;
    border-radius: 5px;
    pointer-events: none;
}

/* Setas sempre visíveis em dispositivos touch */
@media (pointer: coarse) {
    .galeria-arrow { opacity: 1 !important; }
}

.sem-foto-detalhe {
    aspect-ratio: 16 / 9;
    background: #e9ecef;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #adb5bd;
}

/* ── Info card ── */
.info-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,.09);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-tipo        { background: #e3f0fb; color: #0066b2; }
.badge-finalidade  { background: #e8f8ef; color: #1a7a42; }

.info-card h1 {
    font-size: 20px;
    color: #2c3e50;
    line-height: 1.3;
    margin: 0;
}

.preco-principal {
    font-size: 26px;
    font-weight: 700;
    color: #0066b2;
    margin: 0;
}

/* ── Stats ── */
.info-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 100px;
}

.stat-icone { font-size: 18px; }

.stat-valor {
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
}

.stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

/* ── Endereço ── */
.info-endereco h3 {
    font-size: 14px;
    color: #555;
    margin: 0 0 6px;
    font-weight: 600;
}

.info-endereco p {
    font-size: 14px;
    color: #444;
    margin: 2px 0;
    line-height: 1.5;
}

/* ── Mapa no card ── */
.mapa-detalhe-wrap {
    position: relative;
}

#mapa-detalhe {
    height: 200px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.btn-ver-mapa {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 500;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: background .15s, color .15s, border-color .15s;
}
.btn-ver-mapa:hover {
    background: #0066b2;
    color: #fff;
    border-color: #0066b2;
}
.btn-ver-mapa i { font-size: 14px; }

/* ── Mapa expandido (modal centralizado) ──────────────────────── */
.mapa-cheio {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.mapa-cheio.ativo {
    opacity: 1;
    pointer-events: all;
}

.mapa-cheio-card {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 80vh;
    max-height: 640px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 50px rgba(0,0,0,.4);
    display: flex;
    flex-direction: column;
    transform: scale(.96);
    transition: transform .25s;
}
.mapa-cheio.ativo .mapa-cheio-card {
    transform: scale(1);
}

.mapa-cheio-header {
    flex-shrink: 0;
    background: #fff;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 56px 14px 18px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
}
.mapa-cheio-header i { color: #0066b2; font-size: 17px; flex-shrink: 0; }
.mapa-cheio-header span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.mapa-cheio-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 11;
    background: #f1f5f9;
    border: none;
    color: #1e293b;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s, transform .15s;
}
.mapa-cheio-close:hover {
    background: #c0392b;
    color: #fff;
    transform: scale(1.05);
}

#mapa-cheio-canvas {
    flex: 1;
    width: 100%;
    min-height: 0;
}

@media (max-width: 600px) {
    .mapa-cheio { padding: 12px; }
    .mapa-cheio-card {
        height: 85vh;
        max-height: none;
        border-radius: 10px;
    }
    .mapa-cheio-header {
        padding: 12px 50px 12px 14px;
        font-size: 13px;
        min-height: 48px;
    }
    .mapa-cheio-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .btn-ver-mapa {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ── Anunciante (dentro do info-card) ── */
.info-anunciante {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 2px solid #f0f4fa;
}

.info-anunciante-titulo {
    font-size: 11px;
    font-weight: 700;
    color: #0055a4;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin: 0 0 12px;
}

.anunciante-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.anunciante-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e3f0fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #0055a4;
    flex-shrink: 0;
    overflow: hidden;
}

.anunciante-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

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

.anunciante-nome {
    font-size: 16px;
    font-weight: 700;
    color: #1e2d3d;
    text-decoration: none;
    transition: color .15s;
}

.anunciante-nome:hover { color: #0055a4; }

.anunciante-creci {
    font-size: 12px;
    color: #6b7a8d;
}

.anunciante-contatos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.anunciante-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: opacity .15s;
}

.anunciante-btn:hover { opacity: .85; }
.anunciante-btn-tel   { background: #e3f0fb; color: #0055a4; }
.anunciante-btn-wpp   { background: #e8f8ef; color: #0ea673; }
.anunciante-btn-email { background: #f4f7fb; color: #555; }

/* ── Descrição ── */
.detalhe-descricao {
    background: #fff;
    border-radius: 10px;
    padding: 24px 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.detalhe-descricao h2 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e9ec;
}

.detalhe-descricao p {
    font-size: 15px;
    color: #444;
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── Características (dentro do mesmo card de descrição) ── */
.detalhe-descricao-sep {
    border: none;
    border-top: 2px solid #e5e9ec;
    margin: 20px 0;
}

.caract-basicas-detalhe {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.caract-basica-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-bg, #f0f6ff);
    color: var(--primary, #0055a4);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
}

.caract-basica-item i { font-size: 14px; }

.caract-grupos-detalhe {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.caract-grupo-detalhe h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #6b7a8d;
    margin: 0 0 8px;
}

.caract-grupo-detalhe ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.caract-grupo-detalhe li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #2c3e50;
}

.caract-grupo-detalhe li i {
    color: #0ea673;
    font-size: 13px;
    flex-shrink: 0;
}


/* ── Views counter ── */
.detalhe-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #6b7a8d;
    background: #f0f4fa;
    border: 1.5px solid #e2e8f0;
    padding: 5px 12px;
    border-radius: 8px;
}

/* ── Website do anunciante ── */
.anunciante-website {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #0055a4;
    text-decoration: none;
    margin-top: 2px;
    word-break: break-all;
}
.anunciante-website:hover { text-decoration: underline; }
