/* ============================================
   CHAT BOLHA — CANTO INFERIOR DIREITO
   ============================================ */

.chat-bubble-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(255,215,0,0.35), 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
  animation: chatPulseRing 2.5s ease-in-out infinite;
}
.chat-bubble-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 32px rgba(255,215,0,0.5), 0 2px 8px rgba(0,0,0,0.5);
}
.chat-bubble-btn .chat-icon-msg,
.chat-bubble-btn .chat-icon-x {
  position: absolute;
  font-size: 1.3rem;
  color: var(--black);
  transition: opacity 0.2s, transform 0.2s;
}
.chat-bubble-btn .chat-icon-x {
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}
.chat-bubble-btn.aberto .chat-icon-msg {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}
.chat-bubble-btn.aberto .chat-icon-x {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Anel pulsante */
@keyframes chatPulseRing {
  0%,100% { box-shadow: 0 4px 24px rgba(255,215,0,0.35), 0 0 0 0 rgba(255,215,0,0.4); }
  50%      { box-shadow: 0 4px 24px rgba(255,215,0,0.35), 0 0 0 10px rgba(255,215,0,0); }
}

/* Badge de online */
.chat-bubble-badge {
  position: absolute;
  top: 3px; right: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--black);
  animation: badgePulse 1.8s ease-in-out infinite;
}
@keyframes badgePulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ── JANELA DO CHAT ── */
.chat-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 340px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,215,0,0.08);
  z-index: 3999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34,1.36,0.64,1), opacity 0.25s ease;
}
.chat-window.aberto {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
.chat-window::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  flex-shrink: 0;
}

/* Header */
.chat-header {
  background: var(--surface2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
  position: relative;
}
.chat-header-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--surface2);
}
.chat-header-info { flex: 1; }
.chat-header-nome {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--white);
  letter-spacing: 0.3px;
  line-height: 1.1;
}
.chat-header-status {
  font-size: 0.68rem;
  color: var(--green);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.chat-header-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

/* Mensagens */
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-msgs::-webkit-scrollbar { width: 4px; }
.chat-msgs::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: msgEntra 0.25s cubic-bezier(0.34,1.36,0.64,1);
}
@keyframes msgEntra {
  from { transform: translateY(8px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.chat-msg.suporte { align-self: flex-start; }
.chat-msg.cliente { align-self: flex-end; }

.chat-msg-bubble {
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 0.82rem;
  line-height: 1.55;
  font-family: 'DM Sans', sans-serif;
}
.chat-msg.suporte .chat-msg-bubble {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.cliente .chat-msg-bubble {
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
  border-bottom-right-radius: 4px;
}
.chat-msg-hora {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 3px;
  padding: 0 4px;
}
.chat-msg.cliente .chat-msg-hora { text-align: right; }

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  align-self: flex-start;
}
.chat-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* Input */
.chat-input-wrap {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: var(--surface2);
}
.chat-input {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  outline: none;
  resize: none;
  max-height: 90px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.chat-input::placeholder { color: rgba(255,255,255,0.22); }
.chat-input:focus { border-color: var(--gold); }
.chat-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: var(--black);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, background 0.2s;
}
.chat-send-btn:hover { transform: scale(1.1); background: var(--gold-dark); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Aviso de privacidade */
.chat-disclaimer {
  text-align: center;
  font-size: 0.6rem;
  color: var(--muted);
  padding: 6px 14px 8px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Mobile */
@media (max-width: 480px) {
  .chat-window {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 80px;
  }
  .chat-bubble-btn {
    bottom: 16px;
    right: 16px;
  }
}


/* ============================================
   TELA PIX FULLSCREEN
   ============================================ */

.pix-fullscreen {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 0;
  animation: pixFsEntra 0.4s cubic-bezier(0.34,1.16,0.64,1);
}
@keyframes pixFsEntra {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Linha dourada topo */
.pix-fullscreen::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  z-index: 2;
}

/* Header da tela PIX */
.pix-fs-header {
  width: 100%;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 3;
  flex-shrink: 0;
}
.pix-fs-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 1px;
}
.pix-fs-logo span { color: var(--white); }
.pix-fs-voltar {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 50px;
  padding: 7px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.pix-fs-voltar:hover { border-color: var(--gold); color: var(--gold); }

/* Conteúdo central */
.pix-fs-body {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

/* Coluna esquerda — Resumo do pedido */
.pix-fs-resumo {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pix-fs-resumo-header {
  background: var(--surface3);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
}
.pix-fs-resumo-body { padding: 20px; }

.pix-fs-produto-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.pix-fs-produto-img {
  width: 72px; height: 72px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface3);
  border: 1px solid var(--border);
  padding: 6px;
  flex-shrink: 0;
}
.pix-fs-produto-nome {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}
.pix-fs-produto-entrega {
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pix-fs-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.pix-fs-info-row span:last-child { color: var(--white); font-weight: 600; }
.pix-fs-info-row.total {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}
.pix-fs-info-row.total span:first-child {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--white);
  text-transform: uppercase;
}
.pix-fs-info-row.total span:last-child {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold);
}

/* Dados do cliente */
.pix-fs-cliente {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pix-fs-cliente-titulo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.pix-fs-cliente-dado {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text);
}
.pix-fs-cliente-dado i { color: var(--gold); width: 14px; font-size: 0.7rem; }

/* Selos de garantia */
.pix-fs-selos {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pix-fs-selos span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  color: var(--green);
  font-weight: 600;
  background: rgba(61,204,120,0.06);
  border: 1px solid rgba(61,204,120,0.18);
  padding: 5px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Coluna direita — QR Code */
.pix-fs-qr {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
}

.pix-fs-qr-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.pix-fs-qr-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.pix-fs-qr-titulo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 1px;
}
.pix-fs-qr-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: -8px;
}

.pix-fs-qr-img-wrap {
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 40px rgba(255,215,0,0.2);
  display: inline-block;
  position: relative;
}
.pix-fs-qr-img-wrap::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 20px;
  border: 1px solid rgba(255,215,0,0.2);
  animation: qrRing 2s ease-in-out infinite;
}
@keyframes qrRing {
  0%,100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.03); }
}
.pix-fs-qr-img {
  width: 200px; height: 200px;
  display: block;
  border-radius: 10px;
}

/* Timer */
.pix-fs-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,68,68,0.08);
  border: 1px solid rgba(255,68,68,0.2);
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 0.78rem;
  color: var(--muted);
}
.pix-fs-timer i { color: var(--red); }
.pix-fs-timer-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--gold);
  min-width: 50px;
}

/* Status pulsante */
.pix-fs-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
}
.pix-fs-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  animation: checkPulse 1.3s ease-in-out infinite;
}
.pix-fs-status p { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.pix-fs-status strong { color: var(--white); }

/* Copia e cola */
.pix-fs-copia {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pix-fs-copia-header {
  background: var(--surface3);
  padding: 10px 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255,215,0,0.5);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.pix-fs-copia-body { padding: 14px 16px; }
.pix-fs-copia-code {
  font-size: 0.66rem;
  color: rgba(255,255,255,0.25);
  word-break: break-all;
  line-height: 1.6;
  margin-bottom: 10px;
  font-family: monospace;
}
.pix-fs-copiar-btn {
  width: 100%;
  background: var(--surface4);
  border: 1px solid var(--border2);
  color: var(--gold);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.pix-fs-copiar-btn:hover { background: var(--gold); color: var(--black); border-color: var(--gold); }

/* Instrução passos */
.pix-fs-passos {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}
.pix-fs-passos-titulo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.pix-fs-passo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}
.pix-fs-passo:last-child { margin-bottom: 0; }
.pix-fs-passo-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border2);
  color: var(--gold);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Sucesso fullscreen */
.pix-fs-sucesso {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 40px 20px;
  text-align: center;
  gap: 16px;
  animation: pixFsEntra 0.4s cubic-bezier(0.34,1.16,0.64,1);
}
.pix-fs-ok-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--gold);
  animation: okRing 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.pix-fs-ok-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 1px;
}
.pix-fs-ok-sub { font-size: 0.9rem; color: var(--muted); line-height: 1.7; max-width: 380px; }
.pix-fs-ok-email {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(61,204,120,0.08);
  border: 1px solid rgba(61,204,120,0.2);
  border-radius: 12px; padding: 14px 20px;
  font-size: 0.82rem; color: var(--green);
}
.pix-fs-fechar {
  background: var(--gold); color: var(--black);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 900;
  padding: 14px 40px; border-radius: 50px; border: none;
  cursor: pointer; letter-spacing: 0.5px;
  transition: all 0.2s;
}
.pix-fs-fechar:hover { background: var(--gold-dark); transform: scale(1.04); }

/* Responsivo mobile */
@media (max-width: 768px) {
  .pix-fs-body {
    grid-template-columns: 1fr;
    padding: 20px 14px 40px;
    gap: 16px;
  }
  .pix-fs-qr { position: static; }
  .pix-fs-qr-img { width: 180px; height: 180px; }
  .pix-fs-header { padding: 14px 16px; }
  .pix-fs-logo { font-size: 0.95rem; }
}
/* Input de nome */
.chat-nome-wrap {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface2);
  flex-shrink: 0;
}
.chat-nome-input {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}
.chat-nome-input::placeholder { color: rgba(255,255,255,0.22); }
.chat-nome-input:focus { border-color: var(--gold); }
.chat-nome-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: var(--black);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.chat-nome-btn:hover { transform: scale(1.1); }