/* Widget "Hablemos!" — CSS a mano, no pasa por Tailwind (js/ no está en el content
   de tailwind.config.js). Colores tomados de tailwind.config.js para consistencia. */

#qsc-trigger {
  position: fixed;
  /* elevado sobre el botón flotante de WhatsApp (ambos conviven en escritorio) */
  bottom: 6.5rem;
  right: 1.5rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #b8541e;
  color: #f2ebdb;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.4rem;
  font-family: 'Karla', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
#qsc-trigger:hover {
  background: #8f3f14;
  transform: scale(1.05);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}
#qsc-trigger svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

#qsc-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 380px;
  max-width: calc(100vw - 3rem);
  height: 560px;
  max-height: calc(100vh - 3rem);
  background: #faf6ec;
  border-radius: 0.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Karla', Arial, sans-serif;
}

#qsc-header {
  background: #1b2e12;
  color: #f2ebdb;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#qsc-header-title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.1rem; }
#qsc-header-sub { font-size: 0.75rem; opacity: 0.7; margin-top: 0.1rem; }
#qsc-close {
  background: transparent;
  border: none;
  color: #f2ebdb;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
}
#qsc-close:hover { opacity: 1; }

#qsc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.qsc-msg {
  max-width: 82%;
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.qsc-msg.qsc-user {
  align-self: flex-end;
  background: #b8541e;
  color: #f2ebdb;
  border-bottom-right-radius: 0.2rem;
}
.qsc-msg.qsc-bot {
  align-self: flex-start;
  background: #e6dac2;
  color: #26301f;
  border-bottom-left-radius: 0.2rem;
}
.qsc-msg.qsc-fallback {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed #b8541e;
  color: #26301f;
}
.qsc-msg.qsc-fallback a { color: #b8541e; font-weight: 700; }

#qsc-typing {
  align-self: flex-start;
  display: flex;
  gap: 0.25rem;
  padding: 0.6rem 0.85rem;
}
#qsc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #93a97e;
  animation: qsc-bounce 1.2s infinite ease-in-out;
}
#qsc-typing span:nth-child(2) { animation-delay: 0.15s; }
#qsc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes qsc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

#qsc-form {
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e6dac2;
  background: #faf6ec;
}
#qsc-input {
  flex: 1;
  border: 1px solid #e6dac2;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: #26301f;
  background: #fff;
}
#qsc-input:focus { outline: 2px solid #b8541e; outline-offset: 1px; }
#qsc-send {
  background: #b8541e;
  color: #f2ebdb;
  border: none;
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#qsc-send:hover:not(:disabled) { background: #8f3f14; }
#qsc-send:disabled { opacity: 0.5; cursor: default; }
#qsc-send svg { width: 1.1rem; height: 1.1rem; }

/* Solo escritorio: en mobile se mantiene el CTA de WhatsApp existente */
@media (max-width: 767.98px) {
  #qsc-trigger, #qsc-panel { display: none !important; }
}
