.head {
  position: relative;
  margin-bottom: 0;
  padding-top: 2rem;
  margin-top: 0;
  padding-bottom: 60px;

  @media (max-width: 650px) {
    padding-bottom: 40px;
  }

  & .head-content {
    display: flex;
    justify-content: space-between;
    align-items: center;

    p {
      display: flex;
      align-items: center;
      font-weight: 500;
      font-size: 1rem;
      line-height: 24px;
      text-decoration: underline;
      color: #999999;
      cursor: pointer;
      transition: 0.3s ease;

      & .arrow-right {
        transform: rotateZ(-90deg);
        background-color: #999999;
      }

      &.descending {
        & .arrow-right {
          transform: rotateZ(90deg);
        }
      }
    }
  }
}

.cases-section {
  margin-top: 60px;
  padding-inline: 0;

  @media (max-width: 650px) {
    margin-top: 40px;
  }

  & .filter {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 5rem;
    list-style: none;
    padding: 0;
    padding-inline: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0;

    & li {
      font-weight: 400;
      padding: 0.5rem 1rem;
      border-radius: 8px;
      border: 1px solid #999999;
      transition: 0.3s ease;
      cursor: pointer;

      &:hover:not(.active) {
        border: 1px solid #CCCCCC;
        color: #666666;
      }
    }

    & li.active {
      background: linear-gradient(
        180deg,
        #8039e5 0%,
        #b939e5 50%,
        #e539bd 100%
      );
      border: 1px solid white;
      color: white;
    }

    @media (max-width: 650px) {
      flex-wrap: nowrap;
      overflow: auto;
      scrollbar-width: none;

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

      & li {
        text-wrap: nowrap;
      }
    }
  }

  & .cases-container {
    padding-inline: 1.5rem;
    display: flex;
    column-gap: 1.5rem;
    row-gap: 4rem;
    flex-wrap: wrap;

    @media (max-width: 900px) {
      flex-direction: column;
      align-items: center;
      row-gap: 3rem;
    }

    & .contact-btn-mini {
      flex-basis: 64px;
      flex-shrink: 0;
    }

    & .slide__container {
      flex: 1 1 40%;
      display: flex;
      flex-direction: column;
      gap: 2rem;
      max-width: calc(50% - 0.75rem);
      align-items: normal;

      @media (max-width: 900px) {
        flex: initial;
        max-width: 450px;
      }

      & .slide__gradient {
        position: relative;
        background: linear-gradient(
          180deg,
          #8039e5 0%,
          #b939e5 50%,
          #e539bd 100%
        );
        padding-block: 2rem;
        width: 100%;
        height: 480px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;

        @media (max-width: 900px) {
          height: 320px;
        }

        & .tags {
          padding: 0;
          margin: 0;
          width: auto;
          position: absolute;
          top: 0.75rem;
          right: 0.75rem;
          flex-direction: column;
          align-items: end;
          gap: 0.25rem;

          & li {
            width: fit-content;

            & a {
              color: white;
              text-decoration: none;
            }
          }
        }
      }

      & .slide-item {
        max-width: 90%;
        max-height: 100%;
        width: 100%;
        height: 100%;

        img {
          height: auto;
          max-height: 100%;
        }
      }

      & .slide-content {
        flex-direction: row;
        max-width: none;
        gap: 1rem;
        text-decoration: none;

        & h3 {
          color: black;
          flex: 1;
        }

        & .case-labels {
          list-style: none;
          padding: 0;
          margin: 0.75rem 0 0;
          display: flex;
          flex-wrap: wrap;
          gap: 0.4rem;

          & li {
            font-size: 12px;
            line-height: 16px;
            color: #4d4d4d;
            border: 1px solid #d9d9d9;
            border-radius: 999px;
            padding: 0.2rem 0.55rem;
            background: #fafafa;
          }
        }
      }

      .slide-content:hover .contact-btn {
        background: var(--black);
      }
      .slide-content:hover .contact-btn .arrow-right {
        background: white;
      }

      .slide__gradient:hover + .slide-content .contact-btn {
        background: var(--black);
      }
      .slide__gradient:hover + .slide-content .contact-btn .arrow-right {
        background: white;
      }
    }
  }

  & .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5rem;

    & a,
    .disabled {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      text-decoration: none;
      font-weight: 400;
      text-align: center;
      color: black;

      @media (max-width: 475px) {
        width: 2rem;
        height: 2rem;
      }

      &.current {
        background: linear-gradient(
          180deg,
          #8039e5 0%,
          #b939e5 50%,
          #e539bd 100%
        );
        color: white;
      }
    }

    & .pages-container {
      display: flex;
      align-items: center;
      gap: 0;
    }

    & .ellipsis {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #666666;
      font-weight: 400;
      user-select: none;

      @media (max-width: 475px) {
        width: 2rem;
        height: 2rem;
      }
    }

    & a {
      cursor: pointer;

      &:hover:not(.current) {
        background: linear-gradient(
          180deg,
          #8039e5 0%,
          #b939e5 50%,
          #e539bd 100%
        );
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        color: transparent;
      }

      &.disabled {
        cursor: not-allowed;
        color: #999999;
        background-color: transparent;
        border-bottom: none;
        pointer-events: none;
        user-select: none;
        color: #cccccc;
      }
    }

    & .next-page i,
    .prev-page i {
      mask-image: url("../../img/arrow_small_down_24px.svg");
    }

    & .next-page i {
      transform: rotate(-90deg);
    }

    & .prev-page i {
      transform: rotate(90deg);
    }

    & .first-page i,
    .last-page i {
      mask-image: url("../../img/arrow_chevron_small_right_24px.svg");

      @media (max-width: 375px) {
        display: none !important;
      }
    }

    & .first-page i {
      transform: rotate(180deg);
    }

    & .next-page,
    .prev-page,
    .first-page,
    .last-page {
      & i {
        display: block;
        width: 1.5rem;
        height: 1.5rem;
        mask-size: contain;
        background-color: #666666;
      }

      &.disabled i {
        background-color: #cccccc;
      }

      &:hover:not(.disabled) i {
        background: linear-gradient(
          180deg,
          #8039e5 0%,
          #b939e5 50%,
          #e539bd 100%
        );
      }
    }
  }
}