/*
 * site-sales (08.11.2026): переход в бота — QR на компьютере, «три шага» под кнопкой
 * блока «Всё живёт в Telegram», липкая кнопка на телефоне, ссылка в бота из чата.
 * Разметка — tools/r26-layout.mjs (cta, tail), поведение — assets/tg-go.js и assets/chat.js.
 * Только токены палитры r26 (--r-*) и окна чата (--sup-*): обе темы работают сами.
 */

/* ══ Три шага под кнопкой CTA — только на компьютере ═════════════════════════ */
.r-steps { display: none; }
@media (min-width: 1024px) {
  .r-steps {
    display: grid; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; counter-reset: rstep;
    font-size: 14px; line-height: 1.45; font-weight: 600; color: var(--r-text-2);
  }
  .r-steps li { display: flex; align-items: flex-start; gap: 10px; counter-increment: rstep; }
  .r-steps li::before {
    content: counter(rstep); flex: none; display: grid; place-items: center;
    width: 22px; height: 22px; border-radius: 50%; margin-top: -1px;
    font-size: 12px; font-weight: 800; color: var(--r-link); background: var(--r-fill-2); border: 1px solid var(--r-line-3);
  }
}

/* ══ Окно с QR на компьютере ═════════════════════════════════════════════════ */
.tgq[hidden] { display: none; }
.tgq {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background: var(--r-scrim); opacity: 0; transition: opacity .2s ease;
  font-family: var(--r-font); color: var(--r-text);
}
.tgq.on { opacity: 1; }
.tgq-box {
  position: relative; display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: center;
  width: min(680px, 100%); box-sizing: border-box; padding: 28px; border-radius: 28px;
  background: var(--r-surface); border: 1px solid var(--r-line-3); box-shadow: var(--r-pop-shadow);
  transform: translateY(10px) scale(.98); transition: transform .24s cubic-bezier(.2, .8, .3, 1);
  text-align: start;
}
.tgq.on .tgq-box { transform: none; }
.tgq-code {
  width: 232px; height: 232px; box-sizing: border-box; padding: 8px; border-radius: 20px; background: #FFFFFF;
  display: grid; place-items: center;
}
.tgq-code svg { display: block; width: 100%; height: 100%; }
.tgq-txt { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tgq-h { margin: 0; padding-inline-end: 36px; font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.tgq-p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--r-text-2); }
.tgq .r-steps { display: grid; margin: 4px 0 2px; }
.tgq-go { align-self: stretch; justify-content: center; border: 0; cursor: pointer; font-family: inherit; }
.tgq-web {
  align-self: center; padding: 6px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--r-link);
}
.tgq-web:hover { background: var(--r-hover); }
.tgq-x {
  position: absolute; top: 14px; inset-inline-end: 14px; width: 38px; height: 38px;
  display: grid; place-items: center; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--r-fill-2); color: var(--r-muted);
}
.tgq-x:hover { background: var(--r-hover); color: var(--r-text); }
.tgq-x svg { width: 18px; height: 18px; }
.tgq :is(button, a):focus-visible { outline: 2px solid var(--r-link); outline-offset: 2px; }

/* ══ Липкая кнопка на телефоне ═══════════════════════════════════════════════
   Рядом с кнопкой чата (до 560 px — 52 px в 12 px от края, шире — 58 px в 22 px; на
   арабском чат слева — r26.css, поэтому стороны логические): полоса заканчивается за
   12 px до неё и стоит по её середине. */
.tg-stick[hidden] { display: none; }
.tg-stick {
  position: fixed; z-index: 110; inset-inline: 12px 76px; bottom: 12px; height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; padding: 0 16px;
  border-radius: 16px; background: var(--r-brand); color: #FFFFFF; box-shadow: var(--r-btn-shadow);
  font-family: var(--r-font); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden;
  opacity: 0; transform: translateY(16px); visibility: hidden; pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .22s;
}
.tg-stick.on { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.tg-stick span { overflow: hidden; text-overflow: ellipsis; }
.tg-stick svg { flex: none; }
.tg-stick:focus-visible { outline: 2px solid var(--r-link); outline-offset: 2px; }
@media (min-width: 561px) { .tg-stick { inset-inline: 22px 92px; bottom: 25px; } }
@media (min-width: 768px) { .tg-stick { display: none; } }

/* ══ Ссылка в бота в окне чата ═══════════════════════════════════════════════ */
.chat-panel a.sup-tg, .chat-panel a.sup-tg-bar { text-decoration: none; }
.chat-panel a.sup-tg { color: var(--sup-text); }
.sup-tg-ic {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: var(--sup-grad); color: #FFFFFF;
}
.sup-tg-ic svg, .sup-tg > svg, .sup-tg-bar svg { width: 18px; height: 18px; flex: none; }
.sup-tg > svg { color: var(--sup-muted); }
[dir="rtl"] .sup-tg > svg { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  .tgq, .tgq-box, .tg-stick { transition: none; }
}
