#chatbot-toggle {
  position: fixed;
  right: 22px !important;
  bottom: 85px !important;
  width: 62px;
  height: 62px;
  background: #fff;
  color: white;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10001 !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: all .2s ease;

  display: flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  overflow: hidden;
}

#chatbot-toggle:hover {
  transform: translateY(-3px);
}

#chatbot-toggle img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

#chatbot-container {
  position: fixed;
  right: 22px !important;
  bottom: 155px !important;
  width: 420px;
  max-width: calc(100vw - 30px);
  height: 560px;
  max-height: calc(100vh - 180px);
  display: none;
  flex-direction: column;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  background: #fff;
  z-index: 10000 !important;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
}

#chatbot-header {
  background: linear-gradient(135deg, #0d6efd, #0056b3);
  color: white;
  padding: 13px 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

#chatbot-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  line-height: 1.45;
  scroll-behavior: smooth;
  background: #fff;
}

#chatbot-form {
  margin: 0;
  flex-shrink: 0;
}

#chatbot-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
  gap: 8px;
  background-color: #f8f8f8;
}

#chatbot-input input {
  flex: 1;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  min-width: 0;
}

#chatbot-input input:focus {
  border-color: #0d6efd;
}

#chatbot-send {
  all: unset;
  background-color: #0d6efd;
  color: white;
  width: 48px;
  height: 48px;
  font-size: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#chatbot-send:hover {
  background-color: #0056b3;
}

/* Mensajes del chat */
/* Mensajes del chat */
.chatbot-msg,
#chatbot-body > div {
  white-space: pre-line;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  margin: 0;
}

.chatbot-option-number {
  background: #1f8f3a;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  flex-shrink: 0;
}

.chatbot-msg {
  padding: 10px 12px;
  border-radius: 14px;
  max-width: 86%;
  line-height: 1.45;
  margin-bottom: 2px;
}

/* Bot izquierda celeste */
.chatbot-msg.bot {
  background: #e8f4ff;
  align-self: flex-start;
  color: #333;
  text-align: left;
  border-left: 4px solid #0d6efd;
}

/* Usuario derecha verde claro */
.chatbot-msg.user {
  background: #dff7e8;
  align-self: flex-end;
  color: #1f3d2b;
  text-align: right;
  border-right: 4px solid #28a745;
}

.chatbot-msg strong,
#chatbot-body > div strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.chatbot-msg.bot strong {
  color: #0d6efd;
}

.chatbot-msg.user strong {
  color: #1f7a3a;
}

/* WhatsApp flotante */
.float {
  right: 22px !important;
  bottom: 150px !important;
  z-index: 9998 !important;
}

/* Flecha subir */
.back-to-top {
  right: 20px !important;
  bottom: 20px !important;
  z-index: 9997 !important;
}

/* Mobile */
@media (max-width: 768px) {
  #chatbot-toggle {
    right: 14px !important;
    bottom: 85px !important;
    width: 58px;
    height: 58px;
  }

  #chatbot-toggle img {
    width: 58px;
    height: 58px;
  }

  .float {
    right: 14px !important;
    bottom: 150px !important;
  }

  .back-to-top {
    right: 14px !important;
    bottom: 20px !important;
  }

  #chatbot-container {
    width: calc(100% - 24px);
    right: 12px !important;
    bottom: 155px !important;
    height: 70vh;
    max-height: 70vh;
  }

  #chatbot-body {
    font-size: 14px;
  }

  .chatbot-msg {
    max-width: 90%;
  }
}

#chatbot-header span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-header-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
}