.thumb-gallery {
  position: relative;
  user-select: none;

  &__next-btn,
  &__prev-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    background: rgba($black, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    color: $white;
    font-size: 18px;
    cursor: pointer;
  }

  &__next-btn {
    right: 16px;
  }

  &__prev-btn {
    left: 16px;
  }

  .swiper-container-main {
    aspect-ratio: 16 / 9;
  }

  .swiper-slide-main,
  .swiper-slide-thumbs {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    width: 100%;
    height: 100%;
  }

  .swiper-container-thumbs {
    margin-top: 16px;
    padding: 0 16px;

    &__next-btn,
    &__prev-btn {
      position: absolute;
      top: 0;
      width: 24px;
      height: 100%;
      z-index: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      color: $blue;
      font-size: 12px;
      cursor: pointer;

      svg {
        position: relative;
        z-index: 1;
        width: 24px;
        height: 24px;
      }
    }

    &__next-btn {
      right: 16px;

      &::before {
        content: '';
        position: absolute;
        top: 0;
        right: -16px;
        bottom: 0;
        width: 71px;
        background: linear-gradient(270deg, $white 37%, transparent 100%);
        pointer-events: none;
      }
    }

    &__prev-btn {
      left: 16px;

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: -16px;
        bottom: 0;
        width: 71px;
        background: linear-gradient(90deg, $white 37%, transparent 100%);
        pointer-events: none;
      }
    }

    .swiper-true-active {
      position: relative;
      pointer-events: none;

      &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba($white, 0.6);
        border: 2px solid $blue;
      }
    }

    .thumb-gallery__slide-wrapper {
      max-width: 105px;
    }
  }

  .swiper-slide-thumbs {
    cursor: pointer;
  }
}

.thumb-gallery[data-length='1'] {
  .thumb-gallery__next-btn,
  .thumb-gallery__prev-btn,
  .swiper-container-thumbs,
  .swiper-pagination {
    display: none;
  }
}

@include media-breakpoint-up(sm) {
  .thumb-gallery {
    .swiper-container-thumbs {
      padding: 0;

      &__next-btn {
        right: 0;

        &::before {
          right: 0;
          background: linear-gradient(270deg, $white 25%, transparent 100%);
        }
      }

      &__prev-btn {
        left: 0;

        &::before {
          left: 0;
          background: linear-gradient(90deg, $white 25%, transparent 100%);
        }
      }
    }
  }
}

@include media-breakpoint-up(lg) {
  .thumb-gallery {
    &__next-btn,
    &__prev-btn {
      width: 40px;
      height: 40px;
    }

    .swiper-container-thumbs {
      &__next-btn,
      &__prev-btn {
        width: 48px;

        svg {
          width: 38px;
          height: 38px;
        }
      }

      &__next-btn {
        &::before {
          background: linear-gradient(270deg, $white 25%, rgba(255, 255, 255, 0) 100%);
        }
      }

      &__prev-btn {
        &::before {
          background: linear-gradient(90deg, $white 25%, rgba(255, 255, 255, 0) 100%);
        }
      }
    }
  }
}
