.glory-chatbot-root,
.glory-chatbot-root * {
  box-sizing: border-box;
}

.glory-chatbot-root {
  position: fixed;
  right: 110px;
  bottom: 30px;
  z-index: 2147483000;
  font-family: Inter, Arial, sans-serif;
  color: #13201c;
}

.glory-chatbot-toggle {
  position: relative;
  min-width: 112px;
  height: 58px;
  padding: 0 20px 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #16a34a);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(10, 86, 70, 0.28);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.glory-chatbot-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(10, 86, 70, 0.34);
}

.glory-chatbot-toggle-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.glory-chatbot-toggle-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.glory-chatbot-unread {
  position: absolute;
  top: -5px;
  right: -3px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.glory-chatbot-unread[hidden] {
  display: none;
}

.glory-chatbot-window {
  position: absolute;
  right: -86px;
  bottom: 78px;
  width: min(380px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  min-height: 480px;
  background: #f8faf7;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.glory-chatbot-header {
  min-height: 76px;
  padding: 16px;
  background: linear-gradient(135deg, #0f766e, #14532d);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.glory-chatbot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex: 0 0 auto;
}

.glory-chatbot-title {
  min-width: 0;
  flex: 1;
}

.glory-chatbot-title strong,
.glory-chatbot-title span {
  display: block;
  color: #ffffff;
  letter-spacing: 0;
}

.glory-chatbot-title strong {
  font-size: 16px;
  line-height: 1.2;
}

.glory-chatbot-title span {
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.82;
}

.glory-chatbot-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.glory-chatbot-messages {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.08), transparent 32%),
    linear-gradient(180deg, #f8faf7, #eef7f1);
  scrollbar-width: thin;
}

.glory-chatbot-message {
  display: flex;
  margin: 0 0 12px;
}

.glory-chatbot-message-user {
  justify-content: flex-end;
}

.glory-chatbot-message-assistant {
  justify-content: flex-start;
}

.glory-chatbot-bubble {
  max-width: 82%;
  padding: 11px 12px 7px;
  border-radius: 15px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.glory-chatbot-message-assistant .glory-chatbot-bubble {
  background: #ffffff;
  border-bottom-left-radius: 5px;
}

.glory-chatbot-message-user .glory-chatbot-bubble {
  background: #dcfce7;
  border-bottom-right-radius: 5px;
}

.glory-chatbot-message-text {
  color: #13201c;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.glory-chatbot-time {
  display: block;
  margin-top: 5px;
  text-align: right;
  color: #64746c;
  font-size: 10px;
  line-height: 1;
}

.glory-chatbot-message-typing .glory-chatbot-bubble {
  width: 68px;
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 13px 12px;
}

.glory-chatbot-message-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f766e;
  animation: gloryTyping 1s infinite ease-in-out;
}

.glory-chatbot-message-typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.glory-chatbot-message-typing span:nth-child(3) {
  animation-delay: 0.32s;
}

.glory-chatbot-quick-replies {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  background: #ffffff;
  border-top: 1px solid #e3eee7;
}

.glory-chatbot-quick-replies button {
  flex: 0 0 auto;
  border: 1px solid #b7dcc8;
  border-radius: 999px;
  background: #f6fff9;
  color: #0f5132;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.glory-chatbot-whatsapp {
  margin: 0;
  padding: 12px;
  background: #ecfdf5;
  border-top: 1px solid #bbf7d0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.glory-chatbot-whatsapp[hidden] {
  display: none;
}

.glory-chatbot-whatsapp div {
  min-width: 0;
  flex: 1;
}

.glory-chatbot-whatsapp strong,
.glory-chatbot-whatsapp span {
  display: block;
  letter-spacing: 0;
}

.glory-chatbot-whatsapp strong {
  color: #064e3b;
  font-size: 13px;
  line-height: 1.2;
}

.glory-chatbot-whatsapp span {
  margin-top: 2px;
  color: #166534;
  font-size: 11px;
  line-height: 1.25;
}

.glory-chatbot-whatsapp button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #25d366;
  color: #073b1d;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.28);
}

.glory-chatbot-form {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid #e3eee7;
}

.glory-chatbot-input {
  flex: 1;
  min-height: 42px;
  max-height: 92px;
  resize: none;
  border: 1px solid #cfe3d6;
  border-radius: 14px;
  padding: 11px 12px;
  color: #13201c;
  background: #fbfdfb;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  outline: none;
}

.glory-chatbot-input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.glory-chatbot-send {
  min-width: 64px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #0f766e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.glory-chatbot-send:disabled {
  cursor: wait;
  opacity: 0.65;
}

.glory-chatbot-status {
  min-height: 18px;
  padding: 0 14px 10px;
  color: #64746c;
  background: #ffffff;
  font-size: 11px;
}

@keyframes gloryTyping {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .glory-chatbot-root {
    right: 84px;
    bottom: 20px;
  }

  .glory-chatbot-toggle {
    min-width: 58px;
    width: 58px;
    height: 58px;
    padding: 0;
  }

  .glory-chatbot-toggle-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .glory-chatbot-window {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 88px;
    width: auto;
    height: min(74vh, 620px);
    min-height: 430px;
    border-radius: 16px;
  }

  .glory-chatbot-whatsapp {
    align-items: flex-start;
    flex-direction: column;
  }

  .glory-chatbot-whatsapp button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .glory-chatbot-root {
    right: 78px;
  }

  .glory-chatbot-window {
    left: 8px;
    right: 8px;
    bottom: 84px;
  }

  .glory-chatbot-bubble {
    max-width: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glory-chatbot-root *,
  .glory-chatbot-window,
  .glory-chatbot-toggle {
    animation: none !important;
    transition: none !important;
  }
}
