/* ==========================================================
   Плавающая кнопка WhatsApp (иконка — инлайновый SVG, без внешних файлов)
   ========================================================== */
.wa-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background-color: #0cc437;
  background-image: linear-gradient(135deg, #2ad84f 0%, #0cc437 55%, #09a72e 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22),
              0 2px 6px rgba(0, 0, 0, 0.14);
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease;
}

.wa-btn:hover,
.wa-btn:focus-visible {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.26),
              0 4px 10px rgba(0, 0, 0, 0.16);
}

.wa-btn:active {
  transform: translateY(-1px) scale(1);
}

.wa-btn:focus-visible {
  outline: 3px solid #128c7e;
  outline-offset: 4px;
}

.wa-btn__icon {
  display: block;
  width: 34px;
  height: 34px;
  fill: #fff;
  pointer-events: none;
}

/* Пульсирующее кольцо */
.wa-btn__pulse {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  animation: wa-pulse 2.8s ease-out infinite;
}

@keyframes wa-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  }
  65% {
    box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Подпись при наведении */
.wa-btn__label {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  padding: 9px 14px;
  border-radius: 10px;
  background: #19253b;
  color: #fff;
  font-family: "PT Sans", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(6px, -50%);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.wa-btn__label::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  margin-top: -5px;
  border: 5px solid transparent;
  border-left-color: #19253b;
}

.wa-btn:hover .wa-btn__label,
.wa-btn:focus-visible .wa-btn__label {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

@media (prefers-reduced-motion: reduce) {
  .wa-btn,
  .wa-btn__label {
    transition: none;
  }
  .wa-btn__pulse {
    animation: none;
  }
}

@media (max-width: 767px) {
  .wa-btn {
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }
  .wa-btn__icon {
    width: 30px;
    height: 30px;
  }
  .wa-btn__label {
    display: none;
  }
}

/* ==========================================================
   Кнопка WhatsApp в первом экране (рядом с «Заказать через MAX»)
   ========================================================== */
.main-buttons__wa {
  display: inline-flex;
  align-items: center;
  margin-left: 14px;
  padding: 8px 16px;
  border: 2px solid #0cc437;
  border-radius: 8px;
  background: transparent;
  color: #0a8f28 !important;
  font-family: "PT Sans", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease,
              border-color 0.25s ease, transform 0.2s ease;
}

.main-buttons__wa:hover,
.main-buttons__wa:focus-visible {
  background: #0cc437;
  border-color: #0cc437;
  color: #fff !important;
  transform: translateY(-1px);
}

.main-buttons__wa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: 12px;
  border-radius: 12px;
  background-color: #0cc437;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.24);
}

.main-buttons__wa-icon svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: #fff;
}

.main-buttons__wa-text--short {
  display: none;
}

@media (max-width: 1200px) {
  .main-buttons__wa {
    margin-left: 10px;
    padding: 6px 12px;
    font-size: 16px;
  }
  .main-buttons__wa-text--long {
    display: none;
  }
  .main-buttons__wa-text--short {
    display: inline;
  }
}

@media (max-width: 767px) {
  .main-buttons__wa {
    display: none;
  }
}

/* ==========================================================
   Мобильная кнопка MAX — стиль как на ЛитКите
   (градиент, логотип MAX, адаптировано под высоту 50px)
   ========================================================== */
@media (max-width: 767px) {
  .header__button-wrapper .header__whatsapp {
    min-height: 50px;
    padding: 0 10px;
    border-radius: 10px;
    background-color: transparent;
    background-image: linear-gradient(112deg, #2d6bff, #6d4aff, #b53cff);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: 0 10px 24px -13px rgba(74, 55, 255, 0.9);
    transition: background-image 0.25s ease, transform 0.2s ease;
  }

  .header__button-wrapper .header__whatsapp:hover,
  .header__button-wrapper .header__whatsapp:active {
    background-image: linear-gradient(112deg, #2460e9, #5d39f0, #a62cf2);
    color: #fff;
  }

  .header__button-wrapper .header__whatsapp .max-logo {
    display: block;
    width: 23px;
    height: 23px;
    margin-right: 8px;
    border-radius: 0;
    box-shadow: none;
    background: none;
    flex: 0 0 auto;
  }

  .header__button-wrapper .header__whatsapp .max-logo svg {
    display: block;
    width: 100%;
    height: 100%;
  }
}

/* Страховка от сбоев отрисовки градиента в Safari */
@media (max-width: 767px) {
  .header__button-wrapper .header__whatsapp {
    background-color: #6d4aff;
  }
}

/* Курсор-указатель на кнопках WhatsApp (как у ссылок) */
.main-buttons__wa,
.main-buttons__wa span,
.main-buttons__wa svg,
.wa-btn,
.wa-btn span,
.wa-btn svg {
  cursor: pointer;
}

/* ==========================================================
   Кнопка «Позвонить»: зелёная, как иконка телефона, + белая трубка
   ========================================================== */
@media (max-width: 767px) {
  .header__button-wrapper .header__button--green {
    background-color: #25c43a;
    background-image: linear-gradient(135deg, #4ee361 0%, #25c43a 55%, #1fae32 100%);
    border-color: #25c43a;
    color: #fff;
    font-weight: 700;
  }

  .header__button-wrapper .header__button--green:hover,
  .header__button-wrapper .header__button--green:active {
    background-image: linear-gradient(135deg, #5cf06e 0%, #2ad341 55%, #22b936 100%);
    border-color: #2ad341;
    color: #fff;
  }

  .header__button-wrapper .call-btn__icon {
    width: 22px;
    height: 22px;
    margin-right: 8px;
    fill: #fff;
    flex: 0 0 auto;
    display: block;
  }
}

/* Чуть компактнее кнопки первого экрана на десктопе (шрифт Inter шире) */
@media (min-width: 1025px) {
  .main-buttons__order {
    padding: 14px 22px;
    font-size: 20px;
  }

  .main-buttons__container .form__whatsapp {
    padding: 8px 14px;
    font-size: 17px;
  }

  .main-buttons__wa {
    padding: 8px 14px;
    font-size: 17px;
  }
}
