.estimate__header {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;

  p {
    margin-bottom: 28px;

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

.estimate__header-subtitle {
  font-weight: bold;
  margin-bottom: 30px;
}

.estimate__header-row {
  display: flex;
  align-items: flex-start;
  column-gap: 50px;
}

.estimate__header-content > :last-child {
  margin-bottom: 0;
}

.estimate__discount {
  --arrow-size: 22px;
  font-size: 50px;
  line-height: 60px;
  font-weight: normal;
  display: block;
  padding: 10px 14px 10px calc(var(--arrow-size) + 10px);
  background: var(--accent-color);
  color: var(--main-color);
  clip-path: polygon(0 50%, var(--arrow-size) 0, 100% 0, 100% 100%, var(--arrow-size) 100%);
}

.estimate__footer {
  margin-top: 60px;
}

.estimate__links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 60px;
  row-gap: 8px;
}

@media (max-width: 1199.98px) {
  .estimate__header {
    font-size: 18px;
    line-height: 26px;

    p {
      margin-bottom: 24px;

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

  .estimate__header-row {
    column-gap: 10px;
  }

  .estimate__discount {
    --arrow-size: 10px;
    font-size: 20px;
    line-height: 30px;
    padding: 5px 5px 5px calc(var(--arrow-size) + 5px);
  }

  .estimate__footer {
    margin-top: 40px;
  }

  .estimate__links {
    column-gap: 40px;
  }
}

/* Table */
.estimate {
  overflow-x: clip;
}

.estimate-table {
  font-size: 14px;
  line-height: 22px;
}

/* row */
.estimate-table__row {
  display: grid;
  grid-template-columns: minmax(1px, 1fr) 180px 128px 102px 154px;
}

.estimate-table__section-header .estimate-table__row,
.estimate-table__section-subtitle .estimate-table__row {
  grid-template-columns: minmax(1px, 1fr);
}

.estimate-table__row._total,
.estimate-table__row._discount {
  font-weight: bold;
}

.estimate-table__row:nth-child(odd) {
  background: var(--white-secondary-color);
}

.estimate-table__header .estimate-table__row,
.estimate-table__section-header .estimate-table__row,
.estimate-table__section-total .estimate-table__row,
.estimate-table__section-subtitle .estimate-table__row {
  background: none;
}
/* ! row */

/* col */
.estimate-table__col {
  align-content: center;
  padding: 11px 15px;
  border-style: solid;
  border-color: var(--surface-light-color);
  border-width: 0 0 0 1px;
}

.estimate-table__col:first-child {
  border-left-width: 0;
}

.estimate-table__header .estimate-table__col,
.estimate-table__footer .estimate-table__col,
.estimate-table__section-total .estimate-table__col {
  border-color: var(--main-color);
}

.estimate-table__header .estimate-table__col {
  padding-top: 15px;
  padding-bottom: 15px;
}

/* ! col */

/* headers */
.estimate-table__header,
.estimate-table__footer,
.estimate-table__section-total,
.estimate-table__section-header,
.estimate-table__section-subtitle {
  font-weight: bold;
  font-size: 16px;
  line-height: 24px;
}

.estimate-table__header-inner,
.estimate-table__footer,
.estimate-table__section-total {
  border-style: solid;
  border-color: var(--main-color);
  border-width: 1px 0;
}

.estimate-table__section-header,
.estimate-table__section-subtitle,
.estimate-table__section-header .estimate-table__sticky-bg {
  background: var(--accent-color);
}
/* ! headers */

/* sticky */
html:not(.is-catalog-menu-open) .estimate__content {
  position: relative;
  z-index: 1003;
  background: var(--main-bg);
}

.estimate-table__header {
  position: sticky;
  container-type: scroll-state;
  top: 0;
  z-index: 2;
  background: var(--main-bg);
}

.estimate-table__section-header {
  position: sticky;
  container-type: scroll-state;
  top: 80px;
  z-index: 1;
}

.estimate-table__sticky-bg {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 100vw;
  transform: translateX(-50%);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.15);
  z-index: -1;
  display: none;
}

.estimate-table__header .estimate-table__sticky-bg {
  background: var(--main-bg);
}

@container scroll-state(stuck: top) {
  .estimate-table__sticky-bg {
    display: block;
  }

  .estimate-table__header-inner {
    border-color: transparent !important;
  }
}
/* ! sticky */

.estimate-table__section {
  margin-bottom: 60px;
}

.estimate-table__text-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  column-gap: 8px;
}

.estimate-table__text {
  flex-grow: 1;
  min-width: 1px;
}

.estimate-table__text-row .tooltip-icon {
  margin-top: -1px;
  margin-bottom: -1px;
}

@media (min-width: 992px) {
  .estimate-table__suffix {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .estimate-table__header {
    display: none;
  }

  .estimate-table__section {
    margin-bottom: 40px;
  }

  .estimate-table__section-header {
    top: 0;
  }

  .estimate-table__row {
    padding: 10px 15px;
    grid-template-columns: minmax(1px, 1fr) 80px 40px 60px;
    grid-template-rows: auto auto;
    row-gap: 10px;
    column-gap: 8px;
  }

  .estimate-table__section-header .estimate-table__row,
  .estimate-table__section-subtitle .estimate-table__row {
    grid-template-rows: auto;
    row-gap: 0;
  }

  .estimate-table__row._total,
  .estimate-table__row._discount,
  .estimate-table__section-total .estimate-table__row,
  .estimate-table__footer .estimate-table__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }

  .estimate-table__col {
    padding: 0;
    border: none;
  }

  .estimate-table__col:first-child {
    grid-column: 1 / -1;
  }

  .estimate-table__col:last-child:not(:first-child) {
    text-align: right;
  }

  .estimate-table__row._total .estimate-table__col._empty,
  .estimate-table__footer .estimate-table__col._empty {
    display: none;
  }

  .estimate-table__footer .estimate-table__col:not(:first-child) {
    text-align: right;
    white-space: nowrap;
  }
}

@media (max-width: 575.98px) {
  .estimate-table {
    margin-left: -15px;
    margin-right: -15px;
  }
}
/* !Table */
