.floating-contacts {
  --contact-size: 58px;
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 200;
}

.floating-contact-list {
  display: grid;
  gap: 10px;
}

.contact-fab {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--contact-size);
  height: var(--contact-size);
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 13px 32px rgba(9, 48, 36, .24);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.contact-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 17px 36px rgba(9, 48, 36, .3);
}

.contact-fab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.contact-fab.zalo { background: #0866ff; }
.contact-fab.facebook { background: #1877f2; }
.contact-fab.line { background: #06c755; }
.contact-fab.is-pending { filter: saturate(.72); }
.contact-fab.zalo[aria-expanded="true"] { box-shadow: 0 0 0 4px rgba(8, 102, 255, .18), 0 17px 36px rgba(9, 48, 36, .3); }

.contact-brand {
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
}

.zalo .contact-brand { font-size: 15px; }
.facebook .contact-brand { font: 900 32px/1 Arial, sans-serif; }
.line .contact-brand { font-size: 12px; letter-spacing: -.02em; }

.contact-label {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  padding: 7px 10px;
  border-radius: 9px;
  background: #15352b;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity .18s ease, transform .18s ease;
}

.contact-fab:hover .contact-label,
.contact-fab:focus-visible .contact-label {
  opacity: 1;
  transform: translate(0, -50%);
}

.zalo-qr-card {
  position: absolute;
  right: calc(var(--contact-size) + 14px);
  bottom: 0;
  width: min(292px, calc(100vw - 104px));
  padding: 17px;
  border: 1px solid rgba(18, 65, 50, .14);
  border-radius: 22px;
  background: #fff;
  color: #15352b;
  box-shadow: 0 22px 58px rgba(4, 39, 28, .27);
  animation: contact-card-in .2s ease both;
}

.zalo-qr-card[hidden] { display: none; }

.zalo-qr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.zalo-qr-head span {
  display: block;
  margin-bottom: 4px;
  color: #0866ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}

.zalo-qr-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.zalo-qr-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef3f0;
  color: #15352b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.zalo-qr-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #dbe5df;
  border-radius: 16px;
  background: #fff;
}

.zalo-qr-help {
  margin: 11px 2px 0;
  color: #64766f;
  font-size: 13px;
  line-height: 1.5;
}

.contact-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.marketing-page .toast {
  right: calc(var(--contact-size, 58px) + 40px);
  bottom: calc(25px + env(safe-area-inset-bottom));
  max-width: min(320px, calc(100vw - 120px));
}

@keyframes contact-card-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
  .floating-contacts {
    --contact-size: 54px;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .floating-contact-list { gap: 8px; }
  .contact-fab { border-radius: 17px; }
  .zalo-qr-card {
    right: calc(var(--contact-size) + 10px);
    width: min(270px, calc(100vw - 86px));
    padding: 14px;
    border-radius: 19px;
  }

  .zalo-qr-head h2 { font-size: 18px; }
  .zalo-qr-help { font-size: 12px; }
  .marketing-page .toast {
    right: 78px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 96px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-fab,
  .contact-label { transition: none; }
  .zalo-qr-card { animation: none; }
}
