/* ===== Смета (таблица позиций) ===== */
.estimate__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.estimate__heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.estimate__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.24;
  color: var(--color-black);

  strong,
  b,
  span {
    font-weight: inherit;
    color: var(--color-orange);
  }

  @media (max-width: 767px) {
    font-size: 24px;
  }
}

.estimate__desc,
.estimate__note {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-gray);

  @media (max-width: 767px) {
    font-size: 14px;
  }
}

/* Подпись под суммой — как примечание под таблицей */
.estimate__sum-note {
  margin-top: 4px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-gray);
  white-space: normal;

  @media (max-width: 767px) {
    font-size: 14px;
  }
}

/* Таблица: позиция тянется, суммы — фиксированные колонки справа */
.estimate__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.4;
  color: var(--color-black);

  th,
  td {
    height: 50px;
    padding: 0;
    font-weight: 400;
    text-align: left;
    vertical-align: middle;
  }

  .estimate__sum {
    width: 300px;
    padding-left: 30px;
    text-align: right;
    white-space: nowrap;
  }

  thead th {
    font-weight: 600;
    border-bottom: 1px solid var(--color-black);
  }

  /* Строка с подписью под суммой — с отступами, чтобы текст не прилипал к чертам */
  tbody tr:has(.estimate__sum-note) > * {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  tbody tr {
    border-bottom: 1px solid var(--color-gray-light);

    &:last-child {
      border-bottom: 0;
    }
  }

  /* Итоговая строка: жирным, чёрная черта сверху (серую черту строки над ней убираем) */
  tbody tr:has(+ .estimate__row--total) {
    border-bottom: 0;
  }

  tbody .estimate__row--total {
    border-top: 1px solid var(--color-black);

    th,
    td {
      font-weight: 600;
    }
  }

  @media (max-width: 1024px) {
    .estimate__sum {
      width: 180px;
      padding-left: 20px;
    }
  }

  /* Мобильный: колонки сумм по 80px, позиции переносятся, выравнивание по верху */
  @media (max-width: 767px) {
    font-size: 14px;

    th,
    td {
      height: auto;
      padding: 10px 0;
      vertical-align: top;
    }

    .estimate__sum {
      width: 100px;
      padding-left: 20px;
    }

    thead .estimate__label {
      font-size: 0;
    }
  }
}
