/* --- CONTENEDOR GENERAL --- */
#chat-alenises-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: "Helvetica Neue", Arial, sans-serif;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* --- BURBUJA FLOTANTE --- */
.chat-bubble {
  background: #7cc68d;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.3s ease;
}
.chat-bubble:hover {
  transform: scale(1.1);
}

/* --- CAJA DEL CHAT --- */
.chat-box {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 330px;
  max-height: 520px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.25s ease-in-out;
}
.hidden {
  display: none;
}

/* --- ENCABEZADO --- */
.chat-header {
  background: #6dc181;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px 14px 0 0;
}
.chat-logo {
  width: 20px;
  height: 20px;
}

/* --- MENSAJES --- */
.chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background-color: #f4f8f4;
  scroll-behavior: smooth;
  line-height: 1.45;
  font-size: 14.5px;
}

/* --- MENSAJE USUARIO --- */
.user-msg {
  background: #d5ecff;
  color: #002b45;
  padding: 8px 10px;
  border-radius: 10px 10px 0 10px;
  margin: 8px 0;
  align-self: flex-end;
  max-width: 85%;
  margin-left: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* --- MENSAJE BOT --- */
.bot-msg {
  background: #eaf6e9;
  color: #202020;
  padding: 9px 11px;
  border-radius: 10px 10px 10px 0;
  margin: 8px 0;
  max-width: 85%;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14.5px;
}

/* --- ENLACES --- */
.bot-msg a {
  color: #248b4a;
  text-decoration: none;
  font-weight: 600;
  word-break: break-word;
}
.bot-msg a:hover {
  text-decoration: underline;
}

/* --- ÁREA DE ENTRADA --- */
.chat-input-area {
  display: flex;
  border-top: 1px solid #ddd;
  background: #fff;
}
.chat-input-area input {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 0 0 0 14px;
  outline: none;
}
.chat-input-area button {
  background: #7cc68d;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  border-radius: 0 0 14px 0;
  width: 48px;
  transition: background 0.3s;
}
.chat-input-area button:hover {
  background: #6ab57c;
}

/* --- SCROLL PERSONALIZADO --- */
.chat-messages::-webkit-scrollbar {
  width: 7px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #b8d8ba;
  border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #8fc48e;
}

/* --- ANIMACIÓN --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- AJUSTES MÓVILES --- */
@media (max-width: 600px) {
  #chat-alenises-container {
    bottom: 20px !important;
    right: 20px !important;
  }
  .chat-box {
    position: fixed !important;
    right: 10px !important;
    bottom: 85px !important;
    width: calc(100% - 40px) !important;
    max-height: 80vh !important;
    height: auto !important;
    font-size: 15px;
    border-radius: 16px;
  }
  .chat-header {
    font-size: 14px;
    padding: 10px;
  }
  .chat-input-area input {
    font-size: 13px;
  }
  .chat-bubble {
    width: 55px;
    height: 55px;
  }
}

/* --- OCULTAR CHAT AL HACER SCROLL --- */
@media (max-width: 768px) {
  #chat-alenises-container.hide-on-scroll {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
