/* ============================================================
   Giftrix Chat Bot Widget — v1
============================================================ */
.gx-chat * { box-sizing: border-box; font-family: 'Inter', system-ui, sans-serif; }
.gx-chat { position: fixed; z-index: 9999; }

/* Floating button — placed on LEFT bottom (WhatsApp is on right bottom) */
.gx-chat-fab {
  position: fixed; left: 22px; bottom: 22px; z-index: 9999;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--white); border: none;
  height: 58px; padding: 0 22px;
  border-radius: 30px; cursor: pointer;
  box-shadow: 0 10px 28px rgba(184, 137, 59, 0.35);
  display: flex; align-items: center; gap: 10px;
  font-size: 0.94rem; font-weight: 600; font-family: 'Inter', sans-serif;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}
.gx-chat-fab:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(184, 137, 59, 0.45); }
.gx-chat-fab.hidden { opacity: 0; pointer-events: none; transform: scale(0.85); }
.gx-chat-fab-icon { font-size: 1.4rem; }
.gx-chat-fab-pulse {
  position: absolute; right: 14px; top: 14px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #25d366; border: 2px solid #fff;
}
.gx-chat-fab-pulse::before {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%; background: #25d366; opacity: 0.5;
  animation: gx-pulse 2s ease-out infinite;
}
@keyframes gx-pulse {
  0% { transform: scale(0.7); opacity: 0.5; }
  100% { transform: scale(1.8); opacity: 0; }
}
.gx-chat-fab-nudge { animation: gx-bounce 1.6s ease 2; }
@keyframes gx-bounce {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(-10px); }
  40% { transform: translateY(0); }
  60% { transform: translateY(-6px); }
  80% { transform: translateY(0); }
}
@media (max-width: 520px) {
  .gx-chat-fab-label { display: none; }
  .gx-chat-fab {
    padding: 0; width: 56px; height: 56px;
    bottom: 14px; left: 14px;
    justify-content: center;
  }
}

/* Chat panel — opens from bottom-left where the FAB is */
.gx-chat-panel {
  position: fixed; left: 22px; bottom: 22px; z-index: 10000;
  width: 380px; max-width: calc(100vw - 24px);
  height: 620px; max-height: calc(100vh - 24px);
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(20, 24, 31, 0.25);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom left;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.gx-chat-panel.open {
  opacity: 1; pointer-events: auto;
  transform: translateY(0) scale(1);
}
@media (max-width: 520px) {
  .gx-chat-panel {
    left: 0; bottom: 0; right: 0; top: 0;
    width: 100%; max-width: 100%;
    height: 100%; max-height: 100%;
    border-radius: 0;
  }
}

/* Header */
.gx-chat-head {
  background: linear-gradient(135deg, var(--ink), var(--navy));
  color: var(--white);
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.gx-chat-head-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gx-chat-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--white); padding: 4px;
  display: grid; place-items: center; flex-shrink: 0;
}
.gx-chat-avatar img { width: 100%; height: 100%; object-fit: contain; }
.gx-chat-title { font-weight: 600; font-size: 1rem; line-height: 1.2; }
.gx-chat-status {
  font-size: 0.78rem; opacity: 0.85;
  display: flex; align-items: center; gap: 5px; margin-top: 2px;
}
.gx-chat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: gx-dot-pulse 2s infinite;
}
@keyframes gx-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.gx-chat-close {
  background: transparent; border: none; color: var(--white);
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
  transition: background 0.2s ease;
}
.gx-chat-close:hover { background: rgba(255, 255, 255, 0.12); }

/* Body */
.gx-chat-body {
  flex: 1; overflow-y: auto;
  padding: 18px 16px 12px;
  background: linear-gradient(180deg, #fbf9f5 0%, #ffffff 100%);
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin; scrollbar-color: #d8d3c7 transparent;
}
.gx-chat-body::-webkit-scrollbar { width: 6px; }
.gx-chat-body::-webkit-scrollbar-thumb { background: #d8d3c7; border-radius: 3px; }

/* Messages */
.gx-msg { display: flex; max-width: 88%; animation: gx-fade-in 0.3s ease; }
@keyframes gx-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.gx-msg-bot { align-self: flex-start; }
.gx-msg-user { align-self: flex-end; }
.gx-msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.gx-msg-bot .gx-msg-bubble {
  background: var(--accent-soft);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
.gx-msg-user .gx-msg-bubble {
  background: var(--ink);
  color: var(--white);
  border-bottom-right-radius: 6px;
}
.gx-msg-bubble strong { font-weight: 700; color: var(--accent-deep); }
.gx-msg-user .gx-msg-bubble strong { color: var(--accent-soft); }
.gx-msg-bubble a {
  color: var(--accent-deep); text-decoration: underline;
}
.gx-msg-bubble ul.gx-list {
  list-style: none; padding: 0; margin: 4px 0;
}
.gx-msg-bubble ul.gx-list li {
  padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,0.08);
}
.gx-msg-bubble ul.gx-list li:last-child { border-bottom: none; }

/* Typing indicator */
.gx-msg-typing { display: flex; align-items: center; gap: 4px; padding: 12px 16px; }
.gx-msg-typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-deep);
  animation: gx-typing 1.2s infinite;
}
.gx-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.gx-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes gx-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Quick options buttons */
.gx-options {
  display: flex; flex-direction: column; gap: 6px;
  margin: 8px 0 4px;
  align-self: flex-start; max-width: 92%;
  animation: gx-fade-in 0.4s ease;
}
.gx-option {
  background: var(--white);
  border: 1.5px solid var(--accent-soft);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 0.9rem; font-weight: 500;
  cursor: pointer; text-align: left;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}
.gx-option:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateX(3px);
}
.gx-option:disabled { opacity: 0.45; cursor: default; }

/* CTA links inside bubbles */
.gx-cta {
  display: inline-block;
  background: #25d366; color: #fff !important;
  padding: 10px 18px; border-radius: 24px;
  font-weight: 600; text-decoration: none !important;
  margin-top: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gx-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(37, 211, 102, 0.4); }

/* Lead form */
.gx-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 8px 0;
  align-self: stretch;
  display: flex; flex-direction: column; gap: 10px;
  animation: gx-fade-in 0.4s ease;
}
.gx-form-group { display: flex; flex-direction: column; gap: 4px; }
.gx-form-label {
  font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
}
.gx-form-input {
  padding: 9px 12px; border: 1.5px solid var(--line);
  border-radius: 8px; font-size: 0.92rem;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.gx-form-input:focus {
  outline: none; border-color: var(--accent);
  background: var(--white);
}
.gx-form-input.gx-form-invalid { border-color: #d4452f; }
textarea.gx-form-input { resize: vertical; min-height: 60px; }
.gx-form-submit {
  background: var(--accent); color: #fff;
  border: none; padding: 11px;
  border-radius: 10px;
  font-size: 0.95rem; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer; margin-top: 4px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.gx-form-submit:hover:not(:disabled) {
  background: var(--accent-deep);
  transform: translateY(-1px);
}
.gx-form-submit:disabled { opacity: 0.6; cursor: wait; }

/* Footer with WhatsApp link */
.gx-chat-foot {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  background: var(--bg);
}
.gx-chat-wa {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  background: #25d366; color: #fff;
  padding: 10px 16px;
  border-radius: 24px;
  font-size: 0.92rem; font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.gx-chat-wa:hover { background: #1fb858; transform: translateY(-1px); color: #fff; }
