// Pagination
.toolbox {
  display: flex;
  flex-direction: row;
  font-size: 1.4rem;
  line-height: 1.5;
  margin-top: 0;
  margin-bottom: 2rem;
  @include clearfix;

  &.toolbox-pagination {
    margin-bottom: 5rem;
    padding-top: 2rem;
    border-top: 1px solid #e4e4e4;
  }

  .pagination {
    margin-left: auto;
  }

  .select-custom {
    margin-bottom: 0;

    &::after {
      right: 1.5rem;
      font-size: 1.6rem;
    }

    .form-control {
      max-width: 160px;
      padding-right: 2.5rem;
      border-color: #e4e4e4;
      font-size: 1.2rem;
    }
  }

  label {
    display: none;
    margin-top: 1px;
    margin-bottom: 0;
    color: $body-text;
    font-size: 1.3rem;
    font-weight: 400;
  }

  .form-control {
    display: inline-block;
    border-width: 1px;
    padding: 0 .8rem;
    margin-bottom: 0;

    &:not(:focus) {
      border-color: #e4e4e4;
    }
  }

  select.form-control:not([size]):not([multiple]) {
    height: 34px;
  }

  .toolbox-show {
    .select-custom:after {
      right: 1rem;
    }
  }
}

.toolbox-pagination .toolbox-show {
  display: none;
}

.pagination {
  border-radius: 0;
  font-weight: 600;
  font-family: $font-family;
  align-items: center;
  margin-bottom: 0;
}

.page-link {
  font-size: 1.4rem;
  padding: 0 1rem;
  margin-left: -1px;
  line-height: 1.25;
    color: #706f6c;
  background-color: transparent;
  border: 0;

  &:hover,
  &:focus {
  box-shadow: none;
  color: $primary-color;
  text-decoration: none;
  background-color: transparent;
  border-color: transparent;
  }

  &.page-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.6rem;
    height: 3.6rem;
    border: .1rem solid $primary-color;
    padding: 0;
    color: #fff;
    background-color: $primary-color;
    font-size: 1.8rem;

    i {
      position: relative;
      top: -.1rem;
    }

    &:hover,
    &:focus {
      opacity: .85;
    }
  }
}

.page-item {
  &:first-child .page-link {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;

    &.page-link-btn {
      margin-right: 1rem;
    }
  }

  &:last-child .page-link {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;

    &.page-link-btn {
      margin-left: 1rem;
    }
  }

  &.active .page-link {
    color: $primary-color;
    background-color: transparent;
    border-color: transparent;
  }

  &.disabled .page-link {
    color: #eee;
    background-color: transparent;
    border-color: transparent;

    &.page-link-btn {
        color: #C1C3C5;
        border-color: #C1C3C5;
        background-color: transparent;
      }
  }
}

.toolbox-left {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
}

.toolbox-item {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;

  &.toolbox-sort {
    margin-right: 1.5rem;
  }

  &.toolbox-show {
    margin-left: auto;
  }

  label {
    margin-right: 1.2rem;
  }
}

.sorter-btn {
  margin-left: .8rem;
  color: #000;
  font-size: 1.7rem;
  text-decoration: none;

  &::before {
    font-family: 'porto';
    content: '\e890';
  }

  &.btn-desc {
    &::before {
      content: '\e891';
    }
  }

  &:hover,
    &:focus {
      text-decoration: none;
    }
}

.layout-modes {
  display: none;
  margin-left: 2.1rem;
  font-size: 0;
}

.layout-btn {
  display: inline-block;
  height: 3.4rem;
  margin-right: .7rem;
  color: #000;
  font-size: 1.6rem;
  line-height: 3.4rem;
  text-align: center;
    text-decoration: none;

    i::before {
      margin-left: 0;
      margin-right: 0;
    }

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

    &.active,
    &:hover,
    &:focus {
      color: $primary-color;
      text-decoration: none;
    }
}

.horizontal-filter {
  .toolbox-sort {
    margin-left: auto;
  }

  .toolbox-item:last-child {
    display: none;
  }
}

@include mq('xs') {
  .layout-modes {
    display: -ms-flexbox;
    display: flex;
  }

  .horizontal-filter {
    .toolbox-show {
      margin-left: 0;
    }
  }

  .toolbox-pagination .toolbox-show {
    display: -ms-flexbox;
    display: flex;
    margin-left: 0;
  }
}

@include mq('sm') {
  .toolbox-left {
    margin-bottom: 0;

    label {
      margin-right: 1.8rem;
    }
  }

  .horizontal-filter .toolbox-item:last-child {
    display: -ms-flexbox;
    display: flex;
  }
}

@include mq('md') {
  .toolbox {
    label {
      display: block;
    }
  }
}

@include mq('lg') {
  .toolbox {
    &.toolbox-pagination {
      margin-bottom: 5rem;
    }
  }
}

@include mq('sm', 'max') {
  .horizontal-filter .toolbox-item.toolbox-sort {
    margin-right: 0;
  }
}
