/* Floating contact widget */

.floating-contacts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.floating-contacts__close,
.floating-contacts__btn,
.floating-contacts__collapsed {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    box-shadow 0.25s ease,
    visibility 0.25s ease;
  flex-shrink: 0;
}

.floating-contacts__close:hover,
.floating-contacts__btn:hover,
.floating-contacts__collapsed:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.floating-contacts__close svg,
.floating-contacts__btn svg,
.floating-contacts__collapsed svg {
  width: 26px;
  height: 26px;
}

.floating-contacts__close {
  background: rgba(60, 60, 60, 0.85);
  order: -1;
}

.floating-contacts__close svg {
  width: 20px;
  height: 20px;
}

.floating-contacts__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.floating-contacts__btn--whatsapp {
  background: #25d366;
}

.floating-contacts__btn--telegram {
  background: #29b6f6;
}

.floating-contacts__btn--wechat {
  background: #07c160;
}

.floating-contacts__btn--email {
  background: #111;
}

.floating-contacts__btn--email svg {
  width: 24px;
  height: 24px;
}

.floating-contacts__btn.is-hidden,
.floating-contacts__close.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.5);
  height: 0;
  width: 0;
  margin: 0;
  overflow: hidden;
}

.floating-contacts__collapsed {
  background: #25d366;
  position: absolute;
  bottom: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.5);
}

.floating-contacts[data-collapsed="true"] .floating-contacts__list,
.floating-contacts[data-collapsed="true"] .floating-contacts__close {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.5);
  height: 0;
  width: 0;
  overflow: hidden;
  gap: 0;
}

.floating-contacts[data-collapsed="true"] .floating-contacts__collapsed {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  position: static;
}

.floating-contacts__list .floating-contacts__btn {
  animation: fc-slide-in 0.35s ease backwards;
}

.floating-contacts__list .floating-contacts__btn:nth-child(1) { animation-delay: 0.05s; }
.floating-contacts__list .floating-contacts__btn:nth-child(2) { animation-delay: 0.1s; }
.floating-contacts__list .floating-contacts__btn:nth-child(3) { animation-delay: 0.15s; }
.floating-contacts__list .floating-contacts__btn:nth-child(4) { animation-delay: 0.2s; }

@keyframes fc-slide-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* WeChat modal */

.floating-contacts-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.floating-contacts-modal[hidden] {
  display: none;
}

.floating-contacts-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.floating-contacts-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.floating-contacts-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.floating-contacts-modal__close:hover {
  background: #f0f0f0;
}

.floating-contacts-modal__close svg {
  width: 18px;
  height: 18px;
}

.floating-contacts-modal__title {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 16px;
  color: #222;
}

.floating-contacts-modal__qr {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin: 0 auto 12px;
  border-radius: 8px;
}

.floating-contacts-modal__id {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  color: #444;
  word-break: break-all;
}

.floating-contacts-modal__copy {
  margin-top: 12px;
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  background: #07c160;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}

.floating-contacts-modal__copy:hover {
  background: #06ad56;
}

@media (max-width: 480px) {
  .floating-contacts {
    bottom: 16px;
    right: 16px;
  }

  .floating-contacts__close,
  .floating-contacts__btn,
  .floating-contacts__collapsed {
    width: 48px;
    height: 48px;
  }

  .floating-contacts__close svg,
  .floating-contacts__btn svg,
  .floating-contacts__collapsed svg {
    width: 24px;
    height: 24px;
  }
}
