/* Botón flotante */
.preu-assistant-btn {
  position: fixed;
  bottom: 13px;   
  right: 166px;    
  z-index: 9999;
  width: auto;    
  height: 48px;
  border-radius: 25px; 
  padding: 0 16px;   
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  border: none;

  /* 🎨 Azul metálico como la imagen */
  background: linear-gradient(180deg, #0b3dff 0%, #0030b3 40%, #001f73 100%);
  background-repeat: no-repeat;
  background-size: cover;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.preu-assistant-btn:hover {
  transform: scale(1.08);
  box-shadow:  0 6px 16px rgba(0,0,0,0.35);
  background: linear-gradient(180deg, #1a52ff 0%, #003cff 40%, #002799 100%);
}

.preu-assistant-btn .btn-text {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

/* Contenedor chat */
.preu-assistant {
  position: fixed; bottom: 79px; right: 171px;
  width: 360px; height: 500px; display: none; flex-direction: column;
  background: #FAFAFA; border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,.25); z-index: 9998;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from{opacity:0; transform:scale(.95)} to{opacity:1; transform:scale(1)} }

/* Header */
.preu-chat-header {
  background: #293D85; color: #fff; padding: 12px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.preu-chat-header button { background:transparent; border:0; color:#fff; font-size:18px; cursor:pointer; }

/* Mensajes */
.preu-chat-messages { flex:1; padding: 12px; overflow-y:auto; font-size: 15px; }
.preu-msg { margin-bottom: 10px; line-height: 1.45; }
.preu-msg.user { text-align: right; }
.preu-msg.user span {
  background:#293D85; color:#fff; padding:8px 12px; border-radius:12px 12px 0 12px; display:inline-block;
}
.preu-msg.bot span {
  background:#E1EDCC; color:#333; padding:8px 12px; border-radius:12px 12px 12px 0; display:inline-block;
}

/* Barra de entrada (unificada) */
.preu-chat-input {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid #ddd;
  padding: 6px 8px;
}
.preu-chat-input input[type="text"] {
  flex: 1;
  min-width: 0; 
  border: 0; padding: 10px; outline: none; font-size: 15px;
}
.preu-chat-input button {
  background:#9BC354; color:#fff; border:0; padding:10px 14px; cursor:pointer;
  border-radius: 8px;
}
.preu-chat-input button:hover { background:#86AD4A; }
.preu-chat-input button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Botón de adjuntar archivos 📎 */
.attach-btn {
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  user-select: none;
  transition: transform 0.1s ease;
  border-radius: 8px;
}
.attach-btn:hover { transform: scale(1.15); }
.attach-btn:active { transform: scale(0.92); }

/* Bandeja de adjuntos (chips que se acumulan antes de enviar) */
.attach-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 40%;
  overflow: auto;
}

/* Chip de archivo + botón X para quitar */
.attach-chip {
  background: #eef2f7;
  color: #334155;
  border: 1px solid #dde3ec;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip .chip-x {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #556;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.attach-chip .chip-x:hover { color: #b00020; }

/* Indicador “pensando…” con 3 puntitos */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 1em;
}
.typing-dots i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #9aa3b2;
  opacity: 0.3;
  display: inline-block;
  animation: dotPulse 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(1) { animation-delay: 0s; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
  40%          { transform: translateY(-3px); opacity: 0.9; }
}

/* Saltos de línea naturales en burbujas */
.preu-msg span { white-space: pre-wrap; }

/* Estado / links de acento (si lo usas) */
.preu-accent { color:#DE00FE; }

/* Bandeja de archivos (chips) */
.preu-file-tray{
  display:flex; flex-wrap:wrap; gap:6px;
  padding:8px 10px 0; max-height:84px; overflow:auto;
}

/* Chip de archivo */
.preu-file-chip{
  border:0; border-radius:16px; padding:6px 10px;
  background:#EEF3E6; color:#2b2b2b; font-size:12px;
  cursor:pointer; display:inline-flex; align-items:center; gap:6px;
}
.preu-file-chip span{ font-weight:700; }
.preu-file-chip:hover{ background:#E3EDD5; }

/* Botón 📎 */
.attach-btn{
  cursor:pointer; font-size:18px; padding:4px 8px; margin-left:6px; user-select:none;
}
.attach-btn:hover{ transform:scale(1.1); }