/* Chat de qualificação. Usa as cores do site (variáveis de styles.css) com valores de reserva. */
.gg-chat, .gg-chat * { box-sizing: border-box; }
.gg-chat [hidden], .gg-chat-backdrop[hidden] { display: none !important; }

.gg-chat-backdrop {
  position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, 0.55);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease;
  display: none;
}

.gg-chat {
  position: fixed; z-index: 1000; right: 20px; bottom: 20px;
  width: min(380px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 40px));
  height: min(620px, calc(100dvh - 40px));
  display: flex; flex-direction: column;
  background: var(--bg-2, #131110); color: var(--ink, #f5f1e8);
  border: 1px solid var(--line-strong, rgba(201, 162, 76, 0.4));
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  font-size: 15px; line-height: 1.45;
}
.gg-chat.is-open { opacity: 1; visibility: visible; transform: none; }

.gg-chat__head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg-3, #1c1815); border-bottom: 1px solid var(--line, rgba(201, 162, 76, 0.2));
}
.gg-chat__head img { flex: none; width: 36px; height: 36px; }
.gg-chat__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gg-chat__who strong { font-size: 15px; color: var(--ink, #f5f1e8); }
.gg-chat__who span { font-size: 12.5px; color: var(--gold, #c9a24c); }
.gg-chat__close {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-strong, rgba(201, 162, 76, 0.4)); background: transparent;
  color: var(--ink, #f5f1e8); font-size: 22px; line-height: 1; cursor: pointer;
}
.gg-chat__close:hover { background: rgba(201, 162, 76, 0.15); }

.gg-chat__log {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth;
}
.gg-msg {
  max-width: 86%; padding: 10px 14px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere;
}
.gg-msg--bot {
  align-self: flex-start; background: var(--bg-3, #1c1815); color: var(--ink, #f5f1e8);
  border: 1px solid var(--line, rgba(201, 162, 76, 0.2)); border-bottom-left-radius: 4px;
}
.gg-msg--me {
  align-self: flex-end; color: #14100a; font-weight: 600; border-bottom-right-radius: 4px;
  background: var(--gradient-gold, linear-gradient(135deg, #f0d998 0%, #c9a24c 55%, #8a6b24 100%));
}
.gg-msg--bot strong { color: var(--gold-light, #f0d998); }

.gg-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.gg-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold, #c9a24c); opacity: 0.35;
  animation: gg-blink 1s infinite ease-in-out;
}
.gg-typing span:nth-child(2) { animation-delay: 0.15s; }
.gg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes gg-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.gg-opts { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 100%; margin-top: 2px; }
.gg-opt {
  display: inline-block; max-width: 100%; text-align: left; text-decoration: none; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14.5px;
  color: var(--gold-light, #f0d998); background: transparent;
  border: 1px solid var(--line-strong, rgba(201, 162, 76, 0.4));
}
.gg-opt:hover, .gg-opt:focus-visible { background: rgba(201, 162, 76, 0.16); }
.gg-opt--primary {
  color: #14100a; border-color: transparent; text-align: center;
  background: var(--gradient-gold, linear-gradient(135deg, #f0d998 0%, #c9a24c 55%, #8a6b24 100%));
}
.gg-opt--primary:hover, .gg-opt--primary:focus-visible { filter: brightness(1.06); background: var(--gradient-gold, #c9a24c); }

.gg-chat__form {
  display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line, rgba(201, 162, 76, 0.2));
  background: var(--bg-3, #1c1815); position: relative;
}
.gg-chat__input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 999px; font: inherit; font-size: 16px;
  color: var(--ink, #f5f1e8); background: var(--bg-2, #131110);
  border: 1px solid var(--line-strong, rgba(201, 162, 76, 0.4));
}
.gg-chat__input:focus { outline: 2px solid var(--gold, #c9a24c); outline-offset: 1px; }
.gg-chat__send {
  flex: none; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  color: #14100a; background: var(--gradient-gold, linear-gradient(135deg, #f0d998 0%, #c9a24c 55%, #8a6b24 100%));
}
.gg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.gg-chat__foot { padding: 8px 14px 12px; text-align: center; background: var(--bg-3, #1c1815); }
.gg-chat__form[hidden] + .gg-chat__foot { border-top: 1px solid var(--line, rgba(201, 162, 76, 0.2)); }
.gg-chat__foot a { font-size: 12.5px; color: var(--ink-faint, rgba(245, 241, 232, 0.55)); text-decoration: underline; }
.gg-chat__foot a:hover { color: var(--ink-soft, rgba(245, 241, 232, 0.8)); }

/* botão flutuante do WhatsApp */
.gg-fab {
  position: fixed; z-index: 998; right: 18px; bottom: 18px;
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  max-width: calc(100vw - 24px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.gg-fab__bubble {
  position: relative; background: #fff; color: #555; font-size: 16px; line-height: 1.2;
  padding: 12px 18px; border-radius: 10px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}
.gg-fab__bubble strong { color: #333; }
.gg-fab__dots { display: none; align-items: center; gap: 7px; padding: 5px 10px; }
.gg-fab__dots i {
  width: 10px; height: 10px; border-radius: 50%; background: #25d366; opacity: 0.35;
  animation: gg-blink 1s infinite ease-in-out;
}
.gg-fab__dots i:nth-child(2) { animation-delay: 0.15s; }
.gg-fab__dots i:nth-child(3) { animation-delay: 0.3s; }
.gg-fab__bubble.is-typing .gg-fab__dots { display: inline-flex; }
.gg-fab__bubble.is-typing .gg-fab__text { display: none; }
.gg-fab__text { display: inline-block; animation: gg-pop 0.3s ease both; }
@keyframes gg-pop { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.gg-fab__bubble::after {
  content: ""; position: absolute; right: -7px; top: 50%; margin-top: -8px;
  border: 8px solid transparent; border-right: 0; border-left-color: #fff;
}
.gg-fab__icon {
  position: relative; flex: none; width: 68px; height: 68px; border-radius: 50%; background: #25d366;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}
.gg-fab__icon svg { width: 38px; height: 38px; fill: #fff; }
.gg-fab:hover .gg-fab__icon, .gg-fab:focus-visible .gg-fab__icon { transform: scale(1.06); }
.gg-fab__dot {
  position: absolute; right: -1px; bottom: 0; width: 15px; height: 15px; border-radius: 50%;
  background: #25d366; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18); animation: gg-pulse 2s 6;
}
@keyframes gg-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); } 70%, 100% { box-shadow: 0 0 0 11px rgba(37, 211, 102, 0); } }
.gg-fab:focus-visible { outline: 2px solid var(--gold-light, #f0d998); outline-offset: 4px; border-radius: 12px; }
html.gg-chat-open .gg-fab { display: none; }

/* botão de ligar: só em celular. No hero ele fica ao lado do botão principal; o flutuante fica acima do WhatsApp */
.gg-call, .hero-call { display: none; }
@media (max-width: 820px) {
  .hero-call { display: inline-flex; }
  .hero-actions.has-call { flex-wrap: nowrap; }
  .hero-actions.has-call .btn { flex: 1 1 0; padding-left: 14px; padding-right: 14px; white-space: nowrap; }
}
.gg-chat__tel { display: none; }
@media (max-width: 820px) {
  .gg-call {
    position: fixed; z-index: 997; right: 14px; bottom: 90px;
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    padding: 11px 18px 11px 14px; border-radius: 999px; font-weight: 700; font-size: 15px; line-height: 1;
    color: #14100a; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: var(--gradient-gold, linear-gradient(135deg, #f0d998 0%, #c9a24c 55%, #8a6b24 100%));
  }
  .gg-call svg { width: 20px; height: 20px; fill: currentColor; }
  .gg-call:focus-visible { outline: 2px solid var(--gold-light, #f0d998); outline-offset: 3px; }
  html.gg-chat-open .gg-call { display: none; }
  .gg-chat__tel { display: inline; margin-left: 14px; font-size: 12.5px; color: var(--ink-faint, rgba(245, 241, 232, 0.55)); text-decoration: underline; }
}
@media (max-width: 520px) {
  .gg-fab { right: 12px; bottom: 12px; gap: 10px; }
  .gg-fab__bubble { font-size: 14.5px; padding: 10px 14px; }
  .gg-fab__icon { width: 60px; height: 60px; }
  .gg-fab__icon svg { width: 34px; height: 34px; }
}
@media (max-width: 350px) { .gg-fab__bubble { display: none; } }
@media (prefers-reduced-motion: reduce) { .gg-fab__dot, .gg-fab__text, .gg-fab__dots i { animation: none; } .gg-fab__icon { transition: none; } }

.gg-chat button:focus-visible, .gg-chat a:focus-visible { outline: 2px solid var(--gold-light, #f0d998); outline-offset: 2px; }
.gg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
  .gg-chat-backdrop { display: block; }
  .gg-chat-backdrop.is-open { opacity: 1; visibility: visible; }
  .gg-chat {
    left: 0; right: 0; bottom: 0; width: 100%;
    height: min(88vh, 660px); height: min(88dvh, 660px);
    border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  html.gg-chat-open, html.gg-chat-open body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .gg-chat, .gg-chat-backdrop { transition: none; }
  .gg-chat { transform: none; }
  .gg-typing span { animation: none; opacity: 0.7; }
  .gg-chat__log { scroll-behavior: auto; }
}
