/* =============================================
   Solar Udayan Energy — WhatsApp Floating Button
   ============================================= */

/* ------ Entry animation ------ */
@keyframes wa-slide-in {
  from { opacity: 0; transform: translateY(20px) scale(0.85); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ------ Idle pulse (subtle) ------ */
@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(37, 211, 102, 0.55); }
  60%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0   rgba(37, 211, 102, 0); }
}

/* ------ Wrapper ------ */
.wa-wrap {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;

  /* hidden until JS triggers entry */
  opacity: 0;
  pointer-events: none;
}
.wa-wrap.wa-ready {
  opacity: 1;
  pointer-events: auto;
  animation: wa-slide-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ------ Button (desktop: pill) ------ */
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #25D366;
  color: #fff;
  padding: 0.7rem 1.25rem 0.7rem 1rem;
  border-radius: 2rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.wa-btn:hover,
.wa-btn:focus-visible {
  background: #1ebe5d;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.55);
  outline: none;
}
.wa-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ------ WhatsApp SVG icon ------ */
.wa-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

/* ------ Tooltip (desktop only) ------ */
.wa-tooltip {
  display: none;
  background: #1f2937;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  position: absolute;
  bottom: calc(100% + 0.6rem);
  right: 0;
}
.wa-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 1.25rem;
  border: 5px solid transparent;
  border-top-color: #1f2937;
}

/* Show tooltip on button hover (desktop only) */
@media (min-width: 769px) {
  .wa-wrap { position: fixed; }  /* anchor for absolute tooltip */
  .wa-tooltip { display: block; }
  .wa-wrap:hover .wa-tooltip,
  .wa-btn:focus-visible ~ .wa-tooltip {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------ Idle pulse applied by JS ------ */
.wa-btn.wa-pulsing {
  animation: wa-pulse 0.8s ease-out;
}

/* =============================================
   Responsive
   ============================================= */

/* Tablet (≤1024px): button stays pill, slightly smaller padding */
@media (max-width: 1024px) {
  .wa-btn { padding: 0.65rem 1.1rem 0.65rem 0.9rem; font-size: 0.875rem; }
}

/* Mobile (≤768px): circular icon-only button, stacked above call button */
@media (max-width: 768px) {
  .wa-wrap {
    bottom: 5.75rem;  /* 1.5rem + 3.5rem (call btn) + 0.75rem gap */
    right: 1.5rem;
  }
  .wa-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }
  .wa-label { display: none; }
  .wa-icon  { width: 1.6rem; height: 1.6rem; }
}

/* Very small screens (≤480px) */
@media (max-width: 480px) {
  .wa-wrap {
    bottom: 5.25rem;  /* aligns with call btn that moves to bottom:1rem */
    right: 1rem;
  }
  .wa-btn { width: 3.25rem; height: 3.25rem; }
  .wa-icon { width: 1.45rem; height: 1.45rem; }
}
