@use "../../wc";


.table {
  display: flex;
  flex-direction: column;
  width: 100%;
}


.header {
  display: flex;
  align-items: center;
  width: 100%;
}

.header-item, .row-item {
  padding: 10px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  justify-content: center;
  gap: var(--zn-spacing-small);

  .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--zn-spacing-small);
  }

  &:last-child {
    flex-direction: column-reverse;
  }

  @include wc.container-query(md) {
    flex: 1;
    border-bottom: 1px solid rgb(var(--zn-border-color));

    &:first-child {
      width: 35%;
      flex-basis: 35%;
      align-items: flex-start;

      &.row-caption {
        text-align: left;
      }
    }

    &:last-child {
      text-align: right;
    }
  }
}

.sub-row:last-of-type {
  border-bottom: 2px solid rgb(var(--zn-border-color));

  @include wc.container-query(md) {
    border-bottom: none;

    .row-item {
      border-bottom: 2px solid rgb(var(--zn-border-color));
    }
  }
}

.row {
  background-color: rgba(var(--zn-panel-highlight), var(--zn-panel-highlight-opacity, 1));
}

.header-item {
  font-size: 14px;
  font-weight: 600;
  color: rgb(var(--zn-text-heading));
  white-space: nowrap;
}

.row-caption .content {
  div:first-of-type {
    font-size: 14px;
    font-weight: 600;
    color: rgb(var(--zn-text-heading));
  }
}

.rows {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgb(var(--zn-border-color));
  width: 100%;

  @include wc.container-query(md) {
    border-bottom: none;
  }

  &:first-of-type {
    margin-top: 0;
  }
}

.sub {
  width: 100%;

  @include wc.container-query(md) {
    display: contents;
  }
}

.sub-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgb(var(--zn-border-color));
  width: 100%;

  @include wc.container-query(md) {
    border-bottom: none;
  }
}

.summary {
  width: 100%;
  padding-top: 10px;
  margin-left: auto;

  @include wc.container-query(md) {
    width: 50%;
  }
}

.summary-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: rgb(var(--zn-text-heading));

  &:first-of-type {
    .summary-item-value {
      font-weight: 400;
    }
  }
}

.summary-divide {
  border-bottom: 1px solid rgb(var(--zn-border-color));
}

.summary-item-title, .summary-item-value {
  padding: 10px 20px;

  @include wc.container-query(md) {
    padding: 10px;
  }
}
