/* ─── EVIKE MOBILITY — ASISTENTE VIRTUAL (chatbot.css) ──────────────────────── */

/* Widget container */
#evike-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Outfit', 'Inter', sans-serif;
}

/* ── Botón flotante ── */
#evike-chat-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #0d0d1a;
  border: 2px solid #00CC7A;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 204, 122, 0.45), 0 2px 8px rgba(0,0,0,0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  outline: none;
  padding: 2px;
}

#evike-btn-mascota {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  pointer-events: none;
}

#evike-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(0, 204, 122, 0.65), 0 2px 8px rgba(0,0,0,0.6);
  border-color: #33ff99;
}

#evike-chat-btn.evike-active {
  box-shadow: 0 0 0 3px rgba(0, 204, 122, 0.4), 0 8px 32px rgba(0, 204, 122, 0.5);
}

/* Notificación roja */
.evike-chat-notif {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #FF3B3B;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0a0a12;
  animation: evikeNotifPulse 1.8s ease-in-out infinite;
}

@keyframes evikeNotifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ── Ventana de chat ── */
#evike-chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #12121e;
  border-radius: 20px;
  border: 1px solid rgba(0, 204, 122, 0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

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

/* ── Header ── */
#evike-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0d0d1a 0%, #111120 100%);
  border-bottom: 1px solid rgba(0, 204, 122, 0.15);
  flex-shrink: 0;
}

.evike-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid #00CC7A;
  box-shadow: 0 0 10px rgba(0, 204, 122, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: #0d0d1a;
}

.evike-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.evike-chat-title {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.evike-chat-title strong {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.evike-chat-title span {
  font-size: 11px;
  color: #00CC7A;
  margin-top: 1px;
}

#evike-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

#evike-chat-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ── Área de mensajes ── */
#evike-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#evike-chat-messages::-webkit-scrollbar {
  width: 4px;
}
#evike-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#evike-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 204, 122, 0.3);
  border-radius: 4px;
}

/* ── Mensajes ── */
.evike-msg {
  display: flex;
  animation: evikeMsgIn 0.22s ease;
}

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

.evike-msg.evike-bot {
  justify-content: flex-start;
  align-items: flex-end;
  gap: 8px;
}

.evike-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #00CC7A;
  object-fit: cover;
  flex-shrink: 0;
  background: #0d0d1a;
  display: block;
}

.evike-msg.evike-user {
  justify-content: flex-end;
}

.evike-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
}

.evike-bot .evike-bubble {
  background: #1c1c2e;
  color: #e8e8f0;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
}

.evike-user .evike-bubble {
  background: linear-gradient(135deg, #00CC7A 0%, #00a862 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.evike-bubble a {
  color: #00CC7A !important;
  text-decoration: none;
  font-weight: 600;
}

.evike-bubble a:hover {
  text-decoration: underline;
}

/* Typing indicator */
.evike-typing {
  padding: 12px 16px !important;
  display: flex;
  align-items: center;
  gap: 5px;
}

.evike-typing span {
  width: 7px;
  height: 7px;
  background: #00CC7A;
  border-radius: 50%;
  display: inline-block;
  animation: evikeTypingDot 1.1s ease-in-out infinite;
}

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

@keyframes evikeTypingDot {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Sugerencias rápidas ── */
#evike-chat-suggestions {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

#evike-chat-suggestions::-webkit-scrollbar { display: none; }

.evike-suggestion {
  white-space: nowrap;
  background: rgba(0, 204, 122, 0.1);
  border: 1px solid rgba(0, 204, 122, 0.3);
  color: #00CC7A;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.evike-suggestion:hover {
  background: rgba(0, 204, 122, 0.25);
  color: #fff;
}

/* ── Input ── */
#evike-chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: #0d0d1a;
  flex-shrink: 0;
}

#evike-chat-input {
  flex: 1;
  background: #1c1c2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  color: #e8e8f0;
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

#evike-chat-input:focus {
  border-color: rgba(0, 204, 122, 0.5);
}

#evike-chat-input::placeholder {
  color: #555;
}

#evike-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00CC7A 0%, #009957 100%);
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#evike-chat-send:hover {
  transform: scale(1.08);
  opacity: 0.9;
}

/* ── Tarjeta de Producto con Botones de Compra y Carrito ── */
.evike-chat-product-card {
  width: 100%;
  box-sizing: border-box;
}

.evike-chat-prod-img-wrap {
  text-align: center;
  margin: 8px 0;
}

.evike-chat-prod-img {
  max-height: 135px;
  max-width: 100%;
  object-fit: contain;
  background: #161626;
  border-radius: 12px;
  padding: 8px;
  border: 1px solid rgba(0, 204, 122, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: inline-block;
}

.evike-chat-prod-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 6px 0;
}

.evike-chat-btn-buy {
  background: linear-gradient(135deg, #00CC7A 0%, #00a35c 100%);
  color: #050508 !important;
  font-weight: 800;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(0, 204, 122, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  text-decoration: none !important;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.evike-chat-btn-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 204, 122, 0.5);
  opacity: 0.96;
}

.evike-chat-btn-buy:active {
  transform: translateY(1px);
}

.evike-chat-btn-cart {
  background: rgba(0, 204, 122, 0.12);
  color: #00CC7A !important;
  border: 1.5px solid #00CC7A;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.evike-chat-btn-cart:hover {
  background: rgba(0, 204, 122, 0.25);
  border-color: #33ff99;
  color: #fff !important;
}

.evike-chat-btn-cart.evike-btn-added {
  background: #00CC7A !important;
  color: #050508 !important;
  border-color: #00CC7A !important;
  font-weight: 800;
}

.evike-chat-wa-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #25D366 !important;
  font-weight: 600;
  font-size: 12.5px;
  text-decoration: none !important;
  padding: 5px 8px;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

.evike-chat-wa-link:hover {
  text-decoration: underline !important;
  opacity: 0.9;
}

/* ── Responsivo móvil ── */
@media (max-width: 480px) {
  #evike-chatbot {
    bottom: 16px;
    right: 16px;
  }

  #evike-chat-window {
    bottom: 80px;
    right: -8px;
    width: calc(100vw - 24px);
    max-width: none;
    height: 480px;
  }
}
