/* Root container */
#whatsapp-widget {
  position: fixed;             /* ensure viewport-anchored */
  z-index: 2147483647;         /* sit above modals/headers */
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  /* respect iOS/Android safe areas */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Position override via data-attr + custom spacing vars */
#whatsapp-widget { --wa-bottom: 24px; --wa-offset: 24px; }
#whatsapp-widget {
  bottom: calc(var(--wa-bottom) + env(safe-area-inset-bottom, 0px));
  right: var(--wa-offset);
}
#whatsapp-widget[data-position="left"] {
  left: var(--wa-offset);
  right: auto;
}

/* Floating action button + pulse */
#whatsapp-widget .wa-fab {
  position: relative;
  width: 56px; height: 56px;
  border: 0; border-radius: 50%;
  background: transparent;
  padding: 0; margin: 0;
  cursor: pointer; appearance: none; outline: none;
}

#whatsapp-widget .pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  opacity: .6;
  animation: waPulse 1.5s infinite;
  z-index: 0;
}

#whatsapp-widget .icon-wrap {
  position: relative; z-index: 1;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  color: #fff;
}

#whatsapp-widget .notification-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 12px; height: 12px;
  background: red;
  border-radius: 50%;
  border: 2px solid #D2E5FD;
}

#whatsapp-widget .wa-icon { display: block; }

/* Animations */
@keyframes waPulse {
  0%   { transform: scale(1);   opacity: .6; }
  50%  { transform: scale(1.3); opacity: .3; }
  100% { transform: scale(1);   opacity: .6; }
}

/* Accessibility focus */
#whatsapp-widget .wa-fab:focus-visible,
#whatsapp-widget:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(37,211,102,.6);
  border-radius: 999px;
}
