.carousel {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--dark-background);
  margin-bottom: 60px;
}

.carousel-container {
  position: relative;
  height: 120%;
  width: 100%;
}

.item_first {
  background-image: url('./pics/about/10.JPG');
  background-repeat: no-repeat;
  background-size: cover;
  filter: brightness(80%); /* Уменьшаем яркость изображения для лучшей читаемости текста */
}

.item_second {
  background-image: url('./pics/about/10-2.JPG');
  background-repeat: no-repeat;
  background-size: cover;
  filter: brightness(80%); /* Уменьшаем яркость изображения */
}

.item_third {
  background-image: url('./pics/about/materials.JPG');
  background-repeat: no-repeat;
  background-size: cover;
  filter: brightness(80%); /* Уменьшаем яркость изображения */
}

.item_fourth {
  background-image: url('./pics/about/lotok.JPG');
  background-repeat: no-repeat;
  background-size: cover;
  filter: brightness(80%); /* Уменьшаем яркость изображения */
}

.item_five {
  background-image: url('./pics/about/load.JPG');
  background-repeat: no-repeat;
  background-size: cover;
  filter: brightness(80%); /* Уменьшаем яркость изображения */
}

.item_six {
  background-image: url('./pics/about/lotki2.JPG');
  background-repeat: no-repeat;
  background-size: cover;
  filter: brightness(80%); /* Уменьшаем яркость изображения */
}

.item_seven {
  background-image: url('./pics/about/stock.JPG');
  background-repeat: no-repeat;
  background-size: cover;
  filter: brightness(80%); /* Уменьшаем яркость изображения */
}

.item_eight {
  background-image: url('./pics/about/baza.JPG');
  background-repeat: no-repeat;
  background-size: cover;
  filter: brightness(80%); /* Уменьшаем яркость изображения */
}

.carousel-item {
  position: absolute;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: white;
  text-align: center;
  opacity: 0;
  padding-top: 390px;
  transition: opacity 0.8s ease;
  visibility: hidden;
}

.carousel-item.active {
  opacity: 1;
  visibility: visible;
}

.carousel-item.prev {
  transform: translateX(-100%);
  opacity: 0;
}

.carousel-item-title {
  margin-bottom: 30px;
  font-size: 48px;
  font-weight: 700;
  font-family: var(--primary-font-family);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-item.animate .carousel-item-title {
  animation: fadeIn 1s ease-out;
}

.carousel-item.animate .carousel-item-description {
  animation: fadeUp 1s ease-out;
  animation-delay: 0.5s;
  animation-fill-mode: both;
}

.carousel-item.animate .carousel-item-button {
  animation: fadeUp 1s ease-out;
  animation-delay: 1s;
  animation-fill-mode: both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.carousel-item-description {
  max-width: 65%;
  margin: 0 auto 30px auto;
  font-family: var(--default-font-family);
  line-height: 24px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  background-color: rgba(0, 0, 0, 0.3);
  padding: 10px 15px;
  border-radius: 8px;
}

.carousel-item.active .carousel-item-description {
  opacity: 1;
  transform: translateY(0);
}

.carousel-item-button {
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 1px;
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  transition: 0.5s;
  line-height: 1;
  margin: 10px;
  animation-delay: 0.8s;
  color: #fff;
  border: 2px solid var(--brand);
  font-family: var(--default-font-family);
  z-index: 1;
  cursor: pointer;
  user-select: none;
}

.carousel-item-button:hover {
  background-color: var(--brand);
}

.carousel-prev-button {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 40%;
  left: 20px;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 5;
  padding: 0;
}

.carousel-next-button {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 40%;
  right: 20px;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 5;
  padding: 0;
}

.carousel-prev-button svg,
.carousel-next-button svg {
  width: 24px;
  height: 24px;
}

.carousel-button-path {
  stroke: white;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.carousel-prev-button:hover, 
.carousel-next-button:hover {
  background-color: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.carousel-prev-button:active, 
.carousel-next-button:active {
  transform: scale(0.95);
}

.hero-waves {
  display: block;
  width: 100%;
  height: 45px;
  position: absolute;
  bottom: -1px;
  z-index: 5;
}

.wave1 use {
  animation: move-forever1 10s linear infinite;
  animation-delay: -2s;
  fill: rgba(255, 255, 255, 0.3);
}

.wave2 use {
  animation: move-forever2 8s linear infinite;
  animation-delay: -2s;
  fill: rgba(255, 255, 255, 0.5);
}

.wave3 use {
  animation: move-forever3 6s linear infinite;
  animation-delay: -2s;
  fill: white;
}

@keyframes move-forever1 {
  0% {
    transform: translate(85px, 0%);
  }

  100% {
    transform: translate(-90px, 0%);
  }
}

@keyframes move-forever2 {
  0% {
    transform: translate(-90px, 0%);
  }

  100% {
    transform: translate(85px, 0%);
  }
}

@keyframes move-forever3 {
  0% {
    transform: translate(-90px, 0%);
  }

  100% {
    transform: translate(85px, 0%);
  }
}

/* Добавляем возможность свайпа для мобильных устройств */
.carousel-touch-area {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: pan-y;
}

@media (max-width: 1200px) {
  .carousel {
    height: 100vh;
    margin-bottom: 60px;
  }

  .carousel-container {
    margin: 0;
  }

  .carousel-item {
    padding: 0;
  }

  .carousel-item-title {
    font-size: 28px;
  }

  .carousel-prev-button,
  .carousel-next-button {
    width: 35px;
    height: 35px;
  }

  .carousel-prev-button svg,
  .carousel-next-button svg {
    width: 20px;
    height: 20px;
  }
}

/* Медиа-запросы для планшетов */
@media (max-width: 768px) {
  .carousel {
    height: 70vh;
    margin-bottom: 40px;
  }

  .carousel-item {
    padding-top: 280px;
    overflow-y: auto; /* Добавляем вертикальный скролл */
    -webkit-overflow-scrolling: touch; /* Для плавного скролла на iOS */
  }

  .carousel-item-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding: 0 15px;
  }

  .carousel-item-description {
    max-width: 85%;
    font-size: 14px;
    padding: 12px;
  }

  .carousel-prev-button,
  .carousel-next-button {
    width: 32px;
    height: 32px;
    top: 35%;
  }
  
  .carousel-prev-button svg,
  .carousel-next-button svg {
    width: 18px;
    height: 18px;
  }
  
  .carousel-button-path {
    stroke-width: 2.5;
  }
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 480px) {
  .carousel {
    height: 60vh;
    margin-bottom: 40px;
  }

  .carousel-item {
    padding-top: 160px;
    overflow-y: auto; /* Добавляем вертикальный скролл */
    -webkit-overflow-scrolling: touch; /* Для плавного скролла на iOS */
  }

  .carousel-item-title {
    font-size: 18px;
    margin-bottom: 10px;
    padding: 0 10px;
  }

  .carousel-item-description {
    max-width: 90%;
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 10px;
    padding: 8px;
  }

  .carousel-prev-button,
  .carousel-next-button {
    width: 28px;
    height: 28px;
    top: 25%;
  }
  
  .carousel-prev-button svg,
  .carousel-next-button svg {
    width: 14px;
    height: 14px;
  }
  
  .carousel-button-path {
    stroke-width: 2;
  }

  .hero-waves {
    height: 25px;
    bottom: -1px;
  }

  .item_second,
  .item_third,
  .item_fourth {
    background-position: 70% center;
  }

  .item_first,
  .item_five,
  .item_six,
  .item_seven,
  .item_eight {
    background-position: 40% center;
  }
}
