/* chatbot.css - todos los selectores empiezan con #cb-root o .cb- para no chocar con los estilos de la tienda */

#cb-root {
  --cb-color: #1f6f5c;
  /* cambia aquí el color principal */
  --cb-bg: #ffffff;
  --cb-text: #1d2521;
  --cb-soft: #eef2f0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#cb-root *,
#cb-root *::before,
#cb-root *::after {
  box-sizing: border-box;
}

/* Icono flotante */
#cb-root .cb-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  transition: transform .15s ease;
}

#cb-root .cb-toggle:hover {
  transform: scale(1.06);
}

#cb-root .cb-toggle img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

#cb-root .cb-toggle:focus-visible,
#cb-root .cb-input:focus-visible,
#cb-root .cb-send:focus-visible,
#cb-root .cb-close:focus-visible {
  outline: 3px solid #f2b705;
  outline-offset: 2px;
}

/* Modal */
#cb-root .cb-panel {
  position: fixed;
  right: 20px;
  bottom: 98px;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 40px);
  height: 420px;
  max-height: calc(100vh - 120px);
  background: var(--cb-bg);
  color: var(--cb-text);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#cb-root .cb-panel.open {
  display: flex;
  animation: cb-in .18s ease-out;
}

@keyframes cb-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

#cb-root .cb-head {
  background: var(--cb-color);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}

#cb-root .cb-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

#cb-root .cb-title img {
  border-radius: 50%;
  display: block;
}

#cb-root .cb-close {
  background: none;
  border: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* Mensajes */
#cb-root .cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#cb-root .cb-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#cb-root .cb-bot {
  background: var(--cb-soft);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

#cb-root .cb-user {
  background: var(--cb-color);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Formulario */
#cb-root .cb-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #dde3e0;
}

#cb-root .cb-input {
  flex: 1;
  padding: 9px 10px;
  border: 1px solid #c5cdc9;
  border-radius: 8px;
  font-size: 14px;
}

#cb-root .cb-send {
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--cb-color);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

#cb-root .cb-send:disabled {
  opacity: .5;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  #cb-root .cb-panel.open {
    animation: none;
  }

  #cb-root .cb-toggle {
    transition: none;
  }
}