/* === Botón de chat flotante === */
#chat-button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: white;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

#chat-button img,
#mascota-btn-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* Globo de mensaje encima del botón */
#chat-globo {
  position: absolute;
  bottom: 80px;
  right: 0;
  background-color: white;
  color: #333;
  padding: 10px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease-in-out, transform 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

#chat-globo::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 16px;
  border-width: 7px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

#chat-button:hover #chat-globo {
  opacity: 1;
  transform: translateY(0);
}

/* === Caja del chat === */
#chat-box {
  position: fixed;
  bottom: 100px;
  right: 25px;
  width: 360px;
  max-height: 500px;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Ocultar chat inicialmente */
#chat-box.hidden {
  display: none !important;
}

/* Cabecera del chat */
#chat-header {
  background-color: #28333d;
  color: white;
  padding: 14px;
  font-weight: bold;
  font-size: 16px;
  text-align: left;
}

/* Área de mensajes */
#chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background-color: #f6f7fb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#chat-messages::-webkit-scrollbar {
  width: 8px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 6px;
}

/* Entrada de usuario */
#user-input {
  border: none;
  border-top: 1px solid #ddd;
  padding: 14px;
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  background-color: #fefefe;
}

/* Mensajes del bot */
.bot-message {
  background-color: #ecf0f1;
  color: #2c3e50;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 0;
  max-width: 80%;
  align-self: flex-start;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  word-wrap: break-word;
}

/* Mensajes del usuario */
.user-message {
  background-color: #d1f2eb;
  color: #2c3e50;
  padding: 12px 14px;
  border-radius: 18px 18px 0 18px;
  max-width: 80%;
  align-self: flex-end;
  word-wrap: break-word;
}

/* Avatar del bot */
.pixqui-avatar {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Burbuja de texto dentro del mensaje del bot */
.mensaje-burbuja {
  background-color: #ecf0f1;
  color: #2c3e50;
  padding: 10px 12px;
  border-radius: 18px 18px 18px 0;
  max-width: calc(100% - 50px);
  line-height: 1.5;
}

/* Enlaces dentro de los mensajes */
.mensaje-burbuja a {
  color: #2740ae;
  text-decoration: none;
  font-weight: bold;
}

.mensaje-burbuja a:hover {
  text-decoration: underline;
}
