/* Универсальное применение box-sizing для более предсказуемого макета */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Общие стили для секции */
.testimonials-section {
    padding: 80px 0;
    background-color: #ffffff;
    font-family: 'Open Sans', Arial, sans-serif;
    color: #333;
}

/* Контейнер для центрирования и ограничения ширины, как на Tilda */
.testimonials-section .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Заголовок секции */
.testimonials-section h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 60px;
    color: #333;
    position: relative;
    padding-bottom: 15px;
    font-family: 'Oswald', sans-serif; /* Заглавный шрифт Oswald */
}

/* Эффект подчеркивания для заголовка */
.testimonials-section h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #4CAF50;
    border-radius: 2px;
}

/* Оболочка для карусели - скрывает все, что выходит за рамки */
.testimonials-wrapper {
    overflow: hidden;
    position: relative;
    margin-bottom: 40px;
}

/* Контейнер, который будет двигаться */
.testimonials-container {
    display: flex;
    gap: 30px;
    transition: transform 0.6s ease-in-out;
    /* align-items: stretch; /* Это может помочь выровнять высоту карточек в текущей прокрутке, если нужно */
}

/* Стили для одной карточки отзыва */
.testimonial-card {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    flex: 0 0 calc(33.333% - 20px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* УДАЛЕНО: min-height: 280px; - теперь высота будет по содержимому */
    position: relative;
    overflow: visible; /* Убедимся, что ничего не скрывается */
}

/* УДАЛЕНО: Большая стилизованная кавычка как фон testimonial-card::before */


/* Звезды рейтинга */
.testimonial-rating {
    margin-bottom: 15px;
    color: #FFD700;
    font-size: 20px;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}
.testimonial-rating .star {
    margin-right: 2px;
    display: inline-block;
}

.testimonial-text {
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 25px;
    font-style: italic;
    color: #555;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.author-name {
    font-weight: 700;
    font-size: 18px;
    display: block;
    color: #333;
}

.author-title {
    font-size: 14px;
    color: #888;
    display: block;
    margin-top: 2px;
}

/* Навигация (стрелки) */
.carousel-navigation {
    text-align: center;
    margin-bottom: 30px;
}

.nav-button {
    background-color: #4CAF50;
    color: #fff;
    border: none;
    padding: 12px 18px;
    margin: 0 10px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    outline: none;
}

.nav-button:hover:not(:disabled) {
    background-color: #45a049;
    transform: translateY(-2px);
}

.nav-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Навигационные точки (dots) */
.carousel-dots {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.dot {
    height: 10px;
    width: 10px;
    margin: 0 6px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.dot.active {
    background-color: #4CAF50;
    transform: scale(1.2);
}

.dot:hover:not(.active) {
    background-color: #777;
}


/* Медиа-запросы для адаптивности */

/* Для планшетов (показываем 2 отзыва) */
@media (max-width: 992px) {
    .testimonial-card {
        flex: 0 0 calc(50% - 15px);
        /* УДАЛЕНО: min-height: 300px; */
    }
    .testimonials-section h2 {
        font-size: 32px;
        margin-bottom: 50px;
    }
    /* УДАЛЕНО: testimonial-card::before */
}

/* Для мобильных устройств (показываем 1 отзыв) */
@media (max-width: 768px) {
    .testimonials-section {
        padding: 60px 0;
    }
    .testimonials-section h2 {
        font-size: 28px;
        margin-bottom: 40px;
    }
    .testimonial-card {
        flex: 0 0 100%;
        height: auto; /* Явно устанавливаем auto для мобильных */
        padding: 25px;
    }
    /* УДАЛЕНО: testimonial-card::before */
    .testimonial-text {
        font-size: 16px;
    }
    .author-name {
        font-size: 17px;
    }
    .author-title {
        font-size: 13px;
    }
    .nav-button {
        padding: 10px 15px;
        font-size: 20px;
    }
}

/* Ещё меньше экраны */
@media (max-width: 480px) {
    .testimonials-section .container {
        padding: 0 15px;
    }
    .testimonials-container {
        gap: 20px;
    }
    .testimonial-card {
        padding: 20px;
    }
    .nav-button {
        margin: 0 5px;
    }
}



/* Стили для всплывающего окна (модального) */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Темный полупрозрачный фон */
    display: flex; /* Для центрирования контента */
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Очень высокий индекс, чтобы быть поверх всего */
    visibility: hidden; /* По умолчанию скрыто */
    opacity: 0; /* Для анимации появления */
    transition: visibility 0.3s, opacity 0.3s ease-in-out;
}

.modal-overlay.is-open {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px; /* Максимальная ширина для десктопов */
    position: relative;
    text-align: center;
    transform: translateY(20px); /* Для эффекта появления снизу */
    transition: transform 0.3s ease-out;
}

.modal-overlay.is-open .modal-content {
    transform: translateY(0);
}

.modal-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.modal-close-button:hover {
    color: #333;
}

.modal-header h3 {
    font-family: 'Oswald', sans-serif; /* Шрифт Oswald для заголовка попапа */
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.3;
}

.modal-body p {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
}

.modal-footer .cta-button {
    display: inline-block;
    background-color: #4CAF50; /* Зеленый акцентный цвет */
    color: #ffffff !important;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none; /* Если это будет тег  */
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.modal-footer .cta-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
        max-width: 90%;
    }
    .modal-header h3 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    .modal-body p {
        font-size: 16px;
        margin-bottom: 25px;
    }
    .modal-footer .cta-button {
        padding: 12px 25px;
        font-size: 16px;
    }
    .modal-close-button {
        font-size: 26px;
        top: 10px;
        right: 10px;
    }
}