#categories {
  scroll-margin-top: 3.5rem; /* высота твоего header */
}

.categories {
  padding: 2rem 1rem 3rem;
  background-color: #1f1f1f; /* тёмный фон */
  color: #fff;
}

.categories__title {
  text-align: center;
  margin-bottom: 2rem;
}

.categories__title h2,
.categories__title h3 {
  color: #fff;
}

.categories__title h3 {
  margin-top: 0.5rem;
  font-weight: normal;
}

.categories__list {
  display: flex;
  justify-content: center;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  scrollbar-width: none;
}

.categories__list::-webkit-scrollbar {
  display: none;
}

.categories__item {
  flex: 0 0 19%; /* уменьшенный размер на ПК */
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  scroll-snap-align: start;
  border-radius: 1rem;
  overflow: hidden;
}


/* Виньетка */
.categories__item-transport {
  position: relative;
}
.categories__item-transport::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* чтобы клики проходили через виньетку */
  background: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0));
  border-radius: 1rem; /* совпадает с border-radius карточки */
  z-index: 1;
}


.categories__item-garten {
  position: relative;
}
.categories__item-garten::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* чтобы клики проходили через виньетку */
  background: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0));
  border-radius: 1rem; /* совпадает с border-radius карточки */
  z-index: 1;
}


.categories__item-personal {
  position: relative;
}
.categories__item-personal::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* чтобы клики проходили через виньетку */
  background: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0));
  border-radius: 1rem; /* совпадает с border-radius карточки */
  z-index: 1;
}

.categories__item-reinigung {
  position: relative;
}
.categories__item-reinigung::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* чтобы клики проходили через виньетку */
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  border-radius: 1rem; /* совпадает с border-radius карточки */
  z-index: 1;
}
/* End Виньетка */


.categories__item img {
  width: 100%;
  display: block;
  border-radius: 1rem;
}

/* текст на картинке */
.categories__content {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
  color: #fff;
  display: flex;
  justify-content: center;
  text-align: center;
  z-index: 3;
}

.categories__content span {
  display: flex;
  flex-direction: column; 
}

.categories__content span h2 {
  margin: 0;
  font-size: 1.5rem;
}

.categories__content span h4 {
  margin: 0 0.2rem;
  font-size: 1.15rem;
  display: inline-block;
}

.categories__item:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* === Адаптив === */
@media (max-width: 1366px) {
  .categories__item {
    flex: 0 0 22%;
  }
}

@media (max-width: 1024px) {
  .categories__list {
    justify-content: start;
  }

  .categories__item {
    flex: 0 0 70%; /* как на телефоне */
  }

  .categories__item-transport::after {
    background: linear-gradient(to top, rgba(0,0,0,0.4), rgba(0,0,0,0));
  }
  .categories__item-garten::after {
    background: linear-gradient(to top, rgba(0,0,0,0.3), rgba(0,0,0,0));
  }
  .categories__item-personal::after {
    background: linear-gradient(to top, rgba(0,0,0,0.3), rgba(0,0,0,0));
  }
  .categories__item-reinigung::after {
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  }
}

@media (max-width: 768px) {
  .categories__item {
    flex: 0 0 70%;
  }
}

@media (max-width: 480px) {
  .categories__item {
    flex: 0 0 70%;
  }
}
