/* Tiendait Assistant - floating chat (con icono personalizado) */
#tiendait-assistant-launcher {
  position: fixed; 
  left: 18px; 
  bottom: 18px; /* ¡û a la IZQUIERDA */
  z-index: 9999;
  width: 62px; 
  height: 62px; 
  border-radius: 50%;
  display: flex; 
  align-items: center; 
  justify-content: center;
  background: transparent; /* fondo transparente porque el ¨ªcono ya es circular */
  border: none; 
  cursor: pointer;
  padding: 0; /* importante para la imagen */
  box-shadow: 0 10px 22px rgba(2,132,199,.35);
  transition: transform .15s ease, box-shadow .15s ease;
  animation: ti-pulse 3s ease-in-out infinite;
}

#tiendait-assistant-launcher .ti-avatar {
  display: block;
  width: 100%; 
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  content: url("/tiendait-assistant/media/img/ia_tiendait_icono.png");
}

#tiendait-assistant-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 30px rgba(2,132,199,.45);
}
#tiendait-assistant-launcher:focus-visible {
  outline: 3px solid rgba(255,255,255,.7);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(25,118,210,.45);
}

/* Animaci¨®n sutil */
@keyframes ti-pulse { 
  0%   { transform: scale(1) } 
  50%  { transform: scale(1.015) } 
  100% { transform: scale(1) } 
}
@media (prefers-reduced-motion: reduce){
  #tiendait-assistant-launcher { animation: none; }
}

/* Tooltip */
#tiendait-assistant-launcher::after {
  content: "Asistente IA Tiendait";
  position: absolute; 
  bottom: 70px; 
  left: 50%; 
  transform: translateX(-50%);
  background: rgba(0,0,0,.82); 
  color: #fff;
  padding: 6px 10px; 
  border-radius: 6px; 
  font-size: 13px; 
  white-space: nowrap;
  opacity: 0; 
  pointer-events: none; 
  transition: opacity .25s ease;
}
#tiendait-assistant-launcher:hover::after { opacity: 1; }

/* Widget */
#tiendait-assistant-widget {
  position: fixed; 
  left: 18px; 
  bottom: 86px;
  width: 360px; 
  max-width: 92vw; 
  height: 520px;
  background: #ffffff; 
  border-radius: 16px; 
  border: 1px solid #e6eef7;
  box-shadow: 0 16px 44px rgba(2,6,23,.18);
  display: none; 
  flex-direction: column; 
  overflow: hidden; 
  z-index: 10000;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}

/* Header con el icono */
#tiendait-assistant-header {
  background: linear-gradient(135deg,#004AAD,#D71920);
  color: #fff; 
  padding: 12px 14px; 
  display: flex; 
  align-items: center; 
  gap: 10px;
}
#tiendait-assistant-header .ti-logo {
  width: 40px; 
  height: 40px; 
  border-radius: 50%;
  flex: 0 0 auto; 
  object-fit: cover; 
  display: block;
  content: url("/tiendait-assistant/media/img/ia_tiendait_icono.png");
}
#tiendait-assistant-header .title { font-weight: 700; line-height: 1.1; }
#tiendait-assistant-header .subtitle { font-size: 12px; opacity: .9; }

#tiendait-assistant-close {
  margin-left: auto; 
  background: rgba(255,255,255,.15); 
  color: #fff; 
  border: 0;
  border-radius: 10px; 
  width: 32px; 
  height: 32px; 
  cursor: pointer;
}

/* Mensajes */
#tiendait-assistant-messages { flex: 1; padding: 12px; overflow-y: auto; background: #f8fbff; }
.ti-msg { margin: 8px 0; display: flex; gap: 8px; }
.ti-bot { align-items: flex-start; }
.ti-user { justify-content: flex-end; }
.ti-bubble {
  max-width: 80%; padding: 10px 12px; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: 14px; line-height: 1.35;
}
.ti-bot .ti-bubble { background: #fff; color: #0f172a; border: 1px solid #e6eef7; }
.ti-user .ti-bubble { background: #004AAD; color: #fff; }

/* Input */
#tiendait-assistant-input {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e6eef7; background: #ffffff;
}
#tiendait-assistant-input input {
  flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid #cfe3f7; outline: none;
}
#tiendait-assistant-input button {
  padding: 10px 14px; border-radius: 10px; border: none; background: #004AAD; color: #fff; cursor: pointer;
}
#tiendait-assistant-input button:hover {
  background: linear-gradient(135deg,#004AAD,#D71920);
}

/* Botones r¨¢pidos */
.ti-quick { display: inline-flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ti-quick button {
  background: #e6f4ff; border: 1px solid #cfe3f7; color: #0f172a;
  border-radius: 999px; padding: 6px 10px; cursor: pointer; font-size: 12px;
}
.ti-quick button:hover { border-color: #629ff0; }

.ti-cta { margin-top: 8px; font-size: 13px; }
.ti-cta a { text-decoration: none; }
