@import "../vendor/bootstrap/scss/tables";

.table-responsive { overflow: visible; }

.sds-table-scrollable-wrapper {
  overflow-x: auto;
  border-radius: $table-border-radius;
  border-style: solid;
  border-width: $table-border-width;
  margin-bottom: map-get($spacers, 4);

  .table {
    border-collapse: collapse;
    margin-bottom: 0;

    td {
      @extend %text-md-regular;
    }

    th {
      @extend %text-md-semibold;

      color: $table-color;

      &.clickable {
        cursor: pointer;

        &::after {
          content: "";
          display: inline-block;
          width: $icon-size-sm;
        }

        &.sort-asc::after {
          @extend %dropdown-toggle-icon-up;
          @extend %icon-sm;

          margin-bottom: -2px;
        }

        &.sort-desc::after {
          @extend %dropdown-toggle-icon;
          @extend %icon-sm;

          margin-bottom: -2px;
        }
      }
    }

    td,
    th { white-space: nowrap; }

    tfoot td {
      padding: $table-cell-footer-padding-y $table-cell-footer-padding-x;
    }

    &.table-sm {
      th {
        @extend %text-sm-semibold;
      }

      tfoot td {
        padding: 0 $table-cell-footer-padding-x-sm;
      }
    }

    tbody tr:last-of-type td {
      border-bottom: none;
    }
  }

  /* stylelint-disable no-descending-specificity */
  &.sds-table-light {
    border-color: $table-border-color;

    thead tr th {
      background-color: $table-head-bg;
      color: $table-head-color !important;
    }
  }

  &.sds-table-dark {
    border-color: $table-dark-border-color;

    thead tr th {
      background-color: $table-dark-head-bg;
      color: $table-dark-head-color !important;
    }
  }
}
