/* ==========================================================================
   DENTALINS — WHATSAPP BUTTON (whatsapp-button.css)
   Sağ alt köşede sabit duran WhatsApp CTA butonu (pulse animasyonu).
   BEM: .whatsapp-float
   ========================================================================== */


/* ======================================================================
   1. FLOATING BUTTON
   ====================================================================== */

.whatsapp-float {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-4);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

/* Mobile bar varken yukarı kaydır */
@media (max-width: 767px) {
  .whatsapp-float {
    bottom: calc(var(--space-20) + env(safe-area-inset-bottom, 0px));
    right: var(--space-3);
  }
}

@media (min-width: 768px) {
  .whatsapp-float {
    bottom: var(--space-8);
    right: var(--space-6);
  }
}


/* ======================================================================
   2. ICON CIRCLE
   ====================================================================== */

.whatsapp-float__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neutral-0);
  box-shadow:
    0 4px 14px rgba(37, 211, 102, 0.4),
    var(--shadow-lg);
  transition:
    transform var(--transition-normal),
    box-shadow var(--transition-normal);
}

.whatsapp-float:hover .whatsapp-float__icon {
  transform: scale(1.1);
  box-shadow:
    0 6px 20px rgba(37, 211, 102, 0.5),
    var(--shadow-xl);
}

.whatsapp-float__icon svg {
  width: 28px;
  height: 28px;
}

@media (min-width: 768px) {
  .whatsapp-float__icon {
    width: 60px;
    height: 60px;
  }

  .whatsapp-float__icon svg {
    width: 30px;
    height: 30px;
  }
}


/* ======================================================================
   3. TOOLTIP LABEL (desktop only)
   ====================================================================== */

.whatsapp-float__label {
  display: none;
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-neutral-0);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(8px);
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

@media (min-width: 1024px) {
  .whatsapp-float__label {
    display: block;
    position: absolute;
    right: calc(100% + var(--space-2));
    top: 50%;
    transform: translateY(-50%) translateX(8px);
  }

  .whatsapp-float:hover .whatsapp-float__label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}


/* ======================================================================
   4. PULSE ANIMATION
   ====================================================================== */

.whatsapp-float__icon::before {
  content: '';
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: #25D366;
  opacity: 0;
  z-index: -1;
  animation: whatsappPulse 2s ease-out infinite;
}

@media (min-width: 768px) {
  .whatsapp-float__icon::before {
    width: 60px;
    height: 60px;
  }
}

@keyframes whatsappPulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}


/* ======================================================================
   5. NOTIFICATION DOT (optional)
   ====================================================================== */

.whatsapp-float__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background-color: var(--color-error-500);
  color: var(--color-neutral-0);
  font-size: 10px;
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-neutral-0);
}


/* ======================================================================
   6. ENTRANCE ANIMATION
   ====================================================================== */

.whatsapp-float {
  animation: whatsappEntrance 0.6s ease 2s both;
}

@keyframes whatsappEntrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ======================================================================
   7. REDUCED MOTION
   ====================================================================== */

@media (prefers-reduced-motion: reduce) {
  .whatsapp-float {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .whatsapp-float__icon::before {
    animation: none;
    display: none;
  }

  .whatsapp-float__icon {
    transition: none;
  }
}


/* ======================================================================
   8. HIDE DURING PRINT
   ====================================================================== */

@media print {
  .whatsapp-float {
    display: none;
  }
}
