/* Digitech AI Support — floating chat (Jaybee-style) */

.float-widgets {
  position: fixed;
  right: max(0.85rem, env(safe-area-inset-right, 0px));
  bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-end;
  pointer-events: none;
}

.float-widgets > * {
  pointer-events: auto;
}

.wa-btn,
.chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  font-weight: 700;
  font-size: 0.82rem;
  border: 0;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-body, "Figtree", sans-serif);
}

.wa-btn {
  background: #25d366;
  color: #fff !important;
}

.wa-btn:hover {
  background: #1ebe57;
  color: #fff !important;
}

.wa-btn svg {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: currentColor;
}

.chat-toggle {
  background: linear-gradient(135deg, var(--teal, #2ec4b6), var(--teal-deep, #1a9e92));
  color: #07111f !important;
  max-width: min(13rem, calc(100vw - 5rem));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 12px 28px rgba(46, 196, 182, 0.35);
}

.chat-toggle:hover {
  filter: brightness(1.05);
}

.chat-toggle-short {
  display: none;
}

.chatbot {
  width: min(22rem, calc(100vw - 2rem));
  background: #0d1b2e;
  border: 1px solid rgba(232, 242, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  max-height: min(32rem, 72vh);
  overflow: hidden;
}

.chatbot.is-open {
  display: flex;
}

.chatbot-head {
  background: linear-gradient(135deg, #1a9e92, #0d6e68);
  color: #fff;
  padding: 0.75rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  gap: 0.5rem;
}

.ai-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
}

.ai-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.chatbot-head-actions {
  display: flex;
  gap: 0.25rem;
}

.chatbot-head button {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.chatbot-head button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.chatbot-welcome {
  padding: 1rem 1.1rem 0.75rem;
  text-align: center;
  background: #0a1628;
}

.ai-avatar {
  width: 4.25rem;
  height: 4.25rem;
  margin: 0.15rem auto 0.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-weight: 800;
  font-size: 1.45rem;
  color: #07111f;
  background: linear-gradient(145deg, #2ec4b6, #1a9e92);
  box-shadow: 0 10px 24px rgba(46, 196, 182, 0.35);
}

.chatbot-welcome h3 {
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 1.15rem;
  color: #e8f0fa;
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.chatbot-welcome h3 em {
  font-style: normal;
  color: #2ec4b6;
}

.chatbot-welcome > p {
  font-size: 0.84rem;
  color: #9bb0c7;
  line-height: 1.45;
  margin: 0 0 0.85rem;
}

.ai-help-title {
  font-weight: 700 !important;
  color: #e8f0fa !important;
  font-size: 0.92rem !important;
  margin: 0 0 0.55rem !important;
  text-align: left;
}

.ai-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  text-align: left;
}

.ai-quick-grid button {
  border: 1px solid rgba(232, 242, 255, 0.12);
  background: rgba(17, 34, 56, 0.9);
  color: #e8f0fa;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.7rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ai-quick-grid button:hover {
  border-color: rgba(46, 196, 182, 0.45);
  background: rgba(46, 196, 182, 0.12);
  color: #2ec4b6;
}

.chatbot-body {
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1;
  display: none;
  gap: 0.5rem;
  background: #07111f;
  min-height: 8rem;
}

.chatbot-body.is-active {
  display: grid;
}

.chat-msg {
  font-size: 0.84rem;
  padding: 0.55rem 0.7rem;
  max-width: 92%;
  line-height: 1.45;
}

.chat-msg.bot {
  background: rgba(17, 34, 56, 0.95);
  border: 1px solid rgba(232, 242, 255, 0.12);
  color: #e8f0fa;
  border-radius: 12px 12px 12px 4px;
}

.chat-msg.user {
  background: linear-gradient(135deg, #2ec4b6, #1a9e92);
  color: #07111f;
  margin-left: auto;
  border-radius: 12px 12px 4px 12px;
  font-weight: 600;
}

.chatbot-actions {
  display: none;
}

.chatbot-input-row {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem 0.8rem;
  border-top: 1px solid rgba(232, 242, 255, 0.1);
  background: #0a1628;
  align-items: center;
}

.chatbot-input-row input {
  flex: 1;
  border: 1px solid rgba(232, 242, 255, 0.14);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-size: 16px;
  background: rgba(7, 17, 31, 0.8);
  color: #e8f0fa;
  min-width: 0;
  font-family: inherit;
}

.chatbot-input-row input:focus {
  outline: 2px solid rgba(46, 196, 182, 0.35);
  border-color: #2ec4b6;
}

.chatbot-input-row button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2ec4b6, #1a9e92);
  color: #07111f;
  font-weight: 800;
  font-size: 0.95rem;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
}

.chatbot-input-row button:hover {
  filter: brightness(1.08);
}

@media (max-width: 560px) {
  .chat-toggle-full {
    display: none;
  }

  .chat-toggle-short {
    display: inline;
  }

  .chatbot {
    width: min(100vw - 1rem, 22rem);
    max-height: min(72vh, 32rem);
  }
}
