.floating-contact {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.floating-contact__btn {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
  position: relative;
  will-change: transform;
  animation:
    fc-pop-in 260ms ease-out both,
    fc-shake 900ms linear infinite;
  --fc-ring: rgba(255, 255, 255, 0.0);
}

.floating-contact__btn:nth-child(1) { animation-delay: 0ms, 0ms; }
.floating-contact__btn:nth-child(2) { animation-delay: 90ms, 90ms; }
.floating-contact__btn:nth-child(3) { animation-delay: 180ms, 180ms; }
.floating-contact__btn:nth-child(4) { animation-delay: 270ms, 270ms; }

.floating-contact__btn::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  box-shadow: 0 0 0 0 var(--fc-ring);
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  animation: fc-ring 1100ms ease-out infinite;
}

.floating-contact__btn:nth-child(1)::before { animation-delay: 0ms; }
.floating-contact__btn:nth-child(2)::before { animation-delay: -360ms; }
.floating-contact__btn:nth-child(3)::before { animation-delay: -720ms; }
.floating-contact__btn:nth-child(4)::before { animation-delay: -1080ms; }

.floating-contact__btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24), 0 0 0 4px rgba(255, 255, 255, 0.9);
}

.floating-contact__btn:active {
  transform: translateY(0) scale(0.99);
}

.floating-contact__btn svg {
  width: 26px;
  height: 26px;
  display: block;
}

.floating-contact__btn--phone {
  background: #16a34a;
  color: #fff;
  --fc-ring: rgba(22, 163, 74, 0.32);
}

.floating-contact__btn--facebook {
  background: #1877f2;
  color: #fff;
  --fc-ring: rgba(24, 119, 242, 0.30);
}

.floating-contact__btn--zalo {
  background: #0068ff;
  color: #fff;
  --fc-ring: rgba(0, 104, 255, 0.30);
}

.floating-contact__btn--top {
  background: #ffffff;
  color: #1e3a8a;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
  --fc-ring: rgba(59, 130, 246, 0.25);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.floating-contact__btn--top,
.floating-contact__btn--top::before {
  animation: none;
}

.floating-contact__btn--top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.floating-contact__zalo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 30px;
  background: rgba(255, 255, 255, 0.92);
  color: #0b3a82;
  border-radius: 10px;
  font: 700 14px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0.2px;
}

@keyframes fc-pop-in {
  0% { transform: translateY(16px) scale(0.88); }
  70% { transform: translateY(-2px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes fc-shake {
  0% { transform: translateY(0) rotate(0deg); }
  6% { transform: translateY(-2px) rotate(-8deg) translateX(-3px); }
  12% { transform: translateY(1px) rotate(8deg) translateX(3px); }
  18% { transform: translateY(-2px) rotate(-10deg) translateX(-4px); }
  24% { transform: translateY(2px) rotate(10deg) translateX(4px); }
  30% { transform: translateY(-1px) rotate(-8deg) translateX(-3px); }
  36% { transform: translateY(1px) rotate(8deg) translateX(3px); }
  42% { transform: translateY(-2px) rotate(-6deg) translateX(-2px); }
  48% { transform: translateY(2px) rotate(6deg) translateX(2px); }
  54% { transform: translateY(-1px) rotate(-4deg) translateX(-1px); }
  60% { transform: translateY(1px) rotate(4deg) translateX(1px); }
  100% { transform: translateY(0) rotate(0deg) translateX(0); }
}

@keyframes fc-ring {
  0% { opacity: 0; transform: scale(0.9); box-shadow: 0 0 0 0 var(--fc-ring); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.06); box-shadow: 0 0 0 16px rgba(0,0,0,0); }
}

@keyframes fc-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.28); }
  70% { box-shadow: 0 0 0 14px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

@media (max-width: 480px) {
  .floating-contact {
    right: 12px;
    bottom: 12px;
  }
  .floating-contact__btn {
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-contact,
  .floating-contact__btn,
  .floating-contact__btn::before {
    animation: none !important;
  }
  .floating-contact__btn {
    transition: none !important;
  }
}

@media print {
  .floating-contact {
    display: none !important;
  }
}
