/*
 * Единый шаг между audit-секциями (AI / рейтинги / пакеты / FAQ / калькулятор).
 * padding вместо margin: overflow на .site-packages__table-wrap создаёт BFC и
 * ломает margin-collapse — отступы через padding предсказуемее.
 * Наследуем --space-between с остальной сетки сайта (80px / 60px).
 */
:root {
  --section-gap: var(--space-between, 80px);
  /* Целевая сетка (новые правки только по ней) — см. docs/BREAKPOINTS.md */
  --bp-xs: 375px;
  --bp-sm: 576px;
  --bp-md: 768px;
  --bp-lg: 992px;
  --bp-xl: 1200px;
  --bp-2xl: 1440px;
  /* Согласованный порог «таблица → карточки» для /price и packages */
  --bp-table-cards: 1099px;
}

section.site-faq,
section.site-ratings,
section.site-packages,
section.site-calc,
.site-ai-home {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: var(--section-gap);
  padding-bottom: 0;
}

section.site-faq {
  padding-bottom: var(--section-gap);
}

.site-ratings__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.site-ratings__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(15, 61, 120, 0.08);
  text-decoration: none;
  color: inherit;
}

.site-ratings__name {
  font-size: 14px;
  color: #57758d;
}

.site-ratings__score {
  font-size: 28px;
  font-weight: 700;
  color: #2c80c5;
  line-height: 1.15;
}

.site-ratings__score--text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: #2c80c5;
}

.site-ratings__count {
  font-size: 14px;
  color: #57758d;
}

.site-packages .container {
  min-width: 0;
}

/* Скругление на shell без overflow — иначе radius+overflow клипает кнопку справа */
.site-packages__table-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.site-packages__table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* fixed + явная ширина CTA: кнопка не сжимается и не уезжает за край */
.site-packages__table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  table-layout: fixed;
  overflow: visible;
}

.site-packages__table th,
.site-packages__table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8eef5;
  text-align: left;
  vertical-align: top;
  box-sizing: border-box;
}

.site-packages__table th:nth-child(1),
.site-packages__table td:nth-child(1) {
  width: 18%;
}

.site-packages__table th:nth-child(2),
.site-packages__table td:nth-child(2),
.site-packages__table th:nth-child(3),
.site-packages__table td:nth-child(3) {
  width: 12%;
  white-space: nowrap;
}

.site-packages__table th:nth-child(4),
.site-packages__table td:nth-child(4) {
  width: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-packages__table tbody tr:last-child th,
.site-packages__table tbody tr:last-child td {
  border-bottom: 0;
}

.site-packages__table th:last-child,
.site-packages__table td:last-child {
  width: 10.5rem;
  min-width: 10.5rem;
  max-width: 10.5rem;
  white-space: nowrap;
  vertical-align: middle;
  padding-left: 10px;
  padding-right: 20px;
}

.site-packages__table .btn,
.site-packages__table a.btn,
.site-packages__cta {
  display: inline-flex;
  white-space: nowrap;
  max-width: none !important;
  width: auto;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 10px 14px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  overflow: visible;
}

.site-packages__cards {
  display: none;
}

.site-packages__card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
}

.site-packages__card:last-child {
  margin-bottom: 0;
}

.site-packages__price {
  font-size: 22px;
  color: #2c80c5;
  margin: 8px 0;
}

.site-calc__opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.site-calc__opts label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border-radius: 12px;
}

.site-calc__nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.site-ai-home {
  position: relative;
  z-index: 0;
  display: block;
}

.site-ai-home__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 28px;
  border-radius: 20px;
  background-color: #dbe7ff;
  background-image: linear-gradient(135deg, #e8f0ff 0%, #d0e0ff 100%);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.projects-card-meta {
  margin-top: 8px;
  font-size: 13px;
  color: #57758d;
}

/* Карточки раньше: на узком десктопе/планшете кнопка не должна сжиматься в таблице */
@media (max-width: 1099px) {
  .site-packages__table-shell,
  .site-packages__table-wrap {
    display: none;
  }

  .site-packages__cards {
    display: block;
  }

  .site-calc__form {
    max-width: 100%;
  }
}

.accordion-header {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/*
 * /price: легаси-таблица из CMS (.table / .table-wrapper) → те же карточки,
 * что у .site-packages (порог --bp-table-cards / 1099px).
 * Класс .table на фронте встречается только в контенте /price.
 */
@media (max-width: 1099px) {
  .page-price .table-wrapper {
    overflow: visible;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .page-price .table-wrapper figure.table {
    margin: 0;
  }

  .page-price__body {
    overflow-x: visible;
  }

  .page-price__body table.table,
  .page-price .table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    margin: 12px 0 8px;
  }

  .page-price__body table.table thead,
  .page-price .table thead {
    display: none;
  }

  .page-price__body table.table tbody,
  .page-price .table tbody {
    display: block;
  }

  .page-price__body table.table tbody tr.category-header,
  .page-price .table tbody tr.category-header {
    display: block;
    margin: 20px 0 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, #e8f2ff 0%, #dbe7ff 100%);
    box-shadow: none;
  }

  .page-price__body table.table tbody tr.category-header td,
  .page-price .table tbody tr.category-header td {
    display: block;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-weight: 600;
    color: var(--text-color, #1a2b3c);
    text-align: left !important;
    min-width: 0 !important;
  }

  .page-price__body table.table tbody tr:not(.category-header),
  .page-price .table tbody tr:not(.category-header) {
    display: block;
    background: #fff;
    border-radius: 16px;
    padding: 16px 18px 14px;
    margin-bottom: 12px;
    box-shadow: 0 8px 30px rgba(15, 61, 120, 0.08);
  }

  .page-price__body table.table tbody tr:not(.category-header) td,
  .page-price .table tbody tr:not(.category-header) td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-align: left !important;
    font-size: 14px;
    line-height: 1.4;
  }

  .page-price__body table.table tbody tr:not(.category-header) td:first-child,
  .page-price .table tbody tr:not(.category-header) td:first-child {
    display: none; /* № */
  }

  .page-price__body table.table tbody tr:not(.category-header) td:nth-child(2),
  .page-price .table tbody tr:not(.category-header) td:nth-child(2) {
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
    font-size: 15px;
    padding-top: 0 !important;
  }

  .page-price__body table.table tbody tr:not(.category-header) td:nth-child(3)::before,
  .page-price .table tbody tr:not(.category-header) td:nth-child(3)::before {
    content: "Стоимость";
    flex-shrink: 0;
    color: #57758d;
    font-weight: 500;
    font-size: 13px;
  }

  .page-price__body table.table tbody tr:not(.category-header) td:nth-child(4)::before,
  .page-price .table tbody tr:not(.category-header) td:nth-child(4)::before {
    content: "Сроки";
    flex-shrink: 0;
    color: #57758d;
    font-weight: 500;
    font-size: 13px;
  }

  .page-price__body table.table tbody tr:not(.category-header) td:nth-child(3),
  .page-price__body table.table tbody tr:not(.category-header) td:nth-child(4),
  .page-price .table tbody tr:not(.category-header) td:nth-child(3),
  .page-price .table tbody tr:not(.category-header) td:nth-child(4) {
    font-weight: 600;
    color: #2c80c5;
    border-top: 1px solid #e8eef5 !important;
  }

  .page-price__body table.table tbody tr:not(.category-header) td:last-child,
  .page-price .table tbody tr:not(.category-header) td:last-child {
    display: block;
    padding-top: 12px !important;
    border-top: 1px solid #e8eef5 !important;
    text-align: left !important;
  }

  .page-price__body table.table tbody tr:not(.category-header) td:last-child .btn,
  .page-price .table tbody tr:not(.category-header) td:last-child .btn {
    width: 100%;
    justify-content: center;
    max-width: none;
  }
}

/* Hero: декоративные круги могут вылезать из слайда; клип на секции, не на body */
.hero {
  overflow-x: hidden;
  max-width: 100%;
}
