/* Shared: floating social quick-contact (bottom-right) */

.floating-social {
  position: fixed;
  right: 16px;
  bottom: 90px; /* nâng cao hơn, tránh sát mép dưới */
  z-index: 350;
  display: grid;
  gap: 12px;
}
.floating-social.is-collapsed .floating-social__btn:not(.floating-social__toggle) {
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  pointer-events: none;
}
@supports (padding: max(0px)) {
  .floating-social {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(90px, calc(env(safe-area-inset-bottom) + 74px));
  }
}
.floating-social__btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-card);
  color: var(--color-primary);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.floating-social__btn:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 136, 211, 0.35);
  box-shadow: 0 14px 34px rgba(6, 136, 211, 0.22);
}
.floating-social__btn:active { transform: translateY(-1px) scale(0.98); }
.floating-social__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 136, 211, 0.22), var(--shadow-card);
}
.floating-social__btn svg { width: 20px; height: 20px; display: block; }
.floating-social__toggle {
  cursor: pointer;
}
.floating-social__toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
  transition: transform 0.2s ease;
}
.floating-social:not(.is-collapsed) .floating-social__toggle-icon {
  transform: rotate(45deg);
}

/* Tooltip label */
.floating-social__btn[data-label]::after {
  content: attr(data-label);
  position: absolute;
  right: 56px;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.floating-social__btn:hover::after,
.floating-social__btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 767px) {
  .floating-social { gap: 8px; }
  .floating-social__btn { width: 44px; height: 44px; }
  .floating-social__btn[data-label]::after { display: none; }
  .floating-social.is-collapsed .floating-social__btn:not(.floating-social__toggle) { display: none; }
  .floating-social:not(.is-collapsed) .floating-social__btn:not(.floating-social__toggle) { display: grid; }
}

/* ===== Nổi bật hơn: nút theo MÀU thương hiệu + icon trắng to ===== */
.floating-social__btn {
  color: #fff;
  border: none;
}
.floating-social__btn svg { width: 24px; height: 24px; }
.floating-social__btn[data-label="Zalo"]      { background: #0068ff; box-shadow: 0 10px 24px rgba(0, 104, 255, 0.40); }
.floating-social__btn[data-label="Messenger"] { background: #7c3aed; box-shadow: 0 10px 24px rgba(124, 58, 237, 0.40); }
.floating-social__btn[data-label="Hotline"]   { background: #16a34a; box-shadow: 0 10px 24px rgba(22, 163, 74, 0.40); }
.floating-social__btn[data-label="Email"]     { background: #ea580c; box-shadow: 0 10px 24px rgba(234, 88, 12, 0.40); }
.floating-social__btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28);
}
/* Hotline nhấp nháy nhẹ để thu hút gọi điện */
.floating-social__btn[data-label="Hotline"] { animation: floatPulse 2.2s ease-in-out infinite; }
@keyframes floatPulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(22, 163, 74, 0.40); }
  50% { box-shadow: 0 10px 24px rgba(22, 163, 74, 0.40), 0 0 0 9px rgba(22, 163, 74, 0.16); }
}
@media (prefers-reduced-motion: reduce) {
  .floating-social__btn[data-label="Hotline"] { animation: none; }
}

/* ===== Nút toggle "Hỗ trợ" (FAB chính) — lúc đóng hiện icon tai nghe, lúc mở thành dấu × ===== */
.floating-social__toggle {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(6, 136, 211, 0.45);
}
.floating-social__toggle:hover { filter: brightness(1.08); }
.floating-social__toggle svg { width: 27px; height: 27px; }
/* Đổi icon theo trạng thái (specificity cao hơn base `.floating-social__btn svg`) */
.floating-social__toggle .floating-social__icon--close { display: none; }
.floating-social:not(.is-collapsed) .floating-social__toggle .floating-social__icon--support { display: none; }
.floating-social:not(.is-collapsed) .floating-social__toggle .floating-social__icon--close { display: block; }
