/* Кнопка Telegram в шапке — круглая иконка (десктоп, внутри nav).
   Ghost-круг: не спорит с залитой CTA «Обратный звонок», при наведении
   заливается фирменным цветом Telegram. Высота = высоте CTA (41px). */
.tg-header-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 41px;
  height: 41px;
  margin-left: 0.25rem;
  border-radius: 999px;
  border: 1px solid #dce8f5;
  background: #ffffff;
  color: #229ed9;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.tg-header-btn:hover {
  background: #229ed9;
  border-color: #229ed9;
  color: #ffffff;
  transform: translateY(-1px);
}

.tg-header-btn:active {
  transform: translateY(1px);
}

.tg-header-btn svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
  margin-right: 0.12rem;
}

/* Круглая иконка в шапке на мобильных (nav скрыт, это единственная
   кнопка в баре — плоская заливка без градиентов и свечения) */
.tg-header-btn-mobile {
  display: none;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #229ed9;
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.tg-header-btn-mobile:active {
  transform: scale(0.96);
}

.tg-header-btn-mobile svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  margin-right: 0.1rem;
}

@media (max-width: 767.98px) {
  .tg-header-btn-mobile {
    display: grid;
  }
}

/* Плавающая кнопка Telegram */
.tg-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  background: linear-gradient(140deg, #2aabee 0%, #1f96cf 100%);
  color: #ffffff;
  box-shadow:
    0 14px 34px -12px rgba(34, 158, 217, 0.65),
    0 4px 12px -4px rgba(20, 32, 51, 0.25);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.tg-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(42, 171, 238, 0.5);
  animation: tgFabPulse 2.6s ease-out infinite;
  pointer-events: none;
}

.tg-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 18px 40px -12px rgba(34, 158, 217, 0.75),
    0 6px 14px -4px rgba(20, 32, 51, 0.3);
}

.tg-fab:active {
  transform: scale(0.97);
}

.tg-fab svg {
  width: 1.7rem;
  height: 1.7rem;
  margin-right: 0.12rem;
}

@keyframes tgFabPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(42, 171, 238, 0.45);
  }

  55% {
    box-shadow: 0 0 0 14px rgba(42, 171, 238, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(42, 171, 238, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tg-fab::after {
    animation: none;
  }
}
