/* Плавающая кнопка связи (внизу справа) */

.contact-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: inherit;
}

.contact-fab__panel {
  display: none;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06),
    var(--btn-gloss-inset, inset 0 1px 0 rgba(255, 255, 255, 0.65));
}

.contact-fab.is-open .contact-fab__panel {
  display: block;
}

.contact-fab__title {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #666);
}

.contact-fab__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 -4px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text, #1a1a1a);
  text-decoration: none;
  transition: background 0.15s ease;
}

.contact-fab__link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-link, #2563eb);
}

.contact-fab__link:focus {
  outline: 2px solid var(--color-link, #2563eb);
  outline-offset: 2px;
}

.contact-fab__link-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

.contact-fab__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: var(--btn-shine-border);
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  color: var(--btn-shine);
  box-shadow: none;
  transition: transform 0.15s ease, background 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.contact-fab__btn:hover {
  transform: scale(1.05);
  background: var(--btn-shine);
  color: #fff;
  border-color: var(--btn-shine);
}

.contact-fab__btn:focus {
  outline: 2px solid var(--btn-shine);
  outline-offset: 2px;
}

.contact-fab__btn[aria-expanded='true'] {
  background: var(--btn-shine);
  color: #fff;
  border-color: var(--btn-shine);
}

.contact-fab__btn svg {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
}

/* Скрытый текст для скринридеров */
.contact-fab .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Не перекрывать панель «Купить» на странице товара (свёрнута: одна кнопка) */
body.has-product-sticky-bar .contact-fab {
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transition: bottom 0.25s ease;
}

/* Раскрыты Ozon / WB / цифра */
body.has-product-sticky-bar.contact-fab-buy-open .contact-fab {
  bottom: calc(200px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-reduced-motion: reduce) {
  .contact-fab__btn {
    transition: none;
  }
}
