/* 🔹 Encabezado */
#chat-header {
  background: #b71c1c;
  color: white;
  padding: 12px;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 🔹 Botón cerrar (X) */
#chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#chat-close:hover {
  transform: scale(1.2);
}

/* 🔹 Scrollbar personalizado en mensajes */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}
#chat-messages::-webkit-scrollbar-thumb {
  background: #b71c1c;
  border-radius: 4px;
}
#chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

/* 🔹 Animación de aparición de burbujas */
.msg {
  animation: fadeIn 0.3s ease;
}

/* 🔹 Placeholder del input */
#chat-input input::placeholder {
  color: #888;
  font-style: italic;
}

/* 🔹 Caja del chat (visible en escritorio y móvil) */
#chat-box {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  max-height: 450px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: none; /* se oculta al inicio */
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}

/* 🔹 Cuando se abre el chat */
#chat-box.open {
  display: flex;
}

/* 🔹 Ajustes móviles extra */
@media (max-width: 400px) {
  #chat-icon-wrapper {
    width: 60px;
    height: 60px;
  }

  #chat-icon {
    width: 30px;
    height: 30px;
  }

  #chat-icon-text {
    font-size: 14px;
    padding: 6px 12px;
  }

  #chat-box {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    max-height: 420px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none; /* 🔹 Se oculta al inicio */
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
  }

  /* 🔹 Cuando tiene la clase "open" (JS la agrega) */
  #chat-box.open {
    display: flex;
  }
}
