/* AudriBOT: botón flotante a la izquierda, a la altura del botón de WhatsApp */
.audribot {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 999;
  font-family: var(--font-sans, 'Inter', sans-serif);
}

.audribot-toggle {
  height: 58px;
  min-width: 58px;
  padding: 0 18px 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary-800, #461c7c), var(--color-primary-600, #6b33b5));
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(70, 28, 124, 0.4);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: audribotPulse 2.5s infinite;
}

.audribot-toggle:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 8px 30px rgba(70, 28, 124, 0.55);
}

.audribot-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
}

@keyframes audribotPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(70, 28, 124, 0.4); }
  50% { box-shadow: 0 4px 35px rgba(70, 28, 124, 0.65); }
}

.audribot.is-open .audribot-toggle { animation: none; }

.audribot-panel {
  position: absolute;
  left: 0;
  bottom: 72px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(20, 10, 40, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.audribot-panel[hidden] { display: none; }

.audribot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(135deg, var(--color-primary-900, #351460), var(--color-primary-700, #5a27a0));
  color: #fff;
}

.audribot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.audribot-header-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.audribot-header-text strong { font-size: 16px; }
.audribot-header-text small { font-size: 12px; opacity: .85; }

.audribot-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.audribot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f6f3fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audribot-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
  word-wrap: break-word;
}

.audribot-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #2b2238;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.audribot-msg.user {
  align-self: flex-end;
  background: var(--color-primary-800, #461c7c);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.audribot-links { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

.audribot-links a {
  color: var(--color-primary-700, #5a27a0);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.audribot-links a:hover { text-decoration: underline; }
.audribot-links a.wa { color: #128C7E; }

.audribot-typing { display: inline-flex; gap: 4px; }
.audribot-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #9b8bb4;
  animation: audribotDot 1s infinite ease-in-out;
}
.audribot-typing span:nth-child(2) { animation-delay: .15s; }
.audribot-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes audribotDot {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.audribot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #eee8f5;
}

.audribot-chips button {
  border: 1px solid var(--color-primary-200, #d7c6ef);
  background: var(--color-primary-50, #f7f2fd);
  color: var(--color-primary-800, #461c7c);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
}

.audribot-chips button:hover { background: var(--color-primary-100, #ece2fa); }

.audribot-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
}

.audribot-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #ddd3ea;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.audribot-form input:focus { border-color: var(--color-primary-600, #6b33b5); }

.audribot-form button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--color-primary-800, #461c7c);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .audribot { left: 16px; bottom: 24px; }
  .audribot-label { display: none; }
  .audribot-toggle { padding: 0; width: 58px; justify-content: center; }
  .audribot-panel { width: calc(100vw - 32px); height: 70vh; }
}
