/* ===== CHATBOT VEXA ===== */

/* Botón flotante con Vexito */
#chatbot-toggle {
  position: fixed;
  bottom: 14px;
  right: 20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.5));
  transition: all 0.3s ease;
}

#chatbot-toggle img.vexito-btn {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: vexito-float 3s ease-in-out infinite;
}

@keyframes vexito-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-7px); }
}

#chatbot-toggle:hover {
  filter: drop-shadow(0 0 22px rgba(0, 229, 255, 0.8));
  transform: scale(1.07);
}

/* Punto de notificación */
#chatbot-toggle .notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #ff4b4b;
  border-radius: 50%;
  border: 2px solid var(--secondary);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.7; }
}

/* Ventana del chatbot */
#chatbot-window {
  position: fixed;
  bottom: 105px;
  right: 24px;
  width: 360px;
  max-height: 520px;
  border-radius: 16px;
  background: var(--secondary);
  border: 1px solid rgba(0, 229, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(0,229,255,0.08);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom right;
}

#chatbot-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
#chatbot-header {
  background: linear-gradient(135deg, rgba(0,229,255,0.12) 0%, rgba(10,25,47,0.95) 100%);
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Avatar en el header: círculo con imagen de Vexito */
.chatbot-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0,229,255,0.08);
  border: 1.5px solid rgba(0,229,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.chatbot-avatar img.vexito-header-img {
  width: 110%;
  height: 110%;
  object-fit: contain;
  object-position: center top;
  margin-top: 4px;
}

.chatbot-header-text h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.chatbot-header-text p {
  font-size: 0.72rem;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-header-text p::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #4cff72;
  border-radius: 50%;
}

#chatbot-close {
  background: none;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.2s;
  line-height: 1;
}

#chatbot-close:hover { color: var(--primary); }

/* Área de mensajes */
#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,0.3) transparent;
}

#chatbot-messages::-webkit-scrollbar { width: 4px; }
#chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(0,229,255,0.3);
  border-radius: 10px;
}

/* Burbujas */
.chat-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.5;
  word-break: break-word;
  animation: bubbleIn 0.22s ease;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-bubble.bot {
  background: rgba(23, 42, 70, 0.9);
  border: 1px solid rgba(0,229,255,0.12);
  color: var(--text-light);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: rgba(0,229,255,0.15);
  border: 1px solid rgba(0,229,255,0.25);
  color: var(--text-light);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Opciones rápidas */
.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  animation: bubbleIn 0.25s ease;
}

.chat-option-btn {
  background: transparent;
  border: 1px solid rgba(0,229,255,0.35);
  color: var(--primary);
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
}

.chat-option-btn:hover {
  background: rgba(0,229,255,0.12);
  border-color: var(--primary);
}

/* Indicador "escribiendo" */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(23, 42, 70, 0.9);
  border: 1px solid rgba(0,229,255,0.12);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  animation: bubbleIn 0.22s ease;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.5;
  animation: typing 1.1s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Input área */
#chatbot-input-area {
  border-top: 1px solid rgba(0,229,255,0.1);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(10,25,47,0.6);
  flex-shrink: 0;
}

#chatbot-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  padding: 8px 14px;
  color: #fff;
  font-size: 0.82rem;
  font-family: 'Montserrat', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

#chatbot-input:focus { border-color: rgba(0,229,255,0.4); }
#chatbot-input::placeholder { color: rgba(255,255,255,0.3); }

#chatbot-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--secondary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

#chatbot-send:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
}

/* Responsive móvil */
@media (max-width: 480px) {
  #chatbot-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 100px;
    max-height: 72vh;
  }

  #chatbot-toggle {
    right: 14px;
    bottom: 14px;
    width: 70px;
    height: 70px;
  }
}
