.table {
  &-block__wrapper {
    margin: 3rem -1rem 3rem 0;
    clear: both;
    max-width: 900px;

    .tablet-controls {
      height: 0;
    }

    &:before {
      content: none;
    }

    .js-scroll--left {

      .left {
        display: none;
      }

      .right {
        display: block;
      }
    }

    .js-scroll--right {

      .right {
        display: none;
      }

      .left {
        display: block;
      }
    }

    .js-scroll--right,
    .js-scroll--left {
      table {
        display: block;
      }

      .table-scroller {
        overflow: auto;
        width: 100%;
        display: block;
      }

      .right,
      .left {
        @media (min-width: $break-medium) {
          display: none;
        }
      }
    }

  }

  &-block__holder {
    position: relative;
    tbody {
      &:before {
        margin-top: 5px;
      }


      &:after {
        content: none;
      }
    }

    thead {
      & + tbody {
        border-top: 0;
        padding-top: 0;

        &:before {
          content: none;
        }
      }
    }

    &.sticky {
      thead {
        position: sticky;
        top: 0;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */

        /* Hide scrollbar for Chrome, Safari and Opera */
        &::-webkit-scrollbar {
          display: none;
        }

        &:before {
          margin-top: 5px;
        }
      }

    }
  }
}

table {
  clear: both;
  max-width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  color: $color-blue-dark;
  background-color: $color-white;
  border-bottom: 1px solid $color-blue-dark;

  > thead {
    border-radius: 5px 0 0 0;
    th {
      font-weight: 700;
      line-height: 1.5;
      text-align: left;
      padding: 1rem;
      background-color: $color-blue-dark;
      color: $color-white;
    }

    @media (min-width: $break-medium) {
      border-radius: 8px 8px 0 0;
      th {
        &:first-of-type {
          padding: 1rem 10px 1rem 3.125rem;
        }
      }
    }
  }

  td,
  th {
    text-align: left;
    vertical-align: top;
  }

  tbody th {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid $color-gray-light;

    @media (min-width: $break-medium) {
      padding: 3rem 0.625rem 3rem 3.125rem;
    }
  }

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

  a:focus {
    @include focus-dark();
  }

  td {
    padding: 1.5rem;
    border-bottom: 1px solid $color-gray-light;

    @media (min-width: $break-medium) {
      padding: 3rem 0.625rem;
    }
  }

  a {
    color: $color-green;
  }
}

.table-block {
  &__holder {
    &.js-scroll--right {
      .table-block__next {
        visibility: visible;
        opacity: 1;
      }
    }
    &.js-scroll--left {
      .table-block__prev {
        visibility: visible;
        opacity: 1;
      }
    }
  }
  &__prev,
  &__next {
    visibility: hidden;
    opacity: 0;
    font-size: 0;
    line-height: 0;
    position: sticky;
    top: 50%;
    transform: translateY(50%);
    left: -10px;
    width: 47px;
    height: 44px;
    z-index: 1000;
    background-color: $color-blue-light;
    padding: 0;
    border: 1px solid $color-blue-light;
    border-radius: 8px;
    transition: background-color 300ms;

    @media (min-width: $break-medium) {
      left: -20px;
      width: 45px;
      height: 45px;
    }

    @media (min-width: $break-large) {
      width: 50px;
      height: 50px;
      left: -58px;
    }

    &.table-block__next,
    &.table-block__prev {
      @media (max-width: $break-large - 1px) {
        @include focus-dark;
        outline-offset: -3px;
      }
    }

    &:hover {
      background: $color-white;
      border-color: $color-black;
    }

    &:after {
      content: '';
      display: inline-block;
      vertical-align: top;
      width: 10px;
      height: 10px;
      left: 50%;
      border-top: 4px solid $color-black;
      border-right: 4px solid $color-black;
      transform: rotate(45deg);
      line-height: 1;
      margin-left: -3px;
      transition: all 300ms;

      @media (min-width: $break-large) {
        width: 10px;
        height: 10px;
        margin-left: -1px;

      }
    }
  }

  &__next {
    left: 100%;

    @media (min-width: $break-medium) {
      margin-right: -30px;
    }

    @media (min-width: $break-large) {
      right: -58px;
      margin-right: -50px;
    }
  }

  &__prev {
    margin-left: -10px;

    @media (min-width: $break-medium) {
      margin-left: -30px;
    }

    @media (min-width: $break-large) {
      margin-left: -50px;
    }

    &:after {
      transform: rotate(-135deg);
      margin-left: 3px;
    }
  }
}