.app-table-pagination {
  display: flex;
  padding: var(--spacing-150) var(--spacing-100);
  border-top: 1px solid var(--border-subtle-2);

  .itens-container {
    display: flex;
    align-items: center;
    gap: 16px;

    .itens-page {
      display: flex;
      align-items: center;
      margin-right: 16px;
      gap: 16px;
    }

    .itens-total {
      display: flex;
      align-items: center;
      margin-right: auto;
    }
  }

  .pages-total-mobile {
    display: none;
  }

  .pages-total {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    max-width: 196px;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;

    &::-webkit-scrollbar {
      display: none;
    }

    &.is-dragging {
      cursor: grabbing;

      .page-number {
        cursor: grabbing;
      }
    }

    .page-number {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 36px;
      height: 40px;
      padding: 0 var(--spacing-50);
      margin: 0;
      border: none;
      border-radius: 0;
      font-family: 'Work Sans', sans-serif;
      @include button-small;
      color: var(--text-on-color-dark);
      background-color: var(--button-secondary-default);
      cursor: pointer;

      &:hover:not(.active) {
        filter: brightness(1.05);
      }

      &.active {
        background-color: var(--button-primary-default);
        color: var(--text-on-color-light);
        cursor: default;
      }

      &:focus-visible {
        outline: 2px solid var(--border-focus);
        outline-offset: 2px;
      }
    }
  }

  .pages-navigation {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
  }

  .select-pages {
    box-sizing: border-box;
    min-width: 56px;
    height: 40px;
    margin: 0;
    padding: var(--spacing-0) 28px var(--spacing-0) var(--spacing-100);
    border: none;
    border-radius: 0;
    font-family: 'Work Sans', sans-serif;
    @include button-small;
    color: var(--text-on-color-dark);
    background-color: var(--button-secondary-default);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23222' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 20px 20px;
    cursor: pointer;
    appearance: none;

    &:hover {
      filter: brightness(1.05);
    }

    &:focus-visible {
      outline: 2px solid var(--border-focus);
      outline-offset: 2px;
    }
  }

  .page-strip-nudge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    min-width: 22px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background-color: var(--button-secondary-default);
    color: var(--text-on-color-dark);
    cursor: pointer;

    &:hover:not(:disabled) {
      filter: brightness(1.05);
    }

    &:disabled {
      opacity: 0.4;
      cursor: default;
    }

    &:focus-visible {
      outline: 2px solid var(--border-focus);
      outline-offset: 2px;
    }
  }

  &.small {
    padding: var(--spacing-100);

    .itens-page {
      margin-right: 12px;
    }

    .pages-total {
      width: 160px;

      .page-number {
        min-width: 28px;
        height: 32px;
      }
    }

    .page-strip-nudge {
      height: 32px;
    }

    .select-pages {
      height: 32px;
      background-position: right 2px center;
    }
  }
}

@media (max-width: 768px) {
  .app-table-pagination {
    flex-direction: column;

    .itens-container .itens-total {
      margin-right: unset;
      margin-left: auto;
    }

    .pages-navigation {
      justify-content: center;
      margin-left: auto;
      margin-right: auto;
      margin-top: 16px;
    }
  }
}

@media (max-width: 767px) {
  .app-table-pagination {
    flex-direction: row;
    justify-content: space-between;
    padding: 12px;

    .itens-container {
      .itens-page {
        .itens-page-label {
          display: none;
        }
      }
    }

    .pages-total-mobile {
      display: block;
    }

    .pages-total {
      display: none;
    }

    .pages-navigation {
      justify-content: center;
      margin: 0px;
    }
  }
}
