/* ══ GALERIA ═══════════════════════════════════════════════════════════ */
.imovel-galeria { margin-bottom: 32px; }
.galeria-main {
    position: relative;
    aspect-ratio: 21/9;
    border-radius: 20px;
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
}
.galeria-main img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .18s ease;
}
.galeria-main .cover-tag {
    position: absolute;
    top: 16px; left: 16px;
    background: rgba(255,255,255,.92);
    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);
}
.galeria-counter {
    position: absolute;
    bottom: 14px; right: 14px;
    background: rgba(15,23,42,.65);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(6px);
}
/* Setas de navegação */
.galeria-nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    border: 0;
    cursor: pointer;
    font-size: 22px;
    font-weight: 300;
    display: grid; place-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    transition: background .15s, transform .15s, opacity .15s;
    z-index: 10;
    color: var(--text);
    line-height: 1;
}
.galeria-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.07);
}
.galeria-nav--prev { left: 14px; }
.galeria-nav--next { right: 14px; }
/* Miniaturas */
.galeria-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.galeria-thumbs::-webkit-scrollbar { height: 4px; }
.galeria-thumbs::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.galeria-thumb {
    flex-shrink: 0;
    width: 88px; height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .15s, opacity .15s;
    opacity: .65;
}
.galeria-thumb.active {
    border-color: var(--primary);
    opacity: 1;
}
.galeria-thumb:hover { opacity: .9; }
.galeria-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Miniaturas de vídeo — overlay de play */
.video-thumb { position: relative; }
.video-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.38);
    color: #fff;
    transition: background .15s;
    pointer-events: none;
}
.video-thumb.active .video-thumb-play { background: rgba(0,0,0,.15); }
.video-thumb:hover .video-thumb-play  { background: rgba(0,0,0,.22); }
/* Sem imagem */
.galeria-vazia {
    aspect-ratio: 21/9;
    border-radius: 20px;
    background: var(--surface-2);
    display: grid; place-items: center;
    color: var(--text-subtle);
    position: relative;
    margin-bottom: 32px;
}
.galeria-vazia svg { width: 80px; height: 80px; }
@media (max-width: 900px) {
    .galeria-main { aspect-ratio: 16/10; border-radius: 14px; }
    .galeria-thumb { width: 68px; height: 50px; }
}
@media (max-width: 560px) {
    .galeria-main { aspect-ratio: 4/3; border-radius: 10px; }
    .galeria-nav  { width: 36px; height: 36px; font-size: 18px; }
}

/* ══ TAG DESTAQUE ════════════════════════════════════════════════════════ */
/* ══ TAG DESTAQUE — one-shot entrance, estático premium depois ════════════ */
@keyframes dst-tag-once{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}
@keyframes dst-tag-flash{0%{box-shadow:0 2px 8px rgba(249,115,22,.35)}45%{box-shadow:0 4px 22px rgba(245,158,11,.85),0 0 0 2px rgba(251,191,36,.45)}100%{box-shadow:0 2px 8px rgba(249,115,22,.35)}}
@keyframes dst-star-once{0%{transform:rotate(-20deg) scale(.8)}60%{transform:rotate(10deg) scale(1.2)}100%{transform:rotate(0deg) scale(1)}}

.cover-tag-destaque {
    position: absolute;
    top: 16px; right: 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: #fff;
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    box-shadow: 0 2px 8px rgba(249,115,22,.35);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.cover-tag-destaque .dst-star { flex-shrink: 0; display: block; }
/* Uma única vez: desliza + flash de brilho + estrela gira */
.cover-tag-destaque.tag-anim { animation: dst-tag-once .4s ease-out 1 both, dst-tag-flash 1s ease-out .4s 1 forwards; }
.cover-tag-destaque.tag-anim .dst-star { animation: dst-star-once .65s ease-out .15s 1 forwards; }

/* ══ TAGS RÁPIDAS ════════════════════════════════════════════════════════ */
.imovel-tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.imovel-tag {
    display: inline-flex; align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px; font-weight: 700;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.imovel-tag--aluguel   { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.imovel-tag--temporada { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.imovel-tag--mobiliado { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }
.imovel-tag--novo      { background: #dcfce7; color: #14532d; border-color: #bbf7d0; }
.imovel-tag--reformar  { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* ══ FEATURE PILLS COM ÍCONES ════════════════════════════════════════════ */
.imovel-features-row {
    display: flex; flex-wrap: wrap;
    gap: 0;
    margin-bottom: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.feature-pill {
    flex: 1; min-width: 90px;
    display: flex; flex-direction: column; align-items: center;
    gap: 4px;
    padding: 16px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    border-right: 1px solid var(--border);
    transition: background .15s;
}
.feature-pill:last-child { border-right: 0; }
.feature-pill:hover { background: var(--surface-2); }
.pill-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--surface-2);
    display: grid; place-items: center;
    margin-bottom: 4px;
    transition: background .15s;
}
.feature-pill:hover .pill-icon { background: var(--primary-soft); }
.pill-icon svg { width: 18px; height: 18px; }
.feature-pill strong {
    display: block;
    font-size: 17px; font-weight: 800;
    color: var(--text);
    line-height: 1;
}

/* ══ SEÇÕES ══════════════════════════════════════════════════════════════ */
.imovel-section { margin-bottom: 28px; }
.imovel-section-title {
    font-size: 15px; font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
    color: var(--text);
}
.imovel-section-title::before {
    content: '';
    width: 3px; height: 16px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ══ AMENIDADES COM ÍCONES ═══════════════════════════════════════════════ */
.amenidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 10px;
}
.amenidade-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px; font-weight: 500;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
    line-height: 1.3;
}
.amenidade-badge:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.07);
}
.amenidade-badge svg { flex-shrink: 0; }
.amenidade-badge--cond {
    background: var(--primary-soft);
    border-color: rgba(79,70,229,.2);
}
.amenidade-badge--cond:hover { border-color: var(--primary); }

/* ══ VALORES E TAXAS ═════════════════════════════════════════════════════ */
.valores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.valor-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.valor-label {
    display: block;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.valor-value {
    font-size: 18px; font-weight: 700;
    color: var(--text);
}

/* ══ INFORMAÇÕES ADICIONAIS ══════════════════════════════════════════════ */
.info-adicional-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 10px;
}
.info-adicional-item {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-muted);
}
.info-adicional-item--ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
}
.info-adicional-item svg { flex-shrink: 0; }
.info-adicional-item strong { color: inherit; }

/* ══ DESCRIÇÃO TRUNCADA ══════════════════════════════════════════════════ */
.imovel-desc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 28px;
}
.imovel-desc h2 {
    font-size: 15px; font-weight: 700;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}
.imovel-desc h2::before {
    content: '';
    width: 3px; height: 16px;
    background: var(--primary);
    border-radius: 2px;
    display: inline-block;
}
.desc-text {
    color: var(--text-muted);
    line-height: 1.75;
    white-space: pre-wrap;
    font-size: 14px;
    transition: none;
}
.desc-collapsed .desc-text {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.btn-ver-mais {
    display: none;
    margin-top: 12px;
    background: none;
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    padding: 7px 16px;
    border-radius: 8px;
    font-family: inherit;
    transition: background .15s, border-color .15s;
}
.btn-ver-mais:hover { background: var(--primary-soft); border-color: var(--primary); }

/* ══ SIDEBAR RESUMO ══════════════════════════════════════════════════════ */
.sidebar-resumo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-top: 16px;
    overflow: hidden;
}
.sidebar-resumo-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.sidebar-resumo-item:last-child { border-bottom: 0; }
.sidebar-resumo-item span { color: var(--text-muted); }
.sidebar-resumo-item strong { font-weight: 700; color: var(--text); }

/* ══ CENTRAL DE MÍDIA — OVERLAYS ════════════════════════════════════════ */
.galeria-sem-midia {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-muted);
    background: var(--surface-2);
}
.galeria-sem-midia svg { width: 52px; height: 52px; opacity: .35; }
.galeria-sem-midia p   { font-size: 14px; opacity: .55; }

.galeria-midia-overlay {
    position: absolute;
    inset: 0;
    background: #000;
}
.galeria-midia-overlay iframe {
    width: 100%; height: 100%;
    border: 0; display: block;
}

/* Slides da galeria de vídeos */
.video-slide {
    position: absolute;
    inset: 0;
}
.video-slide iframe {
    width: 100%; height: 100%;
    border: 0; display: block;
}

/* ══ MAPA — SISTEMA DE INTERAÇÃO ═══════════════════════════════════════ */
.galeria-mapa-wrap { position: absolute; inset: 0; }

/* Overlay "clique para ativar" — resolve desktop E mobile de uma vez */
.mapa-ativar-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .3s;
}
.mapa-ativar-hint {
    background: rgba(255,255,255,.93);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 13px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    pointer-events: none;
    user-select: none;
}

/* Tags somem quando mapa está ativo */
.cover-tag, .cover-tag-destaque { transition: opacity .25s ease; }
.mapa-ativo .cover-tag,
.mapa-ativo .cover-tag-destaque { opacity: 0; pointer-events: none; }

/* ══ PAINEL DO MAPA (fora do iframe) ════════════════════════════════════ */
.mapa-painel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 14px 14px;
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 6px;
}
.mapa-painel-local {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    min-width: 0;
}
.mapa-painel-local svg { color: var(--c, #4f46e5); flex-shrink: 0; }
.mapa-painel-local span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapa-painel-acoes {
    display: flex;
    gap: 8px;
    align-items: center;
}
.btn-mapa-dist {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    white-space: nowrap;
    min-width: 0;
}
.btn-mapa-dist:hover   { background: #f3f4f6; border-color: #d1d5db; }
.btn-mapa-dist:active  { transform: scale(.97); }
.btn-mapa-dist:disabled { opacity: .65; cursor: default; transform: none; }
.btn-mapa-rota-ext {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    background: var(--c, #4f46e5);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .18s, transform .1s;
    white-space: nowrap;
}
.btn-mapa-rota-ext:hover  { opacity: .88; color: #fff; }
.btn-mapa-rota-ext:active { transform: scale(.97); }
.btn-mapa-rota-ext:disabled { opacity: .65; cursor: default; transform: none; }
.btn-mapa-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-mapa-expand:hover { background: #f3f4f6; color: #374151; border-color: #d1d5db; }

/* ══ CENTRAL DE MÍDIA — ABAS ════════════════════════════════════════════ */
.media-tabs {
    display: flex;
    gap: 7px;
    margin: 10px 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 1px;
}
.media-tabs::-webkit-scrollbar { display: none; }

.media-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .15s, color .15s, background .15s;
    line-height: 1;
}
.media-tab:hover {
    border-color: var(--c, var(--primary));
    color: var(--c, var(--primary));
}
.media-tab.is-active {
    background: var(--c, var(--primary));
    border-color: var(--c, var(--primary));
    color: #fff;
}
.media-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,.10);
    color: inherit;
    margin-left: 1px;
}
.media-tab.is-active .media-tab-count {
    background: rgba(255,255,255,.25);
}
/* Ícone do YouTube mantém cor vermelha mesmo no estado inativo */
.media-tab--yt svg { fill: #ff0000; }
.media-tab--yt.is-active svg { fill: #fff; }
/* Tour: cor roxa */
.media-tab--tour svg { stroke: #7c3aed; }
.media-tab--tour.is-active { background: #7c3aed; border-color: #7c3aed; }
.media-tab--tour.is-active svg { stroke: #fff; }

/* ══ CENTRAL DE MÍDIA — MODAL TOUR ══════════════════════════════════════ */
.tour-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.tour-modal-bd {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.tour-modal-box {
    position: relative;
    width: 100%;
    max-width: 1100px;
    height: min(82vh, 720px);
    background: #111;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.tour-modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    background: rgba(255,255,255,.05);
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.tour-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.tour-modal-acts {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-tour-ext {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,.7);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.2);
    transition: color .15s, border-color .15s;
}
.btn-tour-ext:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.tour-modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.tour-modal-close:hover { background: rgba(255,255,255,.22); }
.tour-modal-body {
    flex: 1;
    position: relative;
}
.tour-modal-body iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border: 0;
}
.tour-modal-footer {
    padding: 14px 20px;
    background: #f8f8f8;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.tour-modal-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    text-align: center;
}
.btn-tour-nova-aba {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: var(--c, #4f46e5);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity .18s;
    white-space: nowrap;
}
.btn-tour-nova-aba:hover { opacity: .85; color: #fff; }
.btn-tour-nova-aba svg { flex-shrink: 0; }

/* ══ RESPONSIVO ADICIONAL ════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .amenidades-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .info-adicional-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .feature-pill { min-width: 70px; padding: 12px 8px; }
    .feature-pill strong { font-size: 15px; }
    .pill-icon { width: 28px; height: 28px; }
    .pill-icon svg { width: 14px; height: 14px; }
    .amenidades-grid { grid-template-columns: 1fr 1fr; }
    .valores-grid { grid-template-columns: 1fr 1fr; }
    .info-adicional-grid { grid-template-columns: 1fr; }
    .imovel-desc { padding: 16px; }
}