/* =========================================================================
   WhatsApp Floating Button — bağımsız, animasyonlu, yeniden kullanılabilir
   -------------------------------------------------------------------------
   KULLANIM (HTML):
     <a class="wa-float"
        href="https://wa.me/905415425253?text=Merhaba"
        target="_blank" rel="noopener noreferrer"
        aria-label="WhatsApp ile iletişime geçin"></a>

   - İkon SVG olarak CSS'e gömülüdür; ek görsel dosyası GEREKMEZ.
   - Sola sabitlemek için: <a class="wa-float wa-float--left" ...>
   - Renk/boyut/konum için aşağıdaki :root değişkenlerini değiştirin.
   ========================================================================= */

:root {
  --wa-size: 56px;          /* buton çapı */
  --wa-color: #25D366;      /* WhatsApp yeşili */
  --wa-color-dark: #128C7E; /* hover/gölge tonu */
  --wa-offset: 24px;        /* kenarlardan boşluk */
  --wa-z: 9998;             /* z-index */
}

.wa-float {
  position: fixed;
  bottom: var(--wa-offset);
  right: var(--wa-offset);
  z-index: var(--wa-z);

  width: var(--wa-size);
  height: var(--wa-size);
  border-radius: 50%;

  background-color: var(--wa-color);
  /* WhatsApp logosu (beyaz) — CSS'e gömülü SVG */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M.057 24l1.687-6.163a11.867 11.867 0 0 1-1.587-5.945C.16 5.335 5.495 0 12.05 0a11.817 11.817 0 0 1 8.413 3.488 11.824 11.824 0 0 1 3.48 8.414c-.003 6.557-5.338 11.892-11.893 11.892a11.9 11.9 0 0 1-5.688-1.448L.057 24zm6.597-3.807c1.676.995 3.276 1.591 5.392 1.592 5.448 0 9.886-4.434 9.889-9.885.002-5.462-4.415-9.89-9.881-9.892-5.452 0-9.887 4.434-9.889 9.884a9.82 9.82 0 0 0 1.51 5.26l-.999 3.648 3.978-1.207zm11.387-5.464c-.074-.124-.272-.198-.57-.347-.297-.149-1.758-.868-2.031-.967-.272-.099-.47-.149-.669.149-.198.297-.768.967-.941 1.165-.173.198-.347.223-.644.074-.297-.149-1.255-.462-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.521.151-.172.2-.296.3-.495.099-.198.05-.372-.025-.521-.075-.148-.669-1.611-.916-2.206-.242-.579-.487-.501-.669-.51l-.57-.01c-.198 0-.52.074-.792.372s-1.04 1.017-1.04 2.479 1.065 2.876 1.213 3.074c.149.198 2.095 3.2 5.076 4.487.709.306 1.263.489 1.694.626.712.226 1.36.194 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.695.248-1.29.173-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 54%;

  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  /* giriş + sürekli yumuşak süzülme animasyonu */
  animation: wa-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both,
             wa-bob 3s ease-in-out 0.6s infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Sola sabitleme varyantı (RTL siteler için) */
.wa-float--left {
  right: auto;
  left: var(--wa-offset);
}

/* Genişleyen "nabız" halkası */
.wa-float::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: var(--wa-color);
  z-index: -1;
  animation: wa-ring 2.2s ease-out infinite;
}

.wa-float:hover,
.wa-float:focus-visible {
  transform: scale(1.1);
  background-color: var(--wa-color-dark);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.6);
  outline: none;
}

.wa-float:active {
  transform: scale(0.96);
}

/* --- Keyframes --- */
@keyframes wa-pop {
  from { transform: scale(0);   opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes wa-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

@keyframes wa-ring {
  0%   { transform: scale(1);   opacity: 0.6; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Hareket azaltma tercihi olan kullanıcılarda animasyonları kapat */
@media (prefers-reduced-motion: reduce) {
  .wa-float { animation: none; }
  .wa-float::before { animation: none; display: none; }
}

/* Küçük ekranlarda biraz daha kompakt */
@media (max-width: 480px) {
  :root { --wa-size: 52px; --wa-offset: 16px; }
}
