/* TH Acoustic — floating contact buttons (Zalo / Messenger / call) */

.cw {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.cw-btn {
  display: flex;
  align-items: center;
  gap: 0;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  transition: gap 220ms cubic-bezier(.22, 1, .36, 1),
              padding 220ms cubic-bezier(.22, 1, .36, 1),
              transform 180ms;
}
.cw-btn:hover { transform: translateY(-2px); color: #fff; text-decoration: none; }
.cw-btn:active { transform: translateY(0); }

.cw-ic {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

/* Label stays collapsed until hover/focus so the widget does not cover content. */
.cw-lb {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 700;
  transition: max-width 260ms cubic-bezier(.22, 1, .36, 1), opacity 200ms;
}
.cw-btn:hover .cw-lb,
.cw-btn:focus-visible .cw-lb { max-width: 190px; opacity: 1; }
.cw-btn:hover, .cw-btn:focus-visible { padding-right: 20px; gap: 2px; }

/* Brand colours */
.cw-zalo { background: #0068FF; }
.cw-zalo:hover { background: #0057D6; }
.cw-mess { background: #C026D3; background: linear-gradient(135deg, #00B2FF, #C026D3); }
.cw-call { background: var(--pink-500, #DC2626); }
.cw-call:hover { background: var(--pink-600, #B91C1C); }

/* Pulsing ring on the call button to draw the eye */
.cw-ring { position: relative; }
.cw-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  animation: cw-pulse 1.8s ease-out infinite;
}
@keyframes cw-pulse {
  0%   { transform: scale(1);   opacity: .85; }
  100% { transform: scale(1.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cw-ring::before { animation: none; }
  .cw-btn, .cw-lb { transition: none; }
}

@media (max-width: 640px) {
  .cw { right: 12px; bottom: 12px; gap: 8px; }
  .cw-btn { height: 46px; }
  .cw-ic { width: 46px; height: 46px; }
  /* Labels stay hidden on touch — there is no hover to reveal them. */
  .cw-btn:hover .cw-lb, .cw-btn:focus-visible .cw-lb { max-width: 0; opacity: 0; }
  .cw-btn:hover, .cw-btn:focus-visible { padding-right: 0; }
}
