.carousel-3d-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
  width: 100vw;
  background-color: rgb(39, 30, 20);
  /* Анимация появления */
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.carousel-title {
  margin-bottom: 60px;
  text-align: center;
  color: rgb(232, 225, 219);
  /* Плавное появление */
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.2s forwards;
}

.carousel-scene {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 400px;
  perspective: 1000px;
  margin: 0 auto;
  transition: all 0.5s ease;
}

.carousel {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.carousel__card {
  position: absolute;
  width: 250px;
  height: 350px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-style: preserve-3d;
  will-change: transform;
}

.card__content {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card__front, .card__back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgb(27, 25, 26);
  transition: all 0.4s ease;
}

.card__front {
  transform: rotateY(0deg);
}

.card__back {
  transform: rotateY(180deg);
  overflow-y: auto;
  color: rgb(232, 225, 219);
}

.card__front:hover {
  transform: rotateY(0deg) scale(1.02);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.carousel__card img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  filter: grayscale(20%);
}

.carousel__card:hover img {
  filter: grayscale(0%);
  transform: scale(1.05);
}

.carousel__card h3 {
  margin: 10px 0;
  font-size: 2rem;
  color: rgb(232, 225, 219);
  transition: all 0.3s ease;
}

.carousel__card p {
  text-align: center;
  margin: 5px 0;
  font-size: 1.5rem;
  color: rgb(232, 225, 219);
  transition: all 0.3s ease;
}

.action-hint {
  margin-top: 15px;
  font-size: 0.9rem;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.4s forwards;
}

.carousel__nav {
  display: flex;
  gap: 40px;
  margin-top: 60px;
  margin-bottom: 60px;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.6s forwards;
}

.carousel__prev, .carousel__next {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #333;
  color: rgb(232, 225, 219);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: scale(1);
}

.carousel__prev:hover, .carousel__next:hover {
  background: rgb(23, 93, 131);
  transform: scale(1.1);
}

.carousel__prev:active, .carousel__next:active {
  transform: scale(0.95);
}

.carousel__card.flipped .card__content {
  transform: rotateY(180deg) !important;
}

/* Мобильная версия */
@media (max-width: 768px) {
  .carousel__nav {
    margin-top: 15px;
  }

  .carousel-3d-container {
    gap: 15px;
  }

  .carousel-scene {
    height: 450px;
    perspective: none;
  }

  .carousel__prev:hover, .carousel__next:hover {
    background: #333;
    transform: scale(1);
  }

  .carousel__card {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    animation: cardFloat 2s ease-in-out infinite;
    display: none;
    transform: translate(-50%, -50%) scale(0.9);
  }

  .carousel__card.active {
    opacity: 1;
    display: block;
    transform: translate(-50%, -50%) scale(1);
    transition-delay: 0.2s;
  }

  /* Плавная смена слайдов */
  .carousel__card.slide-out {
    animation: slideOut 0.5s ease forwards;
  }

  .carousel__card.slide-in {
    animation: slideIn 0.5s ease forwards;
  }

  @keyframes slideOut {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  }

  @keyframes slideIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }

  /* Индикаторы слайдов */
  .carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
  }

  .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(232, 225, 219, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .indicator.active {
    background: rgb(232, 225, 219);
    transform: scale(1.2);
  }
}

/* Дополнительные анимации */
@keyframes cardFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-10px); }
}
