/* כפתור וואטסאפ צף — כל דפי האתר (Chrome / Safari / Firefox / Samsung) */
.wa-float-wrap {
  --wa-green: #25d366;
  --wa-green-dark: #1da851;
  --wa-size: 56px;
  --wa-gap: 20px;
  position: fixed;
  z-index: 10100;
  bottom: calc(var(--wa-gap) + env(safe-area-inset-bottom, 0px));
  inset-inline-start: calc(var(--wa-gap) + env(safe-area-inset-left, 0px));
  inset-inline-end: auto;
  width: var(--wa-size);
  height: var(--wa-size);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.wa-float-wrap.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85);
  pointer-events: none !important;
}

.wa-float__close {
  position: absolute;
  top: -6px;
  inset-inline-start: -6px;
  z-index: 3;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 18, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, transform 0.15s;
}

.wa-float__close:hover {
  background: #333;
  transform: scale(1.08);
}

.wa-float__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--wa-size);
  height: var(--wa-size);
  text-decoration: none;
  color: #fff;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.wa-float__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wa-green);
  opacity: 0.35;
  animation: wa-float-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes wa-float-pulse {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  70% {
    transform: scale(1.4);
    opacity: 0;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.wa-float__btn {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2ee06a 0%, var(--wa-green) 45%, var(--wa-green-dark) 100%);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset,
    0 6px 22px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wa-float__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.wa-float__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wa-float__label {
  position: absolute;
  inset-inline-end: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: rgba(12, 12, 12, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

[dir="rtl"] .wa-float__label {
  inset-inline-end: auto;
  inset-inline-start: calc(100% + 10px);
}

.wa-float__link:hover .wa-float__btn,
.wa-float__link:focus-visible .wa-float__btn {
  transform: scale(1.06);
}

.wa-float__link:hover .wa-float__label,
.wa-float__link:focus-visible .wa-float__label {
  opacity: 1;
}

.wa-float__link:focus-visible {
  outline: none;
}

.wa-float__link:focus-visible .wa-float__btn {
  outline: 2px solid var(--wa-green);
  outline-offset: 3px;
}

/* מובייל — top מעל #mobile-bottom-ui (mobile-bottom-ui.js) */
@media (max-width: 768px) {
  .wa-float-wrap {
    --wa-size: 52px;
    --wa-gap: 12px;
    inset-inline-start: calc(14px + env(safe-area-inset-left, 0px));
    z-index: 1400;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: opacity 0.25s ease;
  }

  .wa-float-wrap.wa-float-wrap--anchored {
    top: var(--wa-float-top, auto);
    bottom: auto !important;
  }

  body:not(:has(#mobile-bottom-ui)) .wa-float-wrap {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    top: auto;
    z-index: 10100;
  }

  .wa-float-wrap.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  .wa-float__label {
    display: none;
  }

  .wa-float__close {
    top: -5px;
    inset-inline-start: -5px;
    width: 24px;
    height: 24px;
  }
}

/* מסכים קטנים מאוד — מעט מעל home indicator */
@media (max-width: 380px) {
  .wa-float-wrap {
    --wa-gap: 12px;
    --wa-size: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-float__ring {
    animation: none;
    opacity: 0.2;
  }
  .wa-float-wrap,
  .wa-float__btn,
  .wa-float__label {
    transition: none;
  }
}
