.messenger-float {
  position: fixed;
  z-index: 9980;
  display: flex;
  pointer-events: none;
}

.messenger-float__btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  border: none;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.messenger-float__btn:hover {
  transform: translateY(-2px) scale(1.05);
  filter: brightness(1.05);
}

.messenger-float__btn:active {
  transform: scale(0.96);
}

.messenger-float__btn svg {
  flex-shrink: 0;
  display: block;
}

.messenger-float__btn--wa {
  background: linear-gradient(145deg, #2fe075 0%, #25d366 45%, #1ebe57 100%);
  box-shadow:
    0 4px 14px rgba(37, 211, 102, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.12);
}

.messenger-float__btn--wa:hover {
  box-shadow:
    0 8px 22px rgba(37, 211, 102, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.14);
}

.messenger-float__btn--tg {
  background: linear-gradient(145deg, #3db6f5 0%, #2aabee 45%, #229ed9 100%);
  box-shadow:
    0 4px 14px rgba(42, 171, 238, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.12);
}

.messenger-float__btn--tg:hover {
  box-shadow:
    0 8px 22px rgba(42, 171, 238, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.14);
}

.messenger-float__label {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  white-space: nowrap;
}

@keyframes messenger-float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messenger-float-pulse {
  0%,
  100% {
    box-shadow:
      0 4px 14px rgba(37, 211, 102, 0.45),
      0 0 0 0 rgba(37, 211, 102, 0.35);
  }
  50% {
    box-shadow:
      0 4px 14px rgba(37, 211, 102, 0.45),
      0 0 0 10px rgba(37, 211, 102, 0);
  }
}

@keyframes messenger-float-pulse-tg {
  0%,
  100% {
    box-shadow:
      0 4px 14px rgba(42, 171, 238, 0.45),
      0 0 0 0 rgba(42, 171, 238, 0.35);
  }
  50% {
    box-shadow:
      0 4px 14px rgba(42, 171, 238, 0.45),
      0 0 0 10px rgba(42, 171, 238, 0);
  }
}

@media (min-width: 768px) {
  .messenger-float {
    right: 1.25rem;
    bottom: 1.5rem;
    flex-direction: column;
    gap: 0.75rem;
    animation: messenger-float-in 0.45s ease both;
  }

  .messenger-float__btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
  }

  .messenger-float__btn--wa {
    animation: messenger-float-pulse 2.8s ease-in-out infinite;
  }

  .messenger-float__btn--tg {
    animation: messenger-float-pulse-tg 2.8s ease-in-out 1.4s infinite;
  }

  .messenger-float__btn:hover {
    animation: none;
  }

  .messenger-float__btn svg {
    width: 1.625rem;
    height: 1.625rem;
  }

  .messenger-float__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 767px) {
  .messenger-float {
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    padding-bottom: calc(0.625rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    animation: messenger-float-in 0.4s ease both;
  }

  .messenger-float__btn {
    flex: 1;
    min-height: 2.875rem;
    border-radius: 0.875rem;
    padding: 0.625rem 0.75rem;
  }

  .messenger-float__btn svg {
    width: 1.375rem;
    height: 1.375rem;
  }

  body {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }
}

@media print {
  .messenger-float {
    display: none !important;
  }
}
