/* Floating WhatsApp + sticky scroll CTAs (Sleek-inspired) */

.floating-actions {
  --fab-z: 900;
  --fab-gap: 16px;
  pointer-events: none;
}

.floating-actions > * {
  pointer-events: auto;
}

/* ── Sticky scroll CTA bar ── */
.sticky-scroll-cta {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--fab-z);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 100px));
  padding: 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(12, 26, 46, 0.1);
  box-shadow: 0 12px 40px rgba(12, 26, 46, 0.14);
  backdrop-filter: blur(12px);
  transform: translate(-50%, 120%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.sticky-scroll-cta.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

/* Hide floating CTAs when footer is on screen */
.floating-actions.is-footer-inview .sticky-scroll-cta,
.floating-actions.is-footer-inview .sticky-scroll-cta.is-visible {
  transform: translate(-50%, 140%) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.floating-actions.is-footer-inview .fab-whatsapp {
  transform: translateY(120%) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.footer-scroll-sentinel {
  width: 100%;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  visibility: hidden;
}

.sticky-scroll-cta-primary,
.sticky-scroll-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sticky-scroll-cta-primary {
  background: #0d6efd;
  color: #fff;
  box-shadow: 0 4px 16px rgba(13, 110, 253, 0.35);
}

.sticky-scroll-cta-primary:hover {
  background: #0b5ed7;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.45);
}

.sticky-scroll-cta-secondary {
  background: #fff;
  color: #0c1a2e;
  border: 1px solid rgba(12, 26, 46, 0.14);
}

.sticky-scroll-cta-secondary:hover {
  background: rgba(13, 110, 253, 0.08);
  border-color: rgba(13, 110, 253, 0.3);
  color: #0d6efd;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(12, 26, 46, 0.08);
}

/* ── WhatsApp FAB ── */
.fab-whatsapp {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: calc(var(--fab-z) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    visibility 0.3s ease,
    box-shadow 0.25s ease,
    background 0.2s ease;
}

.fab-whatsapp:hover {
  background: #20bd5a;
  transform: scale(1.06);
  box-shadow: 0 10px 32px rgba(37, 211, 102, 0.55);
}

.fab-whatsapp:active {
  transform: scale(0.98);
}

.fab-whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  padding: 8px 14px;
  border-radius: 8px;
  background: #0c1a2e;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  box-shadow: 0 8px 24px rgba(12, 26, 46, 0.2);
}

.fab-whatsapp-tooltip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #0c1a2e;
}

.fab-whatsapp:hover .fab-whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Lift WhatsApp when sticky bar is visible */
.floating-actions:has(.sticky-scroll-cta.is-visible) .fab-whatsapp {
  bottom: 88px;
}

@media (max-width: 768px) {
  .sticky-scroll-cta {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
    transform: translateY(120%);
    border-radius: 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .sticky-scroll-cta.is-visible {
    transform: translateY(0);
  }

  .floating-actions.is-footer-inview .sticky-scroll-cta,
  .floating-actions.is-footer-inview .sticky-scroll-cta.is-visible {
    transform: translateY(140%) !important;
  }

  .sticky-scroll-cta-primary,
  .sticky-scroll-cta-secondary {
    width: 100%;
    border-radius: 12px;
  }

  .fab-whatsapp {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .fab-whatsapp-tooltip {
    display: none;
  }

  .floating-actions:has(.sticky-scroll-cta.is-visible) .fab-whatsapp {
    bottom: 148px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-scroll-cta,
  .sticky-scroll-cta-primary,
  .sticky-scroll-cta-secondary,
  .fab-whatsapp,
  .fab-whatsapp-tooltip {
    transition: none;
  }

  .sticky-scroll-cta-primary:hover,
  .sticky-scroll-cta-secondary:hover,
  .fab-whatsapp:hover {
    transform: none;
  }
}
