.help-popup {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: max(1.25rem, env(safe-area-inset-right, 0px)) !important;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px)) !important;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
  font-family: 'Outfit', Verdana, Arial, sans-serif;
  pointer-events: none;
}

body.products-mega-open .help-popup {
  opacity: 0;
  visibility: hidden;
}

.help-popup__panel,
.help-popup__tease,
.help-popup__fab {
  pointer-events: auto;
}

.help-popup__panel {
  display: flex;
  flex-direction: column;
  width: min(320px, calc(100vw - 2.3rem));
  height: min(420px, calc(100dvh - 7.5rem));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  background: #0a0a0a;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  color: #f5f5f7;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transform-origin: 100% 100%;
  visibility: hidden;
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.28s ease;
}

.help-popup__panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.help-popup__panel[hidden] {
  display: flex !important;
}

.help-popup__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 0.95rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #111;
}

.help-popup__eyebrow {
  margin: 0 0 0.22rem;
  color: rgba(245, 245, 247, 0.46);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.help-popup__title {
  margin: 0;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.help-popup__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: -0.1rem;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(245, 245, 247, 0.55);
  cursor: pointer;
}

.help-popup__close:hover {
  color: #fff;
}

.help-popup__thread {
  flex: 1;
  overflow-y: auto;
  padding: 0.95rem 0.95rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.help-popup__msg {
  max-width: 88%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 2px;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
}

.help-popup__msg--in {
  align-self: flex-start;
  background: #1a1a1a;
  color: rgba(245, 245, 247, 0.88);
}

.help-popup__msg--out {
  align-self: flex-end;
  background: #c3002f;
  color: #fff;
}

.help-popup__contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 92%;
  padding: 0.7rem 0.75rem;
}

.help-popup__contact-title {
  margin: 0;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.help-popup__contact-copy {
  margin: 0;
  color: rgba(245, 245, 247, 0.72);
  font-size: 0.75rem;
  line-height: 1.4;
}

.help-popup__wa {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0 0.75rem;
  border-radius: 2px;
  background: #25d366;
  color: #fff !important;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.help-popup__wa:hover {
  background: #1ebe57;
  color: #fff !important;
}

.help-popup__wa svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.help-popup__composer {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f0f0f;
}

.help-popup__input {
  flex: 1;
  min-height: 38px;
  max-height: 88px;
  resize: none;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  background: #161616;
  color: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.help-popup__input::placeholder {
  color: rgba(245, 245, 247, 0.4);
}

.help-popup__input:focus {
  outline: none;
  border-color: rgba(195, 0, 47, 0.7);
}

.help-popup__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: #c3002f;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.help-popup__send:hover {
  background: #a80028;
}

.help-popup__tease {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(240px, calc(100vw - 5.5rem));
  padding: 0.55rem 0.45rem 0.55rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  color: #111;
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.28s ease;
}

.help-popup__tease.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.help-popup__tease[hidden] {
  display: flex !important;
}

.help-popup__tease-text {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: nowrap;
}

.help-popup__tease-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
}

.help-popup__tease-close:hover {
  color: #111;
}

.help-popup__fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: #c3002f;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.help-popup__fab:hover,
.help-popup__fab[aria-expanded='true'] {
  background: #a80028;
}

.help-popup__fab-icon {
  width: 22px;
  height: 22px;
}

.help-popup__fab-icon--close {
  display: none;
  width: 14px;
  height: 14px;
}

.help-popup__fab[aria-expanded='true'] .help-popup__fab-icon--chat {
  display: none;
}

.help-popup__fab[aria-expanded='true'] .help-popup__fab-icon--close {
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .help-popup__panel,
  .help-popup__tease,
  .help-popup__fab {
    transition: none;
  }

  .help-popup__panel,
  .help-popup__tease {
    transform: none;
  }
}
