/* Botón flotante */
#chat-launcher {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 75px;
  height: 75px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 9999;
}

/* Ventana de chat */
#chat-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 500px;
  height: 65vh;
  max-height: 600px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  font-family: Arial, sans-serif;
}

#chat-widget .chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 120px;
  background: #fff;
}

.hidden {
  display: none !important;
}

/* Cabecera */
.chat-header {
  background: #f5f7fa;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
}

.chat-header img {
  width: 28px;
  height: 28px;
  margin-right: 8px;
}

.chat-header span {
  font-weight: bold;
  font-size: 14px;
  flex: 1;
}

.chat-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  margin-left: 8px;
}

/* Cuerpo */
.chat-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #fff;
}

.message {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
}

.message.bot .avatar {
  margin-right: 8px;
}

.message.bot .avatar img {
  min-width: 18px;
  width: 18px;
}

.message .bubble {
  background: #f1f9ff;
  padding: 10px 14px;
  border-radius: 12px;
  /*max-width: 70%;*/
  font-size: 14px;
}

.message.user {
  justify-content: flex-end !important;
}

.message.user .bubble {
  background: rgb(59, 120, 155);
  color: #fff;
  min-width: 100%;
}

.meta {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
}

/* Pie */
.chat-footer {
  display: flex;
  border-top: 1px solid #ddd;
  padding: 8px;
}

.chat-footer input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px;
  font-size: 14px;
}

.chat-footer button {
  background: none;
  border: none;
  font-size: 18px;
  color: #0b6bb3;
  cursor: pointer;
  margin-left: 6px;
}

.chat-footer button img {
  width: 30px;
}

.chat-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 15px;
  background: #fff;
  border-top: 1px solid #eee;
}

.shortcut {
  background: rgb(59, 120, 155);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s ease;
}

.shortcut:hover {
  filter: brightness(0.85);
}

#shortcuts {
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

#shortcuts.hidden {
  max-height: 0;
  opacity: 0;
}

#chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 12px;
  outline: none;
}

/* Animación puntos */
.bubble.typing {
  background: #f1f9ff;
  color: #003b6f;
  display: inline-flex;
  align-items: center;
}
.typing-dots {
  display: inline-block;
  text-align: center;
}
.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: rgb(59,120,155);
  border-radius: 50%;
  margin: 0 1px;
  opacity: 0.6;
  animation: bounce 1.2s infinite both;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0);}
  40% { transform: translateY(-6px);}
}
