/* Кнопки связи (бывший izitus), плагин «Заявки и кнопки связи» */

#setochki-contact {
  --sc-size: 52px;
  --sc-gap: 10px;
  --sc-offset: 20px;
  position: fixed;
  bottom: calc(var(--sc-offset) + env(safe-area-inset-bottom, 0px));
  right: calc(20px + env(safe-area-inset-right, 0px));
  z-index: 9999;
}

#setochki-contact.setochki-contact--left {
  right: auto;
  left: calc(20px + env(safe-area-inset-left, 0px));
}

html[dir="rtl"] #setochki-contact:not(.setochki-contact--left) {
  right: auto;
  left: 20px;
}

#setochki-contact,
#setochki-contact *,
#setochki-contact *::before,
#setochki-contact *::after {
  box-sizing: border-box;
}

#setochki-contact .setochki-contact__list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sc-gap);
}

#setochki-contact.setochki-contact--left .setochki-contact__list {
  align-items: flex-start;
}

/* Круглые кнопки связи */
#setochki-contact .sc-tg,
#setochki-contact .sc-max,
#setochki-contact .sc-wa,
#setochki-contact .sc-mail,
#setochki-contact .sc-phone {
  position: relative;
  display: block;
  width: var(--sc-size);
  height: var(--sc-size);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

#setochki-contact .setochki-contact__list > a img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Синяя точка на мессенджерах (как в исходном плагине) */
#setochki-contact .sc-tg::before,
#setochki-contact .sc-max::before,
#setochki-contact .sc-wa::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #2e72d2;
  border-radius: 50%;
  top: 0;
  right: 0;
  z-index: 3;
  transform: translate(30%, -30%);
}

/* Кнопка «Рассчитать стоимость» */
#setochki-contact .sc-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: var(--sc-size);
  padding: 0 22px 0 18px;
  border-radius: calc(var(--sc-size) / 2);
  background: #0b5fa5;
  color: #fff;
  font: 600 15px/1.2 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(11, 95, 165, 0.4);
  transition: background-color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

#setochki-contact .sc-cta:hover,
#setochki-contact .sc-cta:focus-visible {
  background: #084b83;
  color: #fff;
}

#setochki-contact .sc-cta.is-hidden {
  display: none;
}

#setochki-contact .sc-cta__short {
  display: none;
}

#setochki-contact .sc-cta__icon {
  flex: none;
  display: block;
  width: 24px;
  height: 24px;
}

#setochki-contact a:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}

/* Подсказка по наведению (только там, где есть мышь) */
@media (hover: hover) and (pointer: fine) {
  #setochki-contact .sc-tg:hover,
  #setochki-contact .sc-max:hover,
  #setochki-contact .sc-wa:hover,
  #setochki-contact .sc-mail:hover,
  #setochki-contact .sc-phone:hover {
    transform: scale(1.08);
  }

  #setochki-contact .sc-tg::after,
  #setochki-contact .sc-max::after,
  #setochki-contact .sc-wa::after,
  #setochki-contact .sc-mail::after,
  #setochki-contact .sc-phone::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    transform: translateY(-50%);
    padding: 7px 11px;
    border-radius: 8px;
    background: #1f2937;
    color: #fff;
    font: 500 14px/1.2 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  #setochki-contact.setochki-contact--left .sc-tg::after,
  #setochki-contact.setochki-contact--left .sc-max::after,
  #setochki-contact.setochki-contact--left .sc-wa::after,
  #setochki-contact.setochki-contact--left .sc-mail::after,
  #setochki-contact.setochki-contact--left .sc-phone::after {
    right: auto;
    left: calc(100% + 12px);
  }

  #setochki-contact a:hover::after,
  #setochki-contact a:focus-visible::after {
    opacity: 1;
  }
}

/* Телефоны и узкие экраны: круглые кнопки по 46 px, «Расчёт» — шарик со значком */
@media (max-width: 768px) {
  #setochki-contact {
    --sc-size: 46px;
    --sc-gap: 8px;
    right: calc(14px + env(safe-area-inset-right, 0px));
  }

  #setochki-contact.setochki-contact--left {
    right: auto;
    left: calc(14px + env(safe-area-inset-left, 0px));
  }

  /* Без короткого текста — круглая кнопка со значком */
  #setochki-contact .sc-cta {
    width: var(--sc-size);
    padding: 0;
    justify-content: center;
  }

  #setochki-contact .sc-cta__text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* С коротким текстом — компактная «пилюля»: значок и слово */
  #setochki-contact .sc-cta.has-short {
    width: auto;
    gap: 8px;
    padding: 0 18px 0 14px;
    font-size: 14px;
  }

  #setochki-contact .sc-cta.has-short .sc-cta__short {
    display: inline;
  }
}

/* Низкие экраны (телефон в горизонтальном положении): ещё плотнее */
@media (max-height: 420px) {
  #setochki-contact {
    --sc-size: 40px;
    --sc-gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #setochki-contact a {
    transition: none;
  }
}

@media print {
  #setochki-contact {
    display: none;
  }
}
