/* ==========================================================
   ПОЛНЫЙ КОД СТИЛЕЙ ДЛЯ БЛОКА ОТЗЫВОВ (testimonials.css)
   ========================================================== */

/* 1. ОБЩИЕ СТИЛИ СЕКЦИИ */
.testimonials {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.testimonials h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: clamp(1.75rem, 5vw, 2.5rem); /* Адаптивный размер шрифта */
    color: #2c3e50;
}

/* 2. ГЛАВНЫЙ КОНТЕЙНЕР СЛАЙДЕРА */
.testimonial-slider {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 3. ПРОКРУЧИВАЕМАЯ ОБЛАСТЬ */
.testimonial-slider__container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    padding: 15px 0;
    scrollbar-width: none; /* Скрыть скроллбар */
    cursor: grab;
}
.testimonial-slider__container::-webkit-scrollbar { display: none; }
.testimonial-slider__container.dragging { cursor: grabbing; scroll-snap-type: none; }


/* 4. КАРТОЧКА ОТЗЫВА (КЛЮЧЕВОЕ ИЗМЕНЕНИЕ ДЛЯ ВЫРАВНИВАНИЯ) */
.testimonial-slider__item {
    flex: 0 0 90%; /* Ширина одного слайда на мобильных */
    scroll-snap-align: center; /* Центрирование слайда */
}

.testimonial-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column; /* Главная ось - вертикальная */
}

.testimonial-card__header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.testimonial-card__avatar {
    width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
    margin-right: 15px; flex-shrink: 0;
}
.testimonial-card__profile { display: flex; flex-direction: column; }
.testimonial-card__author { font-weight: 600; color: #2c3e50; }
.testimonial-card__rating { font-size: 0.9rem; color: #f39c12; }
.testimonial-card__date { font-size: 0.8rem; color: #7f8c8d; margin-top: 2px; }

/* Блок с текстом, который будет растягиваться */
.testimonial-card__body {
    flex-grow: 1; /* Заставляет этот блок занять всё доступное место */
    overflow: hidden;
    display: flex; /* Для видео */
    flex-direction: column; /* Для видео */
}

.testimonial-card__text {
    line-height: 1.6;
    color: #34495e;
    overflow: hidden;
    max-height: 150px; /* Ограничиваем высоту */
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    transition: max-height 0.4s ease-in-out;
}

.testimonial-card__text.expanded {
    max-height: 1000px; /* Раскрываем блок */
    mask-image: none;
    -webkit-mask-image: none;
}
.testimonial-card__text p { margin: 0; }

/* Футер, в котором будет кнопка */
.testimonial-card__footer {
    padding-top: 10px; /* Отступ сверху */
    margin-top: auto; /* Прижимает футер к низу карточки */
}

.testimonial-card__read-more {
    background: none; border: none; padding: 0;
    color: #3498db; cursor: pointer; font-size: 0.9rem; font-weight: 600;
}
.testimonial-card__read-more:hover { text-decoration: underline; }

/* 5. СТИЛИ ДЛЯ ВИДЕО */
.video-testimonial .testimonial-card__body { padding-top: 10px; }
.testimonial-video-container {
    position: relative; border-radius: 12px; overflow: hidden;
    background: #000; aspect-ratio: 16/9; margin-top: auto;
}
.testimonial-video { width: 100%; height: 100%; object-fit: cover; }
.video-play-button {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: none; border: none; padding: 0; cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.video-play-button:hover { transform: translate(-50%, -50%) scale(1.1); }
.testimonial-video-container.playing .video-play-button { opacity: 0; pointer-events: none; }


/* 6. ЭЛЕМЕНТЫ УПРАВЛЕНИЯ (СТРЕЛКИ И ТОЧКИ) */
.testimonial-slider__control {
    display: none; /* Скрываем стрелки на мобильных */
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 45px; height: 45px; border-radius: 50%; border: 1px solid #e0e0e0;
    background-color: rgba(255, 255, 255, 0.9); color: #34495e;
    cursor: pointer; transition: all 0.3s ease;
}
.testimonial-slider__control:hover { background-color: #3498db; color: #fff; }
.testimonial-slider__control_prev { left: -5px; }
.testimonial-slider__control_next { right: -5px; }

.testimonial-slider__indicators {
    display: flex; justify-content: center; margin-top: 25px; gap: 8px;
}
.testimonial-slider__indicator {
    width: 10px; height: 10px; border-radius: 50%; background-color: #ccc;
    border: none; padding: 0; cursor: pointer; transition: all 0.3s ease;
}
.testimonial-slider__indicator.active { background-color: #3498db; transform: scale(1.2); }

/* 7. АДАПТИВНОСТЬ (MEDIA QUERIES) */
@media (min-width: 768px) {
    .testimonial-slider__item { flex-basis: calc(50% - 10px); }
    .testimonial-slider { padding: 0 40px; }
    .testimonial-slider__control { display: flex; align-items: center; justify-content: center; }
}

@media (min-width: 1024px) {
    .testimonial-slider__item { flex-basis: calc(33.333% - 14px); }
}