/**
 * CY Colombia - Floating Actions Widget Styles (WhatsApp & Scroll to Top)
 * Ultra-smooth floating action group, glassmorphic tooltips, safe iOS padding, zero emojis.
 */

:root {
  --cy-wa-green: #25D366;
  --cy-wa-green-hover: #20ba5a;
  --cy-wa-green-glow: rgba(37, 211, 102, 0.4);
  --cy-top-bg: #151515;
  --cy-top-bg-hover: #d00618;
  --cy-top-color: #ffffff;
}

/* Floating Actions Container */
.cy-floating-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none; /* children enable pointer events */
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cy-floating-actions--left {
  right: auto;
  left: 24px;
}

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

/* =======================================================
   1. SCROLL TO TOP BUTTON
   ======================================================= */
.cy-back-to-top {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cy-top-bg);
  color: var(--cy-top-color);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s ease,
              background-color 0.22s ease,
              box-shadow 0.22s ease;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.cy-back-to-top.cy-is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.cy-back-to-top:hover {
  background: var(--cy-top-bg-hover);
  color: #ffffff;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 14px 30px rgba(208, 6, 24, 0.35);
  border-color: rgba(255, 255, 255, 0.3);
}

.cy-back-to-top:active {
  transform: translateY(0) scale(0.96);
}

.cy-back-to-top svg {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.25s ease;
}

.cy-back-to-top:hover svg {
  transform: translateY(-2px);
}

/* Back to top tooltip */
.cy-back-to-top__tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: #151515;
  color: #ffffff;
  font-family: var(--font-geist-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cy-floating-actions--left .cy-back-to-top__tooltip {
  right: auto;
  left: calc(100% + 12px);
  transform: translateY(-50%) translateX(-6px);
}

.cy-back-to-top:hover .cy-back-to-top__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* =======================================================
   2. WHATSAPP FLOATING BUTTON & TOOLTIP
   ======================================================= */
.cy-whatsapp-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--cy-wa-green);
  color: #ffffff !important;
  text-decoration: none !important;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.38),
              0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s ease,
              background-color 0.22s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.cy-whatsapp-btn:hover {
  background: var(--cy-wa-green-hover);
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 16px 36px rgba(37, 211, 102, 0.48),
              0 6px 16px rgba(0, 0, 0, 0.2);
}

.cy-whatsapp-btn:active {
  transform: translateY(0) scale(0.96);
}

.cy-whatsapp-btn svg {
  width: 30px;
  height: 30px;
  display: block;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.cy-whatsapp-btn:hover svg {
  transform: scale(1.06) rotate(-4deg);
}

/* Pulse Glow Rings */
.cy-whatsapp-btn--pulse::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--cy-wa-green-glow);
  z-index: -1;
  opacity: 0.8;
  animation: cyWhatsAppPulse 2.6s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes cyWhatsAppPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.22);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* WhatsApp Interactive Tooltip / Greeting Bubble */
.cy-whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: #ffffff;
  color: #151515;
  border: 1px solid rgba(21, 21, 21, 0.12);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14),
              0 3px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-geist-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 13px;
  font-weight: 560;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s ease;
}

.cy-floating-actions--left .cy-whatsapp-tooltip {
  right: auto;
  left: calc(100% + 14px);
  transform: translateY(-50%) translateX(-10px);
}

.cy-whatsapp-tooltip.cy-is-active,
.cy-whatsapp-btn:hover .cy-whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.cy-whatsapp-tooltip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cy-wa-green);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.cy-whatsapp-tooltip__close {
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  color: #888;
  cursor: pointer;
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.cy-whatsapp-tooltip__close:hover {
  color: #151515;
  background: rgba(0, 0, 0, 0.06);
}

/* Hide when mobile drawer is open */
.cy-drawer-locked .cy-floating-actions {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

/* =======================================================
   3. MOBILE RESPONSIVE ADAPTATIONS
   ======================================================= */
@media (max-width: 768px) {
  .cy-floating-actions {
    bottom: max(18px, env(safe-area-inset-bottom, 18px));
    right: 18px;
    gap: 10px;
  }

  .cy-floating-actions--left {
    left: 18px;
  }

  .cy-whatsapp-btn {
    width: 52px;
    height: 52px;
  }

  .cy-whatsapp-btn svg {
    width: 26px;
    height: 26px;
  }

  .cy-back-to-top {
    width: 42px;
    height: 42px;
  }

  .cy-back-to-top svg {
    width: 16px;
    height: 16px;
  }

  .cy-whatsapp-tooltip {
    display: none; /* Keep clean on small phone screens */
  }

  .cy-back-to-top__tooltip {
    display: none;
  }
}
