@use "../../scss/globals.scss";

.catalogue {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: calc(globals.$spacing-unit * 2);
  width: 100%;
  padding: 16px;
  scroll-behavior: smooth;

  &__filters-container {
    width: 100%;
    align-self: flex-start;
  }

  &__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  &__header-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    &--filters {
      align-items: flex-start;
    }
  }

  &__header-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  &__filters-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
  }

  &__sort-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
  }

  &__sort-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
  }

  &__active-filters-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    align-self: center;
  }

  &__filters-wrapper {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
  }

  &__filters-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  &__clear-all-button {
    flex-shrink: 0;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
    align-self: center;
  }

  &__sort-select {
    min-width: 180px;

    .select-field {
      width: 100%;

      &__option {
        width: 100%;
      }
    }
  }

  &__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 380px);
    gap: calc(globals.$spacing-unit * 2);
    align-items: start;
  }

  &__games-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    gap: 8px;
  }

  &__pagination-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 16px;
  }

  &__result-count {
    font-size: 12px;
    font-weight: 500;
    color: globals.$body-color;
  }

  &__filters-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  &__skeleton {
    height: 105px;
    border-radius: 4px;
    border: solid 1px rgba(255, 255, 255, 0.15);
  }

  @media (max-width: 1024px) {
    &__content {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  @media (max-width: 768px) {
    &__header-row {
      flex-direction: column;
      align-items: stretch;
    }

    &__sort-inline {
      width: 100%;
      justify-content: space-between;
    }

    &__sort-select {
      flex: 1;
    }

    &__clear-all-button {
      width: 100%;
    }
  }
}
