/* ——— Asistente Comercial Flotante ——— */
:root {
  --chat-bg: #fff;
  --chat-primary: var(--orange, #FF6A30);
  --chat-text: #1f2937;
  --chat-height: 500px;
  --chat-width: 350px;
  --chat-radius: 16px;
  --chat-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* FAB Botón */
.assistant-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--chat-primary);
  border-radius: 50%;
  box-shadow: var(--chat-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.8rem;
  z-index: 9999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.assistant-fab:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 40px rgba(255, 106, 48, 0.4);
}

/* Tooltip "Te ayudo?" */
.assistant-tooltip {
  position: absolute;
  right: 75px;
  background: #fff;
  color: var(--chat-text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.assistant-fab:hover .assistant-tooltip,
.assistant-fab.subtle-pulse .assistant-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Chat Window */
.assistant-window {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: var(--chat-width);
  height: var(--chat-height);
  max-height: 70vh;
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.assistant-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header del chat */
.chat-header {
  background: var(--chat-primary);
  color: #fff;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1.2rem;
  cursor: pointer;
}

.chat-close:hover { color: #fff; }

/* Cuerpo mensajes */
.chat-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f9fafb;
}

/* Burbujas */
.msg {
  max-width: 85%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: bgFade 0.3s ease forwards;
}

.msg.bot {
  align-self: flex-start;
  background: #fff;
  border-bottom-left-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.msg.user {
  align-self: flex-end;
  background: var(--chat-primary);
  color: #fff;
  border-bottom-right-radius: 2px;
}

/* Opciones / Botones */
.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-btn {
  background: #fff;
  border: 1px solid var(--chat-primary);
  color: var(--chat-primary);
  padding: 0.5rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-btn:hover {
  background: var(--chat-primary);
  color: #fff;
}

/* Formularios dentro del chat */
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-form input,
.chat-form textarea,
.chat-form select {
  padding: 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
}

.chat-form button {
  background: var(--chat-primary);
  color: #fff;
  border: none;
  padding: 0.6rem;
  border-radius: 6px;
  margin-top: 0.25rem;
  cursor: pointer;
}

.chat-privacy {
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

/* Móvil */
@media (max-width: 480px) {
  .assistant-window {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

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