/* =========================
   CONTACT PILL CONTAINER
========================= */
.contact-pill {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: var(--z-floating);

  display: flex;
  flex-direction: column;
  gap: var(--space-md);

  /* ✅ ensure everything aligns right cleanly */
  align-items: flex-end;

  transition: opacity var(--transition-base) var(--animate-in),
              transform var(--transition-base) var(--animate-in);
}

/* =========================
   BUTTON BASE
========================= */
.pill-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);

  padding: var(--pill-padding);
  border-radius: var(--pill-radius);

  font-size: var(--text-sm);
  text-decoration: none;

  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);

  box-shadow: var(--elevation-2);

  transition:
    transform var(--transition-base) var(--animate-in),
    box-shadow var(--transition-base) var(--animate-in),
    background var(--transition-base);

  min-height: var(--tap-size);
  min-width: 150px;

  position: relative;
  overflow: hidden;
}

/* =========================
   ICONS
========================= */
.pill-btn i {
  font-size: 16px;
  filter: var(--icon-glow-soft);
  transition: var(--transition-fast);
}

.pill-btn:hover i {
  filter: var(--icon-glow-strong);
}

.pill-btn span {
  margin-left: 6px;
}

/* =========================
   INTERACTION
========================= */
.pill-btn:hover {
  transform: translateX(-6px) scale(1.03);
  box-shadow: var(--elevation-3);
}

.pill-btn:active {
  transform: scale(var(--state-press-scale));
}

/* =========================
   BRAND STYLING
========================= */

/* WhatsApp */
.whatsapp {
  background: var(--color-accent-strong);
  color: #000;
  box-shadow: var(--glow-soft);
  padding-left: 14px;
}

.whatsapp::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--pill-radius);
  box-shadow: 0 0 0 0 var(--overlay-accent-strong);
  animation: pillPulse 2.5s infinite;
}

@keyframes pillPulse {
  0% { box-shadow: 0 0 0 0 var(--overlay-accent-strong); }
  70% { box-shadow: 0 0 0 12px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

.whatsapp:hover::after {
  animation: none;
}

/* Call */
.call {
  background: var(--surface-strong);
  color: var(--text-primary);
}

/* Messenger */
.messenger {
  background: #0084FF;
  color: #fff;
}

/* Hover feedback */
.whatsapp:hover {
  filter: brightness(var(--state-hover-bright));
}

.call:hover {
  background: var(--surface);
}

.messenger:hover {
  background: #0072e0;
}

/* =========================
   ✅ CHAT BUBBLE (FIXED)
========================= */
.chat-bubble {
  position: absolute;

  /* ✅ key fix: anchor above pills instead of hardcoding */
  bottom: 100%;
  right: 0;

  /* ✅ controlled spacing */
  margin-bottom: 12px;

  width: 260px;

  background: var(--surface);
  border: 1px solid var(--border-subtle);

  padding: var(--space-sm);
  border-radius: var(--radius-lg);

  font-size: var(--text-sm);
  line-height: 1.4;

  box-shadow: var(--elevation-2);

  display: flex;
  flex-direction: column;
  gap: var(--space-sm);

  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: var(--transition-base);

  white-space: normal;
}

/* Message */
#chatMessage {
  font-size: var(--text-sm);
}

/* =========================
   INLINE CTA
========================= */
.chat-cta {
  display: block;
  text-align: center;

  padding: 8px 12px;
  border-radius: 999px;

  font-size: 13px;
  font-weight: var(--weight-semibold);

  background: var(--overlay-accent);
  color: var(--color-accent-strong);

  text-decoration: none;

  transition: var(--transition-fast);
}

.chat-cta:hover {
  background: var(--overlay-accent-strong);
  transform: translateY(-1px);
}

.contact-pill:hover .chat-cta {
  opacity: 0.6;
}

/* =========================
   BUBBLE POINTER
========================= */
.chat-bubble::after {
  content: "";
  position: absolute;
  bottom: -5px;
  right: 22px;

  width: 10px;
  height: 10px;

  background: var(--surface);
  border-left: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);

  transform: rotate(45deg);
}

/* Visible */
.chat-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: bubbleIn 0.35s var(--animate-in);
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   TYPING DOTS
========================= */
.typing {
  display: flex;
  gap: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* =========================
   ONLINE INDICATOR
========================= */
.online-dot {
  width: 8px;
  height: 8px;
  background: var(--color-accent-strong);
  border-radius: 50%;

  box-shadow:
    0 0 0 2px rgba(98,255,183,0.2),
    0 0 8px var(--color-accent-strong);
}

/* =========================
   MOBILE
========================= */
@media (max-width: 480px) {
  .contact-pill {
    right: 15px;
    bottom: 20px;
  }

  .chat-bubble {
    bottom: 100%;
    right: 0;
    width: 220px;
  }

  .whatsapp::after {
    animation: none;
  }
}