/* Общие стили */
.reviews-section {
    padding: 6rem 0;
    background-color: #fafafa;
}

.reviews-header {
    text-align: center;
    margin-bottom: 3rem;
}

.reviews-section .section-title {
    font-size: 2.5rem;
    color: #056486 !important;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #161717!important;
    max-width: 700px;
    margin: 0 auto;
}

.section-subtitle p {
    color: #f7fbfb!important;
}

.reviews-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    min-width: 140px;
    padding: 1.5rem 1rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.stat-stars {
    font-size: 1.5rem;
    color: #f39c12;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Карусель отзывов */
.reviews-carousel-wrapper {
    position: relative;
    max-width: 1100px;
    margin: 0 auto 3rem;
    padding: 0 3rem;
    width: 100%;
    box-sizing: border-box;
}

.reviews-carousel {
    overflow: hidden;
    position: relative;
}

.reviews-carousel-track {
    --items-per-view: 3;
    --carousel-gap: 1.5rem;
    display: flex;
    gap: var(--carousel-gap);
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.reviews-carousel-track .review-card {
    flex: 0 0 calc(
        (100% - (var(--items-per-view) - 1) * var(--carousel-gap))
        / var(--items-per-view)
    );
    margin: 0;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #056486;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: #056486;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: #056486;
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(5, 100, 134, 0.3);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn-prev {
    left: 0;
}

.carousel-btn-next {
    right: 0;
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #056486;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-indicator:hover {
    background: rgba(5, 100, 134, 0.3);
    transform: scale(1.2);
}

.carousel-indicator.active {
    background: #056486;
    transform: scale(1.3);
}

.review-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
    min-height: auto;
    overflow: visible;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
    overflow: visible;
}

.reviewer-avatar {
    width: 60px;
    height: 60px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.reviewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.reviewer-avatar .avatar-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #3498db;
    color: white;
}

.reviewer-info {
    flex-grow: 1;
    min-width: 0;
    flex: 1 1 auto;
}

.reviewer-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.3rem 0;
}

.review-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #056486;
    margin: 0 0 0.3rem 0;
    font-style: italic;
}

.review-date {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0.2rem 0 0 0;
}

.review-rating {
    font-size: 1.5rem;
    color: #f39c12;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    line-height: 1;
}

.review-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #34495e;
    margin: 0;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    overflow: visible;
}

.no-reviews {
    grid-column: 1 / -1;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 2rem;
}

.reviews-actions {
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.reviews-section .btn-outline,
.reviews-actions .btn-outline {
    background-color: #f8f9fa !important;
    color: #056486 !important;
    border: 2px solid #056486 !important;
}

.reviews-section .btn-outline:hover,
.reviews-actions .btn-outline:hover {
    background-color: #056486 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 100, 134, 0.3);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    color: #2c3e50;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #95a5a6;
    padding: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background-color: #f5f5f5;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
    color: #2c3e50;
    background-color: #fff;
    font-family: inherit;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #95a5a6;
    opacity: 1;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    color: #2c3e50;
    background-color: #fff;
}

.rating-stars {
    display: flex;
    gap: 0.2rem;
    margin: 0.5rem 0;
}

.rating-stars .star {
    font-size: 2rem;
    cursor: pointer;
    color: #f39c12;
    transition: opacity 0.3s ease, transform 0.2s ease;
    user-select: none;
    opacity: 0.3;
}

.rating-stars .star:hover {
    opacity: 1;
    transform: scale(1.1);
}

.rating-stars .star.active {
    opacity: 1;
}

.rating-hint {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

.review-note {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 1.5rem;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .reviews-section {
        padding: 3rem 1rem;
    }

    .reviews-section .section-title {
        font-size: 1.8rem;
        color: #056486 !important;
        margin-bottom: 0.5rem;
    }

    .section-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .reviews-stats {
        gap: 0.75rem;
        margin-bottom: 2.5rem;
    }

    .stat-item {
        min-width: 100px;
        padding: 1rem 0.75rem;
        flex: 1 1 calc(33.333% - 0.5rem);
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-stars {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        max-width: calc(100% - 2rem);
    }
    
    .reviews-carousel-wrapper {
        padding: 0 2.5rem;
        margin-bottom: 2rem;
    }
    
    .reviews-carousel-track {
        --items-per-view: 1;
        --carousel-gap: 1rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-btn svg {
        width: 20px;
        height: 20px;
    }

    .review-card {
        padding: 1.25rem;
        border-radius: 12px;
        overflow: visible;
        word-wrap: break-word;
        overflow-wrap: break-word;
        margin: 0 auto;
        max-width: 100%;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .review-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
        align-items: flex-start;
    }

    .reviewer-avatar {
        width: 50px;
        height: 50px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .reviewer-info {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 60px);
    }

    .reviewer-name {
        font-size: 1rem;
        margin-bottom: 0.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .review-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .review-date {
        font-size: 0.85rem;
        display: block;
    }

    .review-rating {
        font-size: 1.1rem;
        width: 100%;
        margin-top: 0.5rem;
        flex-shrink: 0;
        white-space: nowrap;
        overflow: visible;
        max-width: 100%;
        text-align: left;
    }

    .review-text {
        font-size: 0.95rem;
        line-height: 1.7;
        word-wrap: break-word;
        overflow-wrap: break-word;
        overflow: visible;
        margin-top: 0.75rem;
    }

    .reviews-actions {
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .reviews-actions .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        flex: 1 1 auto;
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .reviews-section {
        padding: 2.5rem 0.75rem;
    }

    .reviews-section .section-title {
        font-size: 1.6rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }

    .reviews-stats {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .stat-item {
        min-width: 90px;
        padding: 0.875rem 0.5rem;
        flex: 1 1 calc(33.333% - 0.33rem);
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-stars {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
    
    .reviews-carousel-wrapper {
        padding: 0 2rem;
        margin-bottom: 1.5rem;
    }
    
    .reviews-carousel-track {
        --items-per-view: 1;
        --carousel-gap: 0.75rem;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .carousel-btn svg {
        width: 16px;
        height: 16px;
    }

    .carousel-btn-prev {
        left: -0.5rem;
    }

    .carousel-btn-next {
        right: -0.5rem;
    }
    
    .review-card {
        padding: 1rem;
        border-radius: 12px;
        overflow: visible;
        word-wrap: break-word;
        overflow-wrap: break-word;
        margin: 0 auto;
        max-width: 100%;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .review-header {
        gap: 0.75rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    
    .reviewer-avatar {
        width: 48px;
        height: 48px;
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .reviewer-info {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 60px);
    }

    .reviewer-name {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.3;
    }

    .review-title {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.3;
    }

    .review-date {
        font-size: 0.8rem;
        display: block;
        margin-top: 0.25rem;
    }

    .review-rating {
        font-size: 1rem;
        width: 100%;
        margin-top: 0.5rem;
        flex-shrink: 0;
        white-space: nowrap;
        overflow: visible;
        max-width: 100%;
        text-align: left;
        line-height: 1.2;
    }

    .review-text {
        font-size: 0.9rem;
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
        overflow: visible;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .carousel-indicators {
        margin-top: 1.5rem;
        gap: 0.4rem;
    }

    .carousel-indicator {
        width: 10px;
        height: 10px;
    }

    .reviews-actions {
        flex-direction: column;
        gap: 0.625rem;
        margin-top: 1.5rem;
    }

    .reviews-actions .btn {
        width: 100%;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }

    .modal-content {
        margin: 0.75rem;
        padding: 1.25rem;
        border-radius: 16px;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    .rating-stars .star {
        font-size: 1.75rem;
    }
}

/* Дополнительные улучшения для очень маленьких экранов */
@media (max-width: 360px) {
    .reviews-section {
        padding: 2rem 0.5rem;
    }

    .reviews-section .section-title {
        font-size: 1.4rem;
    }

    .stat-item {
        min-width: 80px;
        padding: 0.75rem 0.4rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .reviews-carousel-wrapper {
        padding: 0 1.5rem;
    }

    .carousel-btn {
        width: 32px;
        height: 32px;
    }

    .carousel-btn svg {
        width: 14px;
        height: 14px;
    }

    .review-card {
        padding: 0.875rem;
        overflow: visible;
        word-wrap: break-word;
        overflow-wrap: break-word;
        border-radius: 10px;
    }

    .review-header {
        gap: 0.625rem;
        margin-bottom: 0.875rem;
    }

    .reviewer-avatar {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }

    .reviewer-info {
        max-width: calc(100% - 55px);
    }

    .reviewer-name {
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .review-title {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .review-date {
        font-size: 0.75rem;
    }

    .review-rating {
        font-size: 0.95rem;
    }

    .review-text {
        font-size: 0.85rem;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
        overflow: visible;
        margin-top: 0.625rem;
        padding-top: 0.625rem;
    }
}