/*
Theme Name:  Portal do Corretor
Theme URI:   https://portalcorretor.com.br
Description: Bio-link imobiliário — Customizer completo, 20 bairros, carrossel, chatbot, VCard, CRM, iOS otimizado.
Version:     15.0.0
Author:      Portal do Corretor
Text Domain: pdc
Requires PHP: 7.2
*/

/* ═══════════════════════════════════════════════════════
   RESET & TOKENS
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Cores base — sobrescritas pelo PHP inline */
  --gold:       #b5894a;
  --gold2:      #d4a96a;
  --glow:       rgba(181,137,74,.28);

  /* Surfaces dark */
  --bg-page:    #07090e;
  --bg-card:    rgba(255,255,255,.055);
  --bg-card2:   rgba(255,255,255,.08);
  --bg-glass:   rgba(255,255,255,.06);
  --border:     rgba(255,255,255,.10);
  --border2:    rgba(255,255,255,.16);

  /* Texto dark */
  --text1:      #eeeae4;
  --text2:      #b0a898;
  --text3:      #706860;

  /* Tokens UI */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --shadow-glow: 0 0 28px var(--glow);
  --trans:       .2s ease;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text1);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.pdc-noscroll { overflow: hidden !important; }

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ═══════════════════════════════════════════════════════
   FUNDO FIXO (imagem)
═══════════════════════════════════════════════════════ */
#pdc-page-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#pdc-page-ov {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   FUNDO VÍDEO (iOS: precisa de autoplay+muted+playsinline)
   Oculto por padrão — PHP injeta display:block quando necessário
═══════════════════════════════════════════════════════ */
#pdc-video-bg {
  position: fixed;
  inset: 0;
  z-index: -4;
  overflow: hidden;
  pointer-events: none;
  display: none; /* PHP ativa via pdc_dynamic_css */
}
#pdc-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
#pdc-video-ov {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
.pdc-page {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 120px;
}

.pdc-inner {
  padding: 0 18px;
}

.pdc-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  opacity: .85;
}

.pdc-h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text1);
  line-height: 1.3;
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════ */
.pdc-hero {
  position: relative;
  padding: 48px 20px 32px;
  text-align: center;
  overflow: hidden;
}
.pdc-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.pdc-hero-bg-ov {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,9,14,.35) 0%, rgba(7,9,14,.78) 100%);
  z-index: 0;
}
.pdc-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Anel animado */
.pdc-ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 8px;
}
.pdc-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  background: conic-gradient(var(--gold) 0deg, var(--gold2) 120deg, transparent 200deg) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  animation: pdc-ring-spin 3.5s linear infinite;
}
.pdc-hero.no-ring .pdc-ring { display: none; }
@keyframes pdc-ring-spin { to { transform: rotate(360deg); } }

.pdc-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--gold);
  box-shadow: 0 0 20px var(--glow);
}
.pdc-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  font-size: 2.4rem;
}

.pdc-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text1);
  letter-spacing: -.01em;
}
.pdc-creci {
  font-size: .78rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: .06em;
  opacity: .9;
}
.pdc-tagline {
  font-size: .88rem;
  color: var(--text2);
  max-width: 280px;
}

/* Stats */
.pdc-stats {
  display: flex;
  gap: 24px;
  margin-top: 10px;
  justify-content: center;
}
.pdc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.pdc-stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
}
.pdc-stat-lbl {
  font-size: .68rem;
  color: var(--text3);
  text-align: center;
  max-width: 80px;
  line-height: 1.2;
}

/* ═══════════════════════════════════════════════════════
   BOTÕES DE LINK
═══════════════════════════════════════════════════════ */
.pdc-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px 8px;
}
.pdc-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gold);
  background: var(--bg-card);
  color: var(--text1);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform var(--trans), box-shadow var(--trans), background var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.pdc-link-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px var(--glow); }
.pdc-link-btn:active { transform: scale(.97); }

/* ═══════════════════════════════════════════════════════
   CARROSSEL
═══════════════════════════════════════════════════════ */
.pdc-carousel-sec {
  padding: 28px 0 8px;
  overflow: hidden;
}
.pdc-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 6px 18px 12px;
}
.pdc-carousel::-webkit-scrollbar { display: none; }
.pdc-car-item {
  flex: 0 0 260px;
  scroll-snap-align: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.pdc-car-item:active { transform: scale(.97); }
.pdc-car-img {
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card2);
}
.pdc-car-nophoto {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--text3);
}
.pdc-car-info    { padding: 12px 14px 14px; }
.pdc-car-title   { font-size: .93rem; font-weight: 600; color: var(--text1); margin-bottom: 4px; }
.pdc-car-bairro  { font-size: .76rem; color: var(--text3); margin-bottom: 4px; }
.pdc-car-price   { font-size: .87rem; color: var(--gold); font-weight: 700; }

.pdc-carousel-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 8px 0 4px;
}
.pdc-car-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--trans), transform .15s;
}
.pdc-car-dot.on { background: var(--gold); transform: scale(1.3); }

/* ═══════════════════════════════════════════════════════
   CATÁLOGO DE BAIRROS
═══════════════════════════════════════════════════════ */
.pdc-catalog { padding: 28px 0 8px; }
.pdc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.pdc-bairro-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  aspect-ratio: 4/3;
  cursor: pointer;
  transition: transform var(--trans), box-shadow var(--trans);
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  width: 100%;
}
.pdc-bairro-card:hover  { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.pdc-bairro-card:active { transform: scale(.97); }
.pdc-bairro-card.feat   { grid-column: span 2; aspect-ratio: 16/7; }

.pdc-bairro-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.pdc-bairro-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text3);
  position: absolute;
  inset: 0;
}
.pdc-bairro-ov {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.75) 100%);
}
.pdc-bairro-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  z-index: 1;
}
.pdc-bairro-name {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.pdc-bairro-count {
  font-size: .72rem;
  color: rgba(255,255,255,.7);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════
   SOBRE MIM
═══════════════════════════════════════════════════════ */
.pdc-bio { padding: 28px 0; }
.pdc-bio-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.pdc-bio-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.pdc-bio-text {
  font-size: .88rem;
  color: var(--text2);
  line-height: 1.65;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════
   DEPOIMENTOS
═══════════════════════════════════════════════════════ */
.pdc-depo { padding: 28px 0; }
.pdc-depo-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pdc-depo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.pdc-depo-stars { color: var(--gold); font-size: 1rem; margin-bottom: 8px; letter-spacing: .05em; }
.pdc-depo-txt   { font-size: .88rem; color: var(--text2); line-height: 1.6; margin-bottom: 12px; font-style: italic; }
.pdc-depo-auth  { display: flex; align-items: center; gap: 10px; }
.pdc-depo-av    { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pdc-depo-name  { font-size: .85rem; font-weight: 700; color: var(--text1); }
.pdc-depo-role  { font-size: .75rem; color: var(--text3); }

/* ═══════════════════════════════════════════════════════
   GOOGLE MAPS
═══════════════════════════════════════════════════════ */
.pdc-maps-sec  { padding: 28px 0; }
.pdc-maps-wrap {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdc-maps-loading { color: var(--text3); font-size: .86rem; }

/* ═══════════════════════════════════════════════════════
   RODAPÉ
═══════════════════════════════════════════════════════ */
.pdc-footer {
  padding: 28px 18px 20px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.pdc-footer-name  { font-size: .85rem; font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.pdc-footer-text  { font-size: .78rem; color: var(--text3); margin-bottom: 10px; }
.pdc-footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.pdc-footer-links a { font-size: .76rem; color: var(--text3); text-decoration: underline; }
.pdc-footer-links a:hover { color: var(--gold); }

/* ═══════════════════════════════════════════════════════
   FAB — VCard / WhatsApp
═══════════════════════════════════════════════════════ */
.pdc-fab-vcard {
  position: fixed;
  bottom: 90px;
  right: 18px;
  z-index: 900;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(181,137,74,.45);
  transition: transform var(--trans), box-shadow var(--trans);
  -webkit-tap-highlight-color: transparent;
  animation: pdc-pulse-gold 2.4s ease-in-out infinite;
}
.pdc-fab-vcard:hover  { transform: scale(1.1); }
.pdc-fab-vcard:active { transform: scale(.95); animation: none; }

@keyframes pdc-pulse-gold {
  0%,100% { box-shadow: 0 4px 18px rgba(181,137,74,.45); }
  50%      { box-shadow: 0 4px 28px rgba(181,137,74,.7), 0 0 0 10px rgba(181,137,74,.07); }
}

/* ═══════════════════════════════════════════════════════
   FAB — Chatbot
═══════════════════════════════════════════════════════ */
.pdc-chat-float-btn {
  position: fixed;
  bottom: 24px;
  right: 18px;
  z-index: 901;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(37,211,102,.4);
  transition: transform var(--trans);
  -webkit-tap-highlight-color: transparent;
  animation: pdc-pulse-green 2.4s ease-in-out infinite;
}
.pdc-chat-float-btn:hover  { transform: scale(1.1); }
.pdc-chat-float-btn:active { transform: scale(.95); animation: none; }

@keyframes pdc-pulse-green {
  0%,100% { box-shadow: 0 4px 18px rgba(37,211,102,.4); }
  50%      { box-shadow: 0 4px 28px rgba(37,211,102,.65), 0 0 0 10px rgba(37,211,102,.07); }
}

/* iOS safe-area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pdc-chat-float-btn { bottom: calc(24px + env(safe-area-inset-bottom)); }
  .pdc-fab-vcard      { bottom: calc(90px + env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════════════════
   POPUP DE BAIRRO
═══════════════════════════════════════════════════════ */
.pdc-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0e1218;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.22,.61,.36,1);
  -webkit-overflow-scrolling: touch;
}
.pdc-popup.open { transform: translateY(0); }

.pdc-popup-head {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: #161b24;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}
.pdc-popup-back {
  background: none;
  border: none;
  color: var(--gold);
  font-size: .85rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.pdc-popup-back:hover { background: rgba(255,255,255,.06); }
.pdc-popup-bairro {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: .95rem;
  color: var(--text1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdc-popup-x {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1.5px solid var(--border2);
  color: var(--text1);
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans);
}
.pdc-popup-x:hover { background: rgba(255,255,255,.16); }

.pdc-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.pdc-cat-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
}
.pdc-cat-empty span { font-size: 3rem; display: block; margin-bottom: 12px; }
.pdc-cat-empty p    { font-size: .88rem; }

.spin-loader {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 60px auto;
  animation: pdc-spin .7s linear infinite;
}
@keyframes pdc-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   CARD DE IMÓVEL
═══════════════════════════════════════════════════════ */
.pdc-im-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #151c26;
  border: 1px solid var(--border);
  transition: box-shadow var(--trans);
}
.pdc-im-card.hl {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(181,137,74,.2);
}
.pdc-im-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.35); }

/* Imagem clicável */
.pdc-im-imgwrap {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.pdc-im-photo {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.pdc-im-imgwrap:hover .pdc-im-photo { transform: scale(1.03); }
.pdc-im-nophoto {
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  background: var(--bg-card);
  color: var(--text3);
}
.pdc-hl-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--gold);
  color: #07090e;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 3px 9px;
  border-radius: 20px;
  pointer-events: none;
}

.pdc-im-body { padding: 14px 16px 16px; }
.pdc-im-ref   { font-size: .7rem; color: var(--text3); letter-spacing: .06em; margin-bottom: 4px; }
.pdc-im-title { font-size: 1rem; font-weight: 700; color: var(--text1); margin-bottom: 4px; }
.pdc-im-price { font-size: .95rem; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.pdc-im-desc  { font-size: .82rem; color: var(--text2); line-height: 1.55; margin-bottom: 10px; }

.pdc-im-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Botão de interesse / WA */
.btn-chat, .btn-wa {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity var(--trans), transform .12s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn-chat {
  background: var(--gold);
  color: #07090e;
}
.btn-wa {
  background: #25d366;
  color: #fff;
}
.btn-chat:hover, .btn-wa:hover { opacity: .88; }
.btn-chat:active, .btn-wa:active { transform: scale(.97); }

/* Botão galeria */
.btn-gallery {
  width: 100%;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.btn-gallery:hover { background: rgba(255,255,255,.1); }

.pdc-tour-link {
  display: block;
  margin-top: 6px;
  font-size: .8rem;
  color: var(--gold);
  opacity: .8;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════
   GALERIA FULLSCREEN
═══════════════════════════════════════════════════════ */
.pdc-gallery {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.pdc-gallery.open { opacity: 1; pointer-events: all; }

/* X — grande, canto superior direito */
.gal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10003;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  border: 2px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans);
  flex-shrink: 0;
}
.gal-close:hover { background: var(--gold); }

/* Imagem ocupa toda a área disponível */
.gal-main-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 64px;
}
#gal-main {
  max-width: 100vw;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Barra inferior: setas + contador + miniaturas */
.gal-bar {
  flex-shrink: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 14px 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.gal-arrows-row {
  display: flex;
  align-items: center;
  gap: 28px;
}
.gal-arrow {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  border: 1.5px solid rgba(255,255,255,.28);
  color: #fff;
  font-size: 1.9rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--trans);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.gal-arrow:hover { background: rgba(255,255,255,.28); }
.gal-counter {
  color: rgba(255,255,255,.65);
  font-size: .84rem;
  min-width: 52px;
  text-align: center;
}
.gal-thumbs-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.gal-thumbs-row::-webkit-scrollbar { display: none; }
.gal-thumb {
  width: 52px; height: 40px;
  object-fit: cover;
  border-radius: 5px;
  opacity: .45;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: opacity .15s;
}
.gal-thumb.on { opacity: 1; border-color: var(--gold); }

/* iOS safe-area galeria */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .gal-bar { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════════════════
   CHATBOT ← CORREÇÃO PRINCIPAL: fundo e textos legíveis
═══════════════════════════════════════════════════════ */
.pdc-chatbot {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  /* Padding lateral para não ficar colado nas bordas em telas largas */
  padding: 0 12px;
  pointer-events: none;
}
.pdc-chatbot.open { pointer-events: all; }

.chat-box {
  width: 100%;
  max-width: 460px;
  background: #1e2433;
  /* Arredondado em TODOS os cantos — não grudado na tela */
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 -4px 32px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  max-height: 72dvh;
  /* Margem inferior para não tocar o rodapé do telefone */
  margin-bottom: 16px;
  transform: translateY(110%);
  transition: transform .32s cubic-bezier(.22,.61,.36,1);
}
.pdc-chatbot.open .chat-box { transform: translateY(0); }

/* Cabeçalho do chat */
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  /* fundo levemente mais escuro que o corpo */
  background: #161c2d;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.chat-av-wrap {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(181,137,74,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  overflow: hidden;
}
.chat-head-info { flex: 1; }
.chat-agent-name {
  font-size: .9rem;
  font-weight: 700;
  /* Texto BRANCO — legível sobre fundo escuro */
  color: #eeeae4;
  line-height: 1.2;
}
.chat-online {
  font-size: .72rem;
  color: #4caf50;
  margin-top: 1px;
}
.chat-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  color: #ccc;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.chat-close:hover { background: rgba(255,255,255,.16); color: #fff; }

/* Área de mensagens */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Balões — BOT: fundo cinza claro, texto escuro */
.chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: .88rem;
  line-height: 1.5;
  word-break: break-word;
  animation: chat-in .22s ease both;
}
@keyframes chat-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mensagem do BOT — fundo cinza, texto bem escuro para legibilidade */
.chat-msg-bot {
  align-self: flex-start;
  background: #e8e8e8;
  color: #1a1410;     /* TEXTO ESCURO sobre fundo claro */
  border-bottom-left-radius: 6px;
  font-weight: 500;
}

/* Mensagem do USUÁRIO — fundo dourado, texto escuro */
.chat-msg-user {
  align-self: flex-end;
  background: var(--gold);
  color: #07090e;     /* TEXTO ESCURO sobre fundo dourado */
  border-bottom-right-radius: 6px;
  font-weight: 600;
}

/* Rodapé do chat — opções e input */
.chat-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: #1a2030;
}

/* Botões de opção */
.chat-opt {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: rgba(181,137,74,.12);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: .87rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background var(--trans), color var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.chat-opt:hover  { background: var(--gold); color: #07090e; }
.chat-opt:active { transform: scale(.98); }

/* Input de texto livre */
.chat-input {
  flex: 1;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
  border: 1.5px solid var(--border2);
  /* Texto BRANCO no campo de digitação */
  color: #eeeae4;
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--trans);
  width: 100%;
}
.chat-input::placeholder { color: rgba(255,255,255,.35); }
.chat-input:focus { border-color: var(--gold); background: rgba(255,255,255,.1); }

/* Linha input+botão */
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.chat-send {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: var(--gold);
  border: none;
  color: #07090e;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--trans);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.chat-send:hover { opacity: .88; }

/* Safe area iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .chat-box { margin-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════════════════
   MODO CLARO
═══════════════════════════════════════════════════════ */
body.pdc-light {
  --bg-page:  #f4f1ec;
  --bg-card:  rgba(0,0,0,.04);
  --bg-card2: rgba(0,0,0,.07);
  --bg-glass: rgba(0,0,0,.04);
  --border:   rgba(0,0,0,.10);
  --border2:  rgba(0,0,0,.16);
  --text1:    #1a1410;
  --text2:    #4a3f35;
  --text3:    #8a7a6a;
}
body.pdc-light .pdc-popup    { background: #f4f1ec; }
body.pdc-light .pdc-popup-head { background: #e8e3da; }
body.pdc-light .pdc-im-card { background: #fff; }
body.pdc-light .chat-box     { background: #f4f1ec; }
body.pdc-light .chat-head    { background: #e8e3da; }
body.pdc-light .chat-footer  { background: #e8e3da; }
body.pdc-light .chat-msg-bot { background: #d4cec7; color: #1a1410; }
body.pdc-light .chat-input   { background: rgba(0,0,0,.05); color: #1a1410; border-color: rgba(0,0,0,.2); }
body.pdc-light .chat-input::placeholder { color: rgba(0,0,0,.35); }
body.pdc-light .pdc-maps-wrap { background: #e8e3da; }
body.pdc-light .chat-agent-name { color: #1a1410; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVO
═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .pdc-car-item  { flex: 0 0 220px; }
  .pdc-car-img   { height: 130px; }
  .gal-arrow     { width: 46px; height: 46px; font-size: 1.5rem; }
  .gal-thumb     { width: 44px; height: 34px; }
  .pdc-maps-wrap { height: 240px; }
  .pdc-stats     { gap: 14px; }
  .pdc-grid      { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pdc-bairro-card.feat { grid-column: span 2; }
  .pdc-im-actions { flex-direction: column; }
  .btn-chat, .btn-wa { width: 100%; }
}

@media (max-width: 360px) {
  .pdc-name     { font-size: 1.25rem; }
  .pdc-car-item { flex: 0 0 200px; }
}

/* ═══════════════════════════════════════════════════════
   WORDPRESS admin-bar offset
═══════════════════════════════════════════════════════ */
.admin-bar .pdc-popup,
.admin-bar .pdc-gallery,
.admin-bar .pdc-chatbot {
  top: 46px;
}
@media screen and (min-width: 783px) {
  .admin-bar .pdc-popup,
  .admin-bar .pdc-gallery,
  .admin-bar .pdc-chatbot {
    top: 32px;
  }
}

/* ═══════════════════════════════════════════════════════
   TOAST de notificação
═══════════════════════════════════════════════════════ */
.pdc-toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9998;
  background: rgba(30,36,51,.97);
  border: 1px solid rgba(181,137,74,.4);
  color: #eeeae4;
  font-size: .83rem;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 12px;
  max-width: min(340px, 90vw);
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
  line-height: 1.45;
}
.pdc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Safe-area iOS para toast */
@supports (bottom: env(safe-area-inset-bottom)) {
  .pdc-toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
}
