/* ================================================
   css/plans-mobile.css — компактные тарифы в приложениях
   Подключается на страницах тарифов и регистрации, но правила карусели
   работают только на поверхностях приложений:
     html[data-telegram-app] — Telegram Mini App;
     html[data-surface='android'] — Android WebView.
   На сайте эти селекторы не совпадают: сетка и размеры карточек прежние.
   ================================================ */

:is(html[data-telegram-app], html[data-surface='android']) .sl-plan-grid.is-pcar {
  display: block;
}

.sl-pcar {
  display: grid;
  gap: 10px;
}

.sl-pcar__hint {
  margin: 0;
  font-size: 12px;
  color: var(--sl-text-faint);
}

/* Горизонтальная полоса: одна полная плитка и заметная часть следующей. */
.sl-pcar__viewport {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 2px 2px 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.sl-pcar__viewport::-webkit-scrollbar {
  display: none;
}

.sl-pcar__slide {
  position: relative;
  flex: 0 0 84%;
  min-width: 0;
  display: flex;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.sl-pcar__slide .sl-plan {
  width: 100%;
}

.sl-pcar__actions {
  display: grid;
  gap: 6px;
}

.sl-pcar__actions .sl-btn {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  font-size: 12px;
}

.sl-plan__more-hint {
  font-size: 11px;
  color: var(--sl-text-faint);
  line-height: 1.3;
}

.sl-pcar__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sl-pcar__dots {
  display: flex;
  gap: 2px;
}

/* Видимая точка 6px, зона касания 22×22px. */
.sl-pcar__dot {
  width: 22px;
  height: 22px;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  background-color: var(--sl-border-strong);
  background-clip: content-box;
  cursor: pointer;
  transition: background var(--sl-ease, 160ms ease), width var(--sl-ease, 160ms ease);
}

.sl-pcar__dot.is-active {
  width: 30px;
  border-radius: var(--sl-radius-pill);
  background-color: var(--sl-teal);
  background-clip: content-box;
}

.sl-pcar__counter {
  font-size: 12px;
  color: var(--sl-text-muted);
  font-variant-numeric: tabular-nums;
}

.sl-pcar__chosen {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--sl-border);
  border-radius: 12px;
  background: var(--sl-surface);
}

.sl-pcar__chosen-line {
  font-size: 12px;
  color: var(--sl-text-muted);
  overflow-wrap: anywhere;
}

.sl-pcar__chosen .sl-btn {
  width: 100%;
  min-height: 44px;
}

@media (max-width: 380px) {
  .sl-pcar__slide {
    flex-basis: 90%;
  }
}

/* ===== Подробности тарифа ===== */
.sl-pd {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  align-items: end;
}

.sl-pd__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 18, 0.52);
}

.sl-pd__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--sl-surface);
  box-shadow: var(--sl-shadow-lg);
  animation: sl-pd-up 220ms ease;
}

@keyframes sl-pd-up {
  from { transform: translateY(14%); opacity: 0.65; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sl-pd__panel { animation: none; }
  .sl-pcar__viewport { scroll-behavior: auto; }
}

.sl-pd__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--sl-border);
  border-radius: 50%;
  background: var(--sl-surface);
  color: var(--sl-text-muted);
  font-size: 15px;
  cursor: pointer;
}

.sl-pd__head {
  display: grid;
  gap: 4px;
  padding-right: 44px;
}

.sl-pd__badge {
  justify-self: start;
  padding: 3px 8px;
  border-radius: var(--sl-radius-pill);
  background: var(--sl-bg-alt);
  color: var(--sl-text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sl-pd__title {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--sl-text);
}

.sl-pd__tagline {
  margin: 0;
  font-size: 13px;
  color: var(--sl-text-faint);
}

.sl-pd__price {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--sl-text);
}

.sl-pd__section {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--sl-border);
}

.sl-pd__section h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sl-text-faint);
}

.sl-pd__features,
.sl-pd__plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--sl-text);
}

.sl-pd__plain {
  color: var(--sl-text-muted);
}

.sl-pd__feature {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.4;
  min-width: 0;
}

.sl-pd__feature > span:not(.sl-pd__check) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sl-pd__check {
  color: var(--sl-success);
  font-size: 12px;
  line-height: 1;
  flex: none;
}

.sl-pd__feature.is-soon .sl-pd__check {
  color: var(--sl-text-faint);
}

.sl-pd__soon {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sl-text-faint);
  border: 1px solid var(--sl-border);
  border-radius: var(--sl-radius-pill);
  padding: 1px 6px;
  white-space: nowrap;
}

.sl-pd__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--sl-text-muted);
  overflow-wrap: anywhere;
}

.sl-pd__note--brand {
  color: var(--sl-teal-deep);
  font-weight: 600;
}

:root[data-theme='dark'] .sl-pd__note--brand {
  color: var(--sl-mint);
}

.sl-pd__foot {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 10px;
  background: var(--sl-surface);
}

.sl-pd__foot .sl-btn {
  min-height: 46px;
}

@media (min-width: 720px) {
  .sl-pd {
    place-items: center;
  }

  .sl-pd__panel {
    width: min(520px, 92vw);
    max-height: 86dvh;
    border-radius: 18px;
  }
}
