/*------------------------------------
  Tables v3
------------------------------------*/

.dataTables_scroll {
  border-bottom: 1px solid $g-color-gray-light-v7;

  [class*="u-table--v3"] {
    margin-bottom: -1px;
  }

  .mCSB_outside + .mCSB_scrollTools {
    top: 0;
    right: 0;
    background-color: $g-color-white;
    border: 1px solid $g-color-gray-light-v7;
    margin-bottom: -1px;
  }

  .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar {
    width: 8px;
    background-color: $g-color-gray-light-v6;
  }

  .mCSB_scrollTools .mCSB_draggerRail {
    display: none;
  }

  td:last-child,
  th:last-child {
    padding-right: 34px;
  }
}

.dataTables_scrollHead,
.dataTables_scrollFoot {
  overflow: visible !important;
}

[class*="u-table--v3"] {
  margin-bottom: 0;

  th,
  td {
    color: inherit;
    vertical-align: middle;
    @include px-to-rem(padding, 20px);
    border-top-color: $g-color-gray-light-v7 !important;
    border-bottom-color: $g-color-gray-light-v7 !important;
    border-left-color: $g-color-gray-light-v7 !important;
    border-right-color: $g-color-gray-light-v7 !important;

    &:first-child,
    &.g-first-child {
      text-align: center;
      border-left: 1px solid;
    }

    &:last-child,
    &.g-last-child {
      border-right: 1px solid;
    }
  }

  thead {
    th {
      font-weight: 400;
      border-bottom: none;
    }
  }

  td {
    font-weight: 300;
    @include px-to-rem(padding-top, 16px);
    @include px-to-rem(padding-bottom, 16px);
  }

  .opened {
    & + tr {
      background-color: $g-color-gray-light-v8;
    }
  }

  tr:last-child {
    td {
      border-bottom: 1px solid;
    }
  }

  .thead-light,
  .tfoot-light {
    th,
    td {
      color: $g-color-gray-dark-v6;
      background-color: $g-color-gray-light-v8;
      border-color: $g-color-gray-light-v8;
    }
  }

  &.table-hover {
    tbody {
      tr:hover {
        background-color: rgba($g-color-gray-light-v8, .4);
      }
    }
  }

  &.table-striped {
    tbody {
      tr:nth-of-type(2n+1) {
        background-color: $g-color-gray-light-v8;
      }
    }
  }

  tfoot.u-tfoot-after-thead {
    display: table-header-group;
  }
}

.u-table--v3--bordered {
  th,
  td {
    border-left: 1px solid;
  }
}

.u-table--v3--borderless {
  th,
  td {
    border-top-color: transparent !important;
    border-bottom-color: transparent !important;
    border-left-color: transparent !important;
    border-right-color: transparent !important;
    border: none;

    &:first-child,
    &.g-first-child {
      border-left: none;
    }

    &:last-child,
    &.g-last-child {
      border-right: none;
    }
  }

  tr:last-child {
    td {
      border-bottom: none;
    }
  }
}

.u-table--v3--row-border-bottom {
  td {
    border-bottom: 1px solid;
    border-bottom-color: $g-color-gray-light-v7 !important;
  }

  tr:last-child {
    td {
      border-bottom: 1px solid;
      border-bottom-color: $g-color-gray-light-v7 !important;
    }
  }
}
