/* Webchat de soporte — burbuja flotante inferior derecha */
#yalo-support-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: inherit;
}

.sc-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--color-primary, #111827);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.sc-bubble:hover { transform: scale(1.07); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3); }
.sc-bubble .sc-icon-close { font-size: 22px; line-height: 1; }

.sc-window {
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sc-pop 0.18s ease-out;
}
.sc-window[hidden] { display: none; }
@keyframes sc-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.sc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--color-primary, #111827);
  color: #fff;
}
.sc-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.sc-header-text { flex: 1; min-width: 0; }
.sc-header-text h4 { margin: 0; font-size: 15px; }
.sc-header-text p { margin: 1px 0 0; font-size: 12px; opacity: 0.75; }
.sc-close {
  border: none; background: transparent; color: #fff; opacity: 0.8;
  font-size: 15px; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.sc-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }

.sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
}
.sc-row { display: flex; }
.sc-row.agent { justify-content: flex-start; }
.sc-row.user { justify-content: flex-end; }
.sc-agent-bubble, .sc-user-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.sc-agent-bubble { background: #fff; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; color: #1f2937; }
.sc-user-bubble { background: var(--color-accent, #2563eb); color: #fff; border-bottom-right-radius: 4px; }

.sc-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.sc-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #9ca3af;
  animation: sc-blink 1.2s infinite;
}
.sc-typing span:nth-child(2) { animation-delay: 0.2s; }
.sc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sc-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 6px; background: #f8fafc; }
.sc-chip {
  border: 1px solid var(--color-accent, #2563eb);
  color: var(--color-accent, #2563eb);
  background: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.sc-chip:hover { background: var(--color-accent, #2563eb); color: #fff; }

.sc-error {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; color: #991b1b;
}
.sc-error p { margin: 0 0 4px; font-weight: 600; }
.sc-error span { opacity: 0.8; }
.sc-error button {
  margin-left: 6px; border: none; background: #991b1b; color: #fff;
  border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}

.sc-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid #e5e7eb; background: #fff;
}
.sc-input-row input {
  flex: 1; border: 1px solid #d1d5db; border-radius: 999px;
  padding: 9px 15px; font-size: 14px; outline: none;
}
.sc-input-row input:focus { border-color: var(--color-accent, #2563eb); }
.sc-input-row button {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--color-accent, #2563eb); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sc-input-row button:disabled { opacity: 0.5; cursor: default; }

.sc-footer {
  text-align: center; font-size: 11px; color: #9ca3af;
  padding: 6px 0 9px; background: #fff;
}

@media (max-width: 480px) {
  #yalo-support-root { right: 12px; bottom: 12px; }
  .sc-window { height: 440px; }
}
