/* ================================================
   ROGÉRIO CHAGAS IMÓVEIS — Página de Imóvel
   ================================================ */
:root {
  --navy:       #0a1628;
  --navy-mid:   #12213a;
  --silver:     #c0c8d4;
  --light:      #f4f6f8;
  --white:      #ffffff;
  --gold:       #b8972e;
  --gold-hv:    #9a7d26;
  --text:       #1e2d42;
  --muted:      #6b7c93;
  --green-wa:   #25d366;
  --green-wa-hv:#1ebe57;

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Inter', system-ui, sans-serif;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 4px 24px rgba(10,22,40,.09);
  --ease:   0.28s cubic-bezier(.4,0,.2,1);
  --max-w:  1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ================================================
   HEADER
   ================================================ */
.imovel-header {
  background: var(--navy);
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.imovel-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}
.imovel-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.imovel-header__logo img {
  height: 38px;
  width: auto;
}
.imovel-header__logo-text {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}
.imovel-header__logo-text small {
  font-family: var(--sans);
  font-size: 0.55rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--silver);
  font-weight: 400;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--silver);
  padding: 8px 18px;
  border: 1px solid rgba(192,200,212,.25);
  border-radius: 50px;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.btn-back:hover {
  color: var(--white);
  border-color: rgba(192,200,212,.55);
  background: rgba(255,255,255,.07);
}
.btn-back svg { flex-shrink: 0; }

/* ================================================
   LAYOUT PRINCIPAL
   ================================================ */
.imovel-main {
  padding: 48px 0 120px;
}
.imovel-main .container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* ================================================
   GALERIA
   ================================================ */
.galeria {
  position: sticky;
  top: 80px;
  min-width: 0;
  width: 100%;
}
.galeria__main-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  width: 100%;
  max-height: 70vh;
}
.galeria__main-img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity .25s ease;
}
.galeria__main-img.loading { opacity: 0; }

.galeria__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10,22,40,.65);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease);
  z-index: 5;
}
.galeria__btn:hover { background: rgba(10,22,40,.9); }
.galeria__btn--prev { left: 12px; }
.galeria__btn--next { right: 12px; }

.galeria__counter {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(10,22,40,.65);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 50px;
}

.galeria__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--silver) transparent;
  max-width: 100%;
}
.galeria__thumbs::-webkit-scrollbar { height: 4px; }
.galeria__thumbs::-webkit-scrollbar-thumb {
  background: var(--silver);
  border-radius: 4px;
}
.galeria__thumb {
  flex-shrink: 0;
  height: 80px;
  width: auto;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--ease), opacity var(--ease);
  opacity: .65;
}
.galeria__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.galeria__thumb.active,
.galeria__thumb:hover {
  border-color: var(--gold);
  opacity: 1;
}

/* ================================================
   INFO DO IMÓVEL
   ================================================ */
.imovel-info {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow);
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(70vh + 96px); /* galeria + miniaturas */
}
.imovel-info__body {
  flex: 1;
  overflow-y: auto;
  padding: 36px 36px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.15) transparent;
}
.imovel-info__body::-webkit-scrollbar { width: 4px; }
.imovel-info__body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 4px;
}
.imovel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 50px;
}
.badge--cat  { background: var(--navy); color: var(--white); }
.badge--condo { background: var(--gold); color: var(--white); }

.imovel-title {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 8px;
}
.imovel-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: var(--silver);
  margin-bottom: 8px;
}
.imovel-local {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.imovel-local svg { color: var(--gold); flex-shrink: 0; }

.imovel-price-block {
  background: var(--light);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 28px;
}
.imovel-price-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.imovel-price {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.imovel-condo-fee {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Ficha Técnica */
.ficha {
  margin-bottom: 28px;
}
.ficha__title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--light);
}
.ficha__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.ficha__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text);
}
.ficha__icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Descrição */
.desc-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--light);
}
.desc-text {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.85;
  white-space: pre-line;
}

/* Botão CTA no painel */
.btn-wa-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  background: var(--green-wa);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background var(--ease), transform var(--ease);
  flex-shrink: 0;
  margin: 0 24px 24px;
}
.btn-wa-panel:hover {
  background: var(--green-wa-hv);
  transform: translateY(-2px);
}

/* ================================================
   BOTÃO FLUTUANTE WHATSAPP (mobile)
   ================================================ */
.wa-float {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--green-wa);
  color: var(--white);
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  transition: transform var(--ease), box-shadow var(--ease);
}
.wa-float::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green-wa);
  animation: wa-pulse 2.6s ease-out infinite;
  z-index: -1;
}
.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(37,211,102,.55);
}
@keyframes wa-pulse {
  0%   { transform: scale(1);    opacity: .55; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* ================================================
   FOOTER
   ================================================ */
.imovel-footer {
  background: var(--navy);
  padding: 32px 0;
}
.imovel-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.imovel-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.imovel-footer__brand img { height: 36px; width: auto; opacity: .85; }
.imovel-footer__brand-text {
  font-family: var(--serif);
  font-size: 0.88rem;
  color: var(--white);
}
.imovel-footer__creci {
  font-size: 0.62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.imovel-footer__copy {
  font-size: 0.68rem;
  color: rgba(107,124,147,.5);
}

/* ================================================
   RESPONSIVO
   ================================================ */
@media (max-width: 1024px) {
  .imovel-main .container {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .galeria { position: static; }
  .imovel-info {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    max-height: none;
  }
  .imovel-info__body { overflow-y: visible; }
  .btn-wa-panel { margin: 0 24px 24px; }
  .galeria__main-wrap,
  .galeria__main-img { max-height: 60vh; }
}

@media (max-width: 768px) {
  .imovel-main { padding: 24px 0 100px; }
  .imovel-info { max-height: none; }
  .imovel-info__body {
    overflow-y: visible;
    padding: 24px 20px 16px;
  }
  .btn-wa-panel { display: none; } /* substituído pelo botão flutuante */
  .imovel-price { font-size: 1.6rem; }
  .ficha__grid { grid-template-columns: 1fr; gap: 8px; }
  .wa-float { display: flex; }
  .imovel-footer .container { flex-direction: column; text-align: center; }
  .galeria__main-wrap,
  .galeria__main-img { max-height: 50vh; }
  .galeria__thumb { height: 60px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .galeria__thumb { height: 52px; }
  .imovel-header__logo-text { display: none; }
}
