@use 'pix-design-tokens/fonts';
@use 'pix-design-tokens/breakpoints';

.campaign-filters {
  display: flex;
  flex-direction: column;
  gap: var(--pix-spacing-4x);
  margin: 8px 5px;
  padding: 10px 14px;
  background-color: var(--pix-neutral-0);
  border-radius: 4px;

  @include breakpoints.device-is('tablet') {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 8px 0;
    padding: 14px 24px;
  }

  &__title {
    color: var(--pix-neutral-500);
    font-size: 0.875em;
  }

  .search-input {
    width: 260px;
    height: 36px;

    @include breakpoints.device-is('mobile') {
      width: 100%;
    }
  }

  &__type {
    display: flex;

    label:first-of-type {
      border-radius: 4px 0 0 4px;
    }

    label:last-of-type {
      border-left: none;
      border-radius: 0 4px 4px 0;
    }
  }

  &__filter {
    display: flex;
    flex-direction: column;
    gap: var(--pix-spacing-4x);

    @include breakpoints.device-is('desktop') {
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
    }
  }

  &__action {
    display: flex;
    gap: var(--pix-spacing-6x);
    border-top: 1.2px solid var(--pix-neutral-20);

    @include breakpoints.device-is('tablet') {
      border: none;
    }

    @include breakpoints.device-is('mobile') {
      justify-content: space-between;
      border: none;
    }
  }

  &__results {
    display: flex;
    align-items: center;
    color: var(--pix-neutral-500);
    font-weight: 500;
    font-size: 0.875em;
  }

  &__action-separator {
    border-left: 1px solid var(--pix-neutral-20);

    @include breakpoints.device-is('mobile') {
      border-left: none;
    }
  }

  &__radio {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    border: 0;
    clip: rect(0, 0, 0, 0);

    &:focus-visible + .campaign-filters__tab {
      z-index: 1;
      box-shadow: var(--pix-neutral-0) 0 0 0 2px, var(--pix-primary-500) 0 0 0 4px;
    }
  }

  &__tab {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 6px 8px;
    color: var(--pix-neutral-500);
    font-weight: 500;
    font-size: 0.8125rem;
    font-family: fonts.$font-roboto;
    background: transparent;
    border: 1.2px solid var(--pix-neutral-500);
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;

    &:hover {
      background: var(--pix-neutral-20);
      opacity: 0.8;
    }

    &--active {
      background: var(--pix-neutral-20);

      &:hover {
        opacity: 1;
      }
    }

    @include breakpoints.device-is('mobile') {
      flex-grow: 1;
      justify-content: center;
    }
  }
}
