.chatbox-popup {
  position: fixed;
  bottom: 20px;
  left: 20px; /* lado izquierdo */
  width: 320px;
  max-width: 90%;
  height: 420px;
  max-height: 70%;
  background: #1a1a1a;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  font-family: 'Poppins', sans-serif;
  transition: bottom 0.3s ease-in-out;
}

.chat-header {
  background: #333;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f5c518;
  border-radius: 10px 10px 0 0;
}

#chat-toggle {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

#chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.chat-message {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
}

.chat-user {
  font-weight: bold;
  margin-right: 5px;
}

.chat-input {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #222;
  padding: 10px;
  display: flex;
}

#chat-message {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  border: none;
  margin-right: 5px;
}

#chat-send {
  background: #f5c518;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

/* Estado dock (minimizado hacia abajo) */
.chat-docked {
  bottom: -360px; /* baja la caja dejando visible solo el header */
}

/* Responsive */
@media (max-width: 600px) {
  .chatbox-popup {
    width: 95%;
    height: 60%;
    bottom: 10px;
    left: 10px;
  }
  .chat-docked {
    bottom: -250px; /* ajuste para móviles */
  }
}
