:root {
  --chat-primary: #289E6C;
  --chat-primary-dark: #22805a;
  --chat-primary-soft: #edf7f2;
  --chat-primary-muted: #d4ede3;
  --chat-primary-shadow: rgba(40, 158, 108, 0.45);
  --chat-primary-glow: rgba(40, 158, 108, 0.8);
}

.quickbuy-live-chat-widget {
  position: fixed;
  right: max(0px, env(safe-area-inset-right));
  top: auto;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 16px));
  transform: none;
  z-index: 40;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.quickbuy-live-chat-launchers {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.quickbuy-live-chat-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--chat-primary);
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 18px 0 0 18px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 4px #08080814, 0 1px 2px #08080833, inset 0 6px 12px #ffffff1f, inset 0 1px 1px #fff3 !important;
}

.quickbuy-live-chat-launcher--whatsapp {
  background: #25d366;
  text-decoration: none;
}

.quickbuy-live-chat-launcher--whatsapp:hover {
  filter: brightness(1.03);
}

.quickbuy-live-chat-launcher:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.quickbuy-live-chat-launcher-icon {
  display: inline-flex;
  position: relative;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.quickbuy-whatsapp-popup {
  position: absolute;
  right: 78px;
  bottom: 6px;
  z-index: 2;
  transform: translateX(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.quickbuy-whatsapp-popup.is-visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.quickbuy-whatsapp-popup.is-hidden {
  transform: translateX(10px);
  opacity: 0;
  pointer-events: none;
}

.quickbuy-whatsapp-popup-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
  border: 1px solid #ececf0;
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
  box-shadow: 0 12px 30px -20px rgba(10, 10, 15, 0.35);
}

.quickbuy-whatsapp-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--chat-primary);
  color: #fff;
  flex-shrink: 0;
}

.quickbuy-whatsapp-title {
  font-size: 12px;
  line-height: 1.1;
  font-weight: 800;
  color: #0a0a0f;
}

.quickbuy-whatsapp-subtitle {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
  color: #5a5a6a;
}

.quickbuy-whatsapp-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #289E6C;
  margin-left: 4px;
  vertical-align: middle;
  animation: quickbuy-whatsapp-dot-pulse 1s ease-in-out infinite;
}

@keyframes quickbuy-whatsapp-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.quickbuy-live-chat-launcher-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--chat-primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px -10px var(--chat-primary-shadow);
  animation: quickbuy-chat-badge-pulse 1.1s ease-in-out infinite;
}

.quickbuy-live-chat-launcher-badge.hidden {
  display: none !important;
}

@keyframes quickbuy-chat-badge-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.14);
    opacity: 0.78;
  }
}

.quickbuy-live-chat-launcher-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.quickbuy-live-chat-launcher-text strong {
  font-size: 13px;
  font-weight: 800;
}

.quickbuy-live-chat-launcher-text small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
}

.quickbuy-live-chat-backdrop {
  display: none;
}

.quickbuy-live-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(92vw, 392px);
  border: 1px solid #ececf0;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 24px 70px -30px rgba(10, 10, 15, 0.32), 0 10px 24px -18px var(--chat-primary-shadow) !important;
  animation: quickbuy-chat-panel-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes quickbuy-chat-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

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

.quickbuy-live-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.18), transparent 32%),
    var(--chat-primary);
  color: #fff;
  padding: 14px;
}

.quickbuy-live-chat-agent {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.quickbuy-live-chat-avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28) !important;
}

.quickbuy-live-chat-avatar svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.1;
}

.quickbuy-live-chat-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.quickbuy-live-chat-status {
  display: inline-flex;
  margin-top: 4px;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.quickbuy-live-chat-status i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #289E6C;
  box-shadow: 0 0 0 2px rgba(40, 158, 108, 0.24) !important;
}

.quickbuy-live-chat-close {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.quickbuy-live-chat-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.quickbuy-live-chat-messages {
  min-height: 240px;
  max-height: min(46vh, 360px);
  overflow-y: auto;
  padding: 14px;
  background:
    linear-gradient(180deg, #fff 0%, var(--chat-primary-soft) 100%);
  scrollbar-width: thin;
}

.qb-chat-msg {
  display: flex;
  margin-bottom: 10px;
}

.qb-chat-msg .qb-chat-text {
  display: inline-block;
  max-width: 82%;
  border-radius: 16px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.42;
  word-break: break-word;
}

.qb-chat-msg-client {
  justify-content: flex-end;
}

.qb-chat-msg-client .qb-chat-text {
  background: var(--chat-primary);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 20px -14px var(--chat-primary-glow) !important;
}

.qb-chat-msg-support .qb-chat-text {
  background: #fff;
  color: #0a0a0f;
  border: 1px solid #ececf0;
  border-bottom-left-radius: 6px;
}

.qb-chat-empty {
  display: flex;
  min-height: 170px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--chat-primary-muted);
  border-radius: 18px;
  background: #fff;
  color: #8a8a99;
  font-size: 12px;
  font-weight: 700;
}

.qb-chat-presets {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 12px 0;
  border-top: 1px solid #f3f3f6;
  background: #fff;
}

.qb-chat-preset {
  flex: 0 0 auto;
  border: 1px solid #ececf0;
  background: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #5a5a6a;
  padding: 7px 10px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.qb-chat-preset:hover {
  border-color: var(--chat-primary);
  background: var(--chat-primary-soft);
  color: var(--chat-primary);
}

.qb-chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid #ececf0;
  background: #fff;
}

.qb-chat-input {
  width: 100%;
  flex: 1;
  border: 2px solid #ececf0;
  border-radius: 14px;
  height: 42px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #0a0a0f;
  outline: 0;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.qb-chat-input::placeholder {
  color: #b8b8c4;
}

.qb-chat-input:focus {
  border-color: var(--chat-primary);
  background: var(--chat-primary-soft);
}

.qb-chat-send {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--chat-primary);
  color: #fff;
  border-radius: 14px;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 4px #08080814, 0 1px 2px #08080833, inset 0 6px 12px #ffffff1f, inset 0 1px 1px #fff3 !important;
}

.qb-chat-send:hover,
.qb-chat-primary-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.qb-chat-prestart {
  padding: 18px;
  background: #fff;
}

.qb-chat-quick-actions {
  padding: 18px;
  background: #fff;
}

.qb-chat-quick-presets {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.qb-chat-quick-preset {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #ececf0;
  border-radius: 16px;
  background: #fafafa;
  color: #0a0a0f;
  padding: 11px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.qb-chat-quick-preset:hover {
  border-color: var(--chat-primary);
  background: var(--chat-primary-soft);
  color: var(--chat-primary);
}

.qb-chat-quick-preset svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.qb-chat-quick-answer {
  margin: 0 0 14px;
  border: 1px solid var(--chat-primary-muted);
  border-radius: 18px;
  background: var(--chat-primary-soft);
  padding: 12px;
}

.qb-chat-quick-answer strong {
  display: block;
  color: #0a0a0f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.qb-chat-quick-answer p {
  margin: 7px 0 0;
  color: #5a5a6a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.qb-chat-talk-button {
  margin-top: 4px;
}

.qb-chat-prestart-eyebrow {
  display: inline-flex;
  border-radius: 999px;
  background: var(--chat-primary-soft);
  padding: 5px 9px;
  color: var(--chat-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.qb-chat-prestart-title {
  margin: 12px 0 0;
  color: #0a0a0f;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.08;
}

.qb-chat-prestart-copy {
  margin: 7px 0 14px;
  color: #5a5a6a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.qb-chat-field {
  display: block;
}

.qb-chat-field > span {
  display: block;
  margin-bottom: 7px;
  color: #8a8a99;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.qb-chat-field-error {
  margin: 6px 2px 0;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.qb-chat-input.qb-chat-input-error {
  border-color: #ef4444;
  background: #fff5f5;
}

.qb-chat-notification-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 14px;
  border: 1px solid #ececf0;
  border-radius: 16px;
  background: #fafafa;
  padding: 10px;
  color: #5a5a6a;
}

.qb-chat-notification-option input {
  margin-top: 2px;
  accent-color: var(--chat-primary);
}

.qb-chat-notification-option strong,
.qb-chat-notification-option small {
  display: block;
}

.qb-chat-notification-option strong {
  color: #0a0a0f;
  font-size: 12px;
  font-weight: 800;
}

.qb-chat-notification-option small {
  margin-top: 2px;
  color: #8a8a99;
  font-size: 11px;
  font-weight: 600;
}

.qb-chat-primary-button {
  display: inline-flex;
  width: 100%;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  background: var(--chat-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 4px #08080814, 0 1px 2px #08080833, inset 0 6px 12px #ffffff1f, inset 0 1px 1px #fff3 !important;
}

.qb-chat-typing {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  color: #8a8a99;
  padding: 0 14px 10px;
  background: var(--chat-primary-soft);
}

.qb-chat-typing::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 4px;
  margin-left: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--chat-primary) 30%, transparent 30% 40%, var(--chat-primary) 40% 70%, transparent 70% 80%, var(--chat-primary) 80%);
  opacity: 0.55;
  animation: qb-chat-dots 0.9s ease-in-out infinite;
}

@keyframes qb-chat-dots {
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@media (min-width: 1024px) {
  .quickbuy-live-chat-panel {
    right: 0;
    bottom: 72px;
    width: 392px;
  }

  .quickbuy-live-chat-panel:not(.hidden) {
    transform: none;
  }
}

@media (max-width: 767px) {
  .quickbuy-live-chat-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    z-index: 1;
    background: rgba(10, 10, 15, 0.46);
    backdrop-filter: blur(2px);
  }

  .quickbuy-live-chat-backdrop.hidden {
    display: none !important;
  }

  .quickbuy-live-chat-widget {
    right: max(0px, env(safe-area-inset-right));
    top: auto;
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 12px));
    transform: none;
    left: auto;
  }

  .quickbuy-live-chat-panel {
    position: fixed;
    right: auto;
    left: 50%;
    top: 50%;
    bottom: auto;
    width: min(92vw, 420px);
    max-height: 84vh;
    transform: translate(-50%, -50%);
    border-radius: 22px;
    z-index: 2;
    animation: quickbuy-chat-mobile-modal-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .quickbuy-live-chat-launcher {
    margin-left: auto;
  }

  .quickbuy-whatsapp-popup {
    right: 66px;
    bottom: 2px;
  }

  .quickbuy-whatsapp-popup-content {
    min-width: 205px;
    padding: 9px 10px;
  }

  .quickbuy-live-chat-messages {
    max-height: 42vh;
  }
}

@keyframes quickbuy-chat-mobile-modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, -47%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
