/* ============ Assistente de FAQ — widget flutuante ============ */

#dr-chat-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 70;
  font-family: var(--font-body);
}

#dr-chat-launcher {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.dr-chat-label {
  position: absolute;
  right: 118px;
  bottom: 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-900);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: dr-chat-float 3s ease-in-out infinite;
}
.dr-chat-label strong { color: var(--purple-600); font-size: 13px; }
.dr-chat-label-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--whatsapp);
  box-shadow: 0 0 0 rgba(37,211,102,0.6);
  animation: dr-chat-pulse 1.8s infinite;
  flex-shrink: 0;
}
.dr-chat-label::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 16px;
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid #fff;
}

#dr-chat-toggle {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 4px solid var(--gold-400);
  background: var(--gray-100);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  padding: 0;
  overflow: hidden;
  position: relative;
}
#dr-chat-toggle:hover { transform: translateY(-2px) scale(1.03); }
#dr-chat-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.dr-chat-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--whatsapp);
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.dr-chat-badge svg { width: 18px; height: 18px; }

@keyframes dr-chat-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.55); }
  70% { box-shadow: 0 0 0 7px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
@keyframes dr-chat-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
#dr-chat-panel {
  position: absolute;
  bottom: 118px;
  right: 0;
  width: 340px;
  max-height: 70vh;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
#dr-chat-panel.dr-chat-hidden { display: none !important; }

.dr-chat-header {
  background: var(--gradient-hero);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dr-chat-header-title { display: flex; align-items: center; gap: 10px; }
.dr-chat-header-title img.dr-chat-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: top center; border: 2px solid var(--gold-400); }
.dr-chat-header-title strong { display: block; font-size: 14px; }
.dr-chat-header-title span { display: block; font-size: 11px; opacity: 0.75; }
#dr-chat-close {
  background: none; border: none; color: #fff; font-size: 16px; cursor: pointer;
  opacity: 0.8;
}
#dr-chat-close:hover { opacity: 1; }

.dr-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--gray-100);
  min-height: 220px;
  max-height: 360px;
}
.dr-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}
.dr-chat-msg a { color: inherit; text-decoration: underline; font-weight: 700; }
.dr-chat-msg-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--gray-200);
  color: var(--ink-900);
  border-bottom-left-radius: 4px;
}
.dr-chat-msg-user {
  align-self: flex-end;
  background: var(--gradient-chip);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.dr-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid var(--gray-200);
}
.dr-chat-chip {
  border: 1px solid var(--purple-500);
  color: var(--purple-600);
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dr-chat-chip:hover { background: var(--gray-100); }

.dr-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--gray-200);
  background: #fff;
}
.dr-chat-form input {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
}
.dr-chat-form input:focus { border-color: var(--purple-500); }
.dr-chat-form button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-chip);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.dr-chat-footer {
  padding: 8px 14px 12px;
  background: #fff;
  text-align: center;
}
.dr-chat-footer a {
  font-size: 11px;
  color: var(--gray-500);
  text-decoration: underline;
}

@media (max-width: 480px) {
  #dr-chat-root { right: 16px; bottom: 16px; }
  #dr-chat-toggle { width: 84px; height: 84px; border-width: 3px; }
  #dr-chat-panel { width: calc(100vw - 32px); right: -8px; bottom: 96px; }
  .dr-chat-label { right: 96px; bottom: 8px; font-size: 11px; padding: 8px 10px; }
  .dr-chat-badge { width: 30px; height: 30px; }
}
