/* ==========================================================================
   1. ОСНОВНАЯ ОБЕРТКА И ФОН (БЕЛЫЕ ЗВЕЗДЫ ★)
   ========================================================================== */
.reviews-wrapper {
  position: relative;
  overflow: hidden;
  background: #f0f9f8;
  
  /* Финальные отступы: заголовок теперь внутри и выровнен по левому краю */
  padding: 50px 40px 60px 40px; 
  
  border-radius: 16px;
  max-width: 1240px;
  margin: 0 auto;
  z-index: 1;
}

/* Анимированный слой с белыми SVG-звездами */
.reviews-wrapper::before {
  content: "";
  position: absolute;
  top: -250%; left: -250%; width: 500%; height: 500%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cpath fill='%23ffffff' d='M20 5l4.5 9h9.5l-7.5 6 3 9.5-8.5-6-8.5 6 3-9.5-7.5-6h9.5z' /%3E%3Cpath fill='%23ffffff' d='M90 60l4.5 9h9.5l-7.5 6 3 9.5-8.5-6-8.5 6 3-9.5-7.5-6h9.5z' /%3E%3Cpath fill='%23ffffff' d='M40 110l4.5 9h9.5l-7.5 6 3 9.5-8.5-6-8.5 6 3-9.5-7.5-6h9.5z' /%3E%3C/svg%3E");
  background-size: 150px 150px; 
  opacity: 0.5;
  animation: starsFalling 25s linear infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes starsFalling {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-450px, 450px); }
}

/* ==========================================================================
   2. ЗАГОЛОВОК И СЛАЙДЕР
   ========================================================================== */
.reviews-title {
  position: relative;
  z-index: 10;
  
  /* Выравнивание по левому краю (без auto) */
  margin: 0 0 30px 0; 
  
  font-size: 32px;
  font-weight: 700;
  color: #2c3e50;
  text-transform: uppercase;
  text-align: left; 
}

.reviews-slider {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  
  /* Убрали лишний отступ слева, так как его задает wrapper */
  scroll-padding-left: 0; 
  
  /* Боковые отступы минимальны, снизу место для теней */
  padding: 10px 10px 35px 10px; 
  
  scrollbar-width: none;
  position: relative;
  z-index: 10;
}

.reviews-slider::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   3. КАРТОЧКА ОТЗЫВА (3 КОЛОНКИ)
   ========================================================================== */
.review-card {
  min-width: calc((100% - 48px) / 3); 
  flex: 0 0 calc((100% - 48px) / 3);
  
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  
  /* Тень оптимизирована под отступы */
  box-shadow: 0 5px 15px rgba(63, 168, 163, 0.1); 
  
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  height: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(63, 168, 163, 0.15);
}

.review-header {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  min-height: 54px;
}

.avatar {
  width: 54px;
  height: 54px;
  background: #e6f3f2;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.name {
  font-weight: 700;
  font-size: 16px;
  color: #2c3e50;
  line-height: 1.2;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date {
  font-size: 13px;
  color: #95a5a6;
}

.stars {
  color: #ffc107;
  font-size: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   4. ТЕКСТ, КНОПКА И ИСТОЧНИК
   ========================================================================== */
.review-body {
  flex-grow: 1;
  margin-bottom: 20px;
}

.review-text {
  font-size: 15px;
  line-height: 1.6;
  color: #4a5a5a;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.review-text.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  max-height: 120px;
}

.read-more-btn {
  background: none;
  border: none;
  color: #3fa8a3;
  padding: 0;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.source {
  padding-top: 15px;
  border-top: 1px dashed #e0e0e0;
  margin-top: auto;
}

.source a {
  color: #3fa8a3;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* ==========================================================================
   5. ТОЧКИ ПАГИНАЦИИ
   ========================================================================== */
.reviews-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px; 
  position: relative;
  z-index: 10;
}

.dot {
  width: 8px;
  height: 8px;
  background: #cfeceb;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: #3fa8a3;
  width: 20px;
  border-radius: 10px;
}

/* ==========================================================================
   6. АДАПТИВНОСТЬ
   ========================================================================== */
@media (max-width: 1024px) {
  .review-card {
    min-width: calc((100% - 24px) / 2);
    flex: 0 0 calc((100% - 24px) / 2);
  }
}

@media (max-width: 768px) {
  /* 1. Возвращаем радиус внешнему окну и уменьшаем боковые отступы */
  .reviews-wrapper {
    padding: 30px 10px !important; 
    border-radius: 12px !important; 
  }

  /* 2. Настраиваем слайдер */
  .reviews-slider {
    gap: 12px !important;
    padding: 10px 20px 40px 20px !important; 
    scroll-padding: 0 20px; 
    
    scrollbar-width: none !important; 
    -ms-overflow-style: none !important; 
  }
  
  .reviews-slider::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* 3. Корректируем карточку */
  .review-card {
    min-width: 82vw !important;
    flex: 0 0 82vw !important;
    padding: 20px !important;
    scroll-snap-align: center !important; 
    
    box-shadow: 0 4px 12px rgba(63, 168, 163, 0.08) !important;
  }

  /* Центрируем заголовок на мобильных */
  .reviews-title {
    font-size: 24px !important;
    margin-bottom: 20px !important;
    margin-left: 20px !important;
    text-align: left !important; /* На мобильном лучше по центру */
  }
  
  .review-header {
    grid-template-columns: 48px 1fr !important;
    gap: 10px !important;
  }
  .avatar { width: 48px; height: 48px; }
  .name { font-size: 15px; }
  .stars { font-size: 12px; }
  
  /* Ограничиваем количество точек */
  .reviews-dots .dot:nth-child(n+6) {
      display: none !important;
  }
  
  .reviews-dots {
      flex-wrap: nowrap !important;
      justify-content: center !important;
      margin-top: 15px !important;
  }
}
/* ==================================================================
   ФИКС: СКРЫВАЕМ ФОНОВЫЕ ЗВЕЗДЫ ПРИ ОТКРЫТОЙ ФОРМЕ
   ================================================================== */

/* Когда к body добавляется класс .modal-open (открыта форма) */
body.modal-open .reviews-wrapper::before {
    opacity: 0 !important;         /* Делаем звезды прозрачными */
    visibility: hidden !important; /* Скрываем их */
    animation: none !important;    /* Останавливаем анимацию, чтобы не грузила ЦП */
    display: none !important;      /* Полностью убираем из потока */
}