html {
  scroll-behavior: smooth;
}

.category {
  scroll-margin-top: 120px;
}

.members-wrapper {
  margin-top: 3rem;

  padding: 0 3rem;
}

.members-wrapper > .wp-block-group__inner-container {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

@media screen and (max-width: 1024px) {
  .members-wrapper {
    padding: 0 2rem;
  }
}

@media screen and (max-width: 669px) {
  .members-wrapper {
    margin-top: 0;
    padding: 0;
  }
}

.categories {
  margin: 3.75rem 0;
  display: flex;
  flex-direction: row;
  width: 100%;
  justify-content: space-between;
  flex-wrap: wrap;

  box-sizing: border-box;
}

.categories__card {
  height: 230px;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  width: fit-content;
}

.categories__card img {
  height: 140px;
  width: 140px;
}

.categories__card h2 {
  width: max-content;
  max-width: 180px;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  color: #000000;
}

.categories__card h2 span {
  display: inline;
}

/* Горизонтальная прокрутка направлений на мобильных */
@media screen and (max-width: 768px) {
  .categories-wrapper {
    position: relative;
    width: 100%;
  }

  .categories {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 16px;
    padding-bottom: 15px;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
  }

  .categories::-webkit-scrollbar {
    display: none;
  }

  .categories > a {
    flex: 0 0 auto;
    text-decoration: none;
  }

  .categories__card {
    flex: 0 0 auto;
  }

  /* Стрелки прокрутки */
  .categories-arrow {
    position: absolute;
    top: 40%;
    z-index: 10;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 40px;
    height: 40px;
    padding: 0;

    border: none;
    border-radius: 50%;
    background: var(--secondary-color);

    opacity: 0.75;
    cursor: pointer;

    transform: translateY(-50%);
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
  }

  .categories-arrow svg {
    width: 24px;
    height: 24px;
    color: white;
  }

  .categories-arrow--right {
    right: 8px;
  }

  .categories-arrow--right svg {
    transform: rotate(90deg);
  }

  .categories-arrow--left {
    left: 8px;
  }

  .categories-arrow--left svg {
    transform: rotate(-90deg);
  }

  .categories-arrow.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* Стрелки скрыты на десктопе */
@media screen and (min-width: 769px) {
  .categories-arrow {
    display: none;
  }

  /* Анимация наведения на карточки */
  .categories > a {
    display: block;
    text-decoration: none;
  }

  .categories__card {
    transition: transform 0.35s ease;
  }

  .categories__card img {
    transition: transform 0.35s ease;
  }

  .categories > a:hover .categories__card {
    transform: translateY(-6px);
  }

  .categories > a:hover .categories__card img {
    transform: scale(1.05);
  }

  .categories > a:focus-visible .categories__card {
    outline: 2px solid var(--secondary-color);
    outline-offset: 4px;
  }
}

/* Плавный переход к секциям с учетом хедера */
html {
  scroll-behavior: smooth;
}

.category {
  scroll-margin-top: 120px;
}

@media screen and (max-width: 768px) {
  .category {
    scroll-margin-top: 90px;
  }
}

.categories-section {
  background: linear-gradient(180deg, #efefef 0%, #ffffff 100%);
  padding: 4rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: center;
}

.category {
  background: white;
  width: 80%;
  border-radius: 50px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

.category__title {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
}

.category__img {
  min-width: 200px;
  width: 30%;
  height: auto;
}

.category__title h2 {
  font-weight: 700;
  font-size: 40px;
  line-height: 51px;
  max-width: 70%;
}

.category__companies {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
}

.category__companies-logo {
  width: 30%;
}

@media screen and (max-width: 1024px) {
  .category {
    width: 100%;
  }

  .category__title h2 {
    font-size: 32px;
  }
}

@media screen and (max-width: 768px) {
  .category__title {
    flex-direction: column;
    gap: 0;
  }

  .category__img {
    min-width: 100px;
    max-width: 150px;
    width: 100%;
    height: auto;
  }

  .category__title h2 {
    font-size: 24px;
    line-height: 31px;
    max-width: 100%;
    text-align: center;
  }

  .categories-section {
    padding: 3rem 1rem;
  }
}

@media screen and (max-width: 768px) {
  .categories-section {
    padding: 3rem 0;
  }

  .category__companies-logo {
    width: 50%;
  }
}
