/*
 * Блок тарифов лендинга: landing/partials/tariffs.blade.php (релизы 2026-09-23-landing-tariff-periods,
 * 2026-09-24-tariff-cards-coins). Переключатель срока + карточки уровней: «Всего за <срок>», цена, кнопка,
 * список пользы; общие обещания — блоком под рядом, «Стартовый» — плашкой. Карточки всегда в один ряд до
 * мобильной ширины; узкая карточка мельчит кегли (container query). Подключается партиалом, style.css не трогаем.
 */

/* ---------- Заголовок и переключатель срока ---------- */

/* .block-rate1 — колонка с gap 40px: подзаголовок подтягиваем к заголовку */
.tariffs2__subtitle {
  max-width: 640px;
  margin: -28px auto 0;
  color: #6b6b75;
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
}

.tariffs2__switch-wrap {
  display: flex;
  justify-content: center;
}

.tariffs2__switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
}

.tariffs2__period {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s linear, color 0.15s linear;
}

.tariffs2__period:hover {
  background: #f3f4f6;
}

.tariffs2__period[aria-pressed='true'] {
  background: #0f172a;
  color: #fff;
}

.tariffs2__period-short {
  display: none;
}

.tariffs2__save {
  padding: 2px 8px;
  border-radius: 999px;
  background: #d3fbe4;
  color: #14532d;
  font-size: 12px;
  font-weight: 700;
}

.tariffs2__period:focus-visible,
.tariffs2__cta:focus-visible,
.tariffs2__more:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

/* ---------- Ряд карточек ---------- */

/* Колонки — по числу карточек, до мобильной ширины ряд не переносится: карточки сужаются */
.tariffs2__list {
  display: grid;
  grid-template-columns: repeat(var(--tariffs2-columns, 3), minmax(0, 320px));
  justify-content: center;
  gap: 40px 24px;
  padding-top: 16px;
}

@media only screen and (761px <= width <= 1023px) {
  .tariffs2__list {
    gap: 40px 14px;
  }
}

.tariffs2__card {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 4px;
  border-radius: 16px;
  background: #eceef1;
  box-shadow: 0 2px 6px rgb(19 19 22 / 15%);
  transition: padding 0.15s linear, margin 0.15s linear;
}

.tariffs2__card:hover {
  margin: -4px;
  padding: 8px;
}

.tariffs2__card.color2 {
  background: #d3fbe4;
}

.tariffs2__card.color3 {
  background: #eedff7;
}

.tariffs2__card.color4 {
  background: url(../img/gr1.jpg) 0 0 / 100% 100%;
}

/* У уровня нет выбранного срока — карточка приглушена */
.tariffs2__card:has(> .tariffs2__offer--unavailable:not([hidden])) {
  background: #e6e8ec;
}

.tariffs2__offer {
  container: tariffs2-offer / inline-size;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.tariffs2__offer[hidden] {
  display: none;
}

/* Оффер — контейнер (container query), и бейдж позиционируется от него: -20 = прежние -16 от карточки */
.tariffs2__badge {
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
}

.tariffs2__badge span {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.tariffs2__badge i {
  font-size: 18px;
  font-style: normal;
}

.tariffs2__inner {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f4f6;
}

.tariffs2__top {
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #fff;
}

.tariffs2__name {
  color: #0f172a;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.tariffs2__tagline {
  margin-top: 2px;
  color: #6b6b75;
  font-size: 14px;
  line-height: 1.3;
}

/* «Всего за <срок>» — токены за весь срок одним числом, в тон рамке */
.tariffs2__sum {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding: 12px 16px 14px;
  border-radius: 12px;
  background: #f6f7f9;
}

.tariffs2__card.color2 .tariffs2__sum {
  background: #edfcf3;
}

.tariffs2__card.color3 .tariffs2__sum {
  background: #f7effc;
}

.tariffs2__card.color4 .tariffs2__sum {
  background: linear-gradient(115deg, #effde8 0%, #e8fbf9 45%, #eff2fd 75%, #faf0fe 100%);
}

.tariffs2__sum-cap {
  color: #3c4352;
  font-size: 13px;
  font-weight: 600;
}

.tariffs2__sum-num {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  color: #3c4352;
  font-size: 15px;
  font-weight: 600;
}

.tariffs2__sum-num b {
  color: #0f172a;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.tariffs2__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  margin-top: 18px;
}

.tariffs2__price b {
  color: #0f172a;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.tariffs2__offer--unavailable .tariffs2__price b {
  color: #6b6b75;
}

.tariffs2__price span {
  color: #6b6b75;
  font-size: 15px;
}

.tariffs2__note {
  min-height: 18px;
  margin-top: 4px;
  color: #6b6b75;
  font-size: 13px;
  line-height: 18px;
}

.tariffs2__note s {
  margin-left: 4px;
  white-space: nowrap;
}

.tariffs2__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin-top: 14px;
  padding: 0 8px;
  box-sizing: border-box;
  border: 1.5px solid #0f172a;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s linear, transform 0.15s linear;
}

.tariffs2__cta:hover {
  background: #1e293b;
  color: #fff;
}

.tariffs2__card:hover .tariffs2__cta {
  transform: scale(1.03);
}

.tariffs2__cta--outline,
.tariffs2__cta--outline:hover {
  color: #0f172a;
}

.tariffs2__cta--outline {
  background: #fff;
}

.tariffs2__cta--outline:hover {
  background: #f3f4f6;
}

/* Список пользы: работы и презентации за срок, потолок объёма, безлимит, цена работы */
.tariffs2__features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 16px 20px 20px;
  list-style: none;
}

.tariffs2__features li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #0f172a;
  font-size: 14px;
  line-height: 18px;
}

.tariffs2__features li::before {
  flex-shrink: 0;
  width: 14px;
  height: 15px;
  margin-top: 1px;
  background: url(../img/i11.svg) no-repeat 0 0 / 14px 15px;
  content: '';
}

.tariffs2__features li.tariffs2__feature--lead {
  font-size: 15px;
}

.tariffs2__features li.tariffs2__feature--unlimited::before {
  display: none;
}

.tariffs2__features b {
  font-weight: 700;
}

.tariffs2__inf {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: -1px -2px 0;
  border-radius: 50%;
  background: #d3fbe4;
  color: #14532d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* Узкая карточка (узкий десктоп): три в ряд, всё помещается */
@container tariffs2-offer (width <= 290px) {
  .tariffs2__top {
    padding: 16px;
  }

  .tariffs2__name {
    font-size: 18px;
  }

  .tariffs2__tagline {
    font-size: 13px;
  }

  .tariffs2__sum {
    padding: 10px 12px 12px;
  }

  .tariffs2__sum-num b {
    font-size: 28px;
  }

  .tariffs2__price b {
    font-size: 24px;
  }

  .tariffs2__note {
    min-height: 36px;
  }

  .tariffs2__cta {
    font-size: 14px;
  }

  .tariffs2__features {
    padding: 14px 16px 18px;
  }

  .tariffs2__features li,
  .tariffs2__features li.tariffs2__feature--lead {
    font-size: 13px;
  }
}

/* ---------- Под рядом: общее для всех тарифов и «Стартовый» ---------- */

.tariffs2__common {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  width: 100%;
  max-width: 1008px;
  margin: -12px auto 0;
  padding: 16px 20px;
  box-sizing: border-box;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  background: #f6f7f9;
}

.tariffs2__common-label {
  color: #6b6b75;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tariffs2__common ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tariffs2__common li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
}

.tariffs2__common li::before {
  flex-shrink: 0;
  width: 14px;
  height: 15px;
  background: url(../img/i11.svg) no-repeat 0 0 / 14px 15px;
  content: '';
}

.tariffs2__free-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  width: 100%;
  max-width: 1008px;
  margin: -24px auto 0;
  padding: 14px 20px;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}

.tariffs2__free-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tariffs2__free-text b {
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
}

.tariffs2__free-text span {
  color: #6b6b75;
  font-size: 13px;
  line-height: 17px;
}

.tariffs2__free-bar .tariffs2__cta {
  flex: none;
  width: auto;
  height: 44px;
  margin: 0;
  padding: 0 20px;
}

/* Раскрытие списка — только на мобильном */
.tariffs2__more {
  display: none;
}

/* ---------- Мобильный ---------- */

@media only screen and (width <= 760px) {
  .tariffs2__subtitle {
    margin-top: -12px;
    font-size: 14px;
  }

  /* Под плавающей шапкой header-mobile1 */
  .tariffs2__switch-wrap {
    position: sticky;
    top: 84px;
    z-index: 5;
  }

  .tariffs2__switch {
    width: 100%;
  }

  .tariffs2__period {
    flex: 1 1 0;
    gap: 6px;
    padding: 0 8px;
    font-size: 14px;
  }

  .tariffs2__period-label {
    display: none;
  }

  .tariffs2__period-short {
    display: inline;
  }

  .tariffs2__save {
    padding: 2px 6px;
    font-size: 11px;
  }

  .tariffs2__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 14px;
  }

  .tariffs2__card:hover {
    margin: 0;
    padding: 4px;
  }

  .tariffs2__card:hover .tariffs2__cta {
    transform: none;
  }

  .tariffs2__badge {
    top: -18px;
  }

  .tariffs2__badge span {
    height: 28px;
    padding: 0 12px;
    font-size: 14px;
  }

  .tariffs2__top {
    padding: 16px;
  }

  .tariffs2__features {
    padding: 14px 16px 16px;
  }

  /* Какие пункты свёрнуты, решает партиал (класс --extra по $visibleFeatures) */
  .tariffs2__inner:not(.is-open) .tariffs2__feature--extra {
    display: none;
  }

  .tariffs2__features:has(.tariffs2__feature--extra) {
    padding-bottom: 4px;
  }

  .tariffs2__more {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    margin: 0 16px 4px;
    padding: 0;
    border: 0;
    background: none;
    color: #0f172a;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .tariffs2__more::after {
    width: 7px;
    height: 7px;
    border-right: 2px solid currentcolor;
    border-bottom: 2px solid currentcolor;
    transform: translateY(-2px) rotate(45deg);
    content: '';
  }

  .tariffs2__inner.is-open .tariffs2__more::after {
    transform: translateY(2px) rotate(-135deg);
  }

  .tariffs2__more-close,
  .tariffs2__inner.is-open .tariffs2__more-open {
    display: none;
  }

  .tariffs2__inner.is-open .tariffs2__more-close {
    display: inline;
  }

  .tariffs2__common {
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 0;
    padding: 14px 16px;
  }

  .tariffs2__common ul {
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
  }

  .tariffs2__free-bar {
    flex-wrap: wrap;
    margin-top: -8px;
    padding: 16px;
  }

  .tariffs2__free-bar .tariffs2__cta {
    width: 100%;
  }
}
