.reviews-section {
    padding: 80px 0;
    position: relative;
    /* keep the heading clear of the fixed navbar on /#reviews */
    scroll-margin-top: 110px;
}

.reviews-section .section-header {
    margin-bottom: 20px;
}

.reviews-section .section-header h2 {
    color: #2C2C2C;
}

.reviews-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 38px;
    padding: 0 20px;
}

.reviews-rating {
    font-family: "Barlow Condensed", serif;
    font-size: 44px;
    font-weight: 500;
    line-height: 1;
    color: #2C2C2C;
}

.reviews-stars {
    color: var(--primary);
    letter-spacing: 2px;
    font-size: 16px;
    line-height: 1;
}

.reviews-summary .reviews-stars {
    font-size: 24px;
}

.reviews-count {
    color: var(--text-light);
    font-size: 16px;
}

/* Carousel: two rows of cards, scrolled horizontally by arrows or swipe */
.reviews-carousel {
    position: relative;
    padding: 0 70px;
}

.reviews-track {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 60px) / 3);
    gap: 30px;
    padding: 12px 10px 34px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 10px;
    scrollbar-width: none;
}

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

.reviews-track:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.reviews-arrow {
    position: absolute;
    top: calc(50% - 11px);
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    border: 1px solid var(--primary);
    border-radius: 50%;
    color: #85528b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reviews-arrow-prev {
    left: 14px;
}

.reviews-arrow-next {
    right: 14px;
}

.reviews-arrow:hover:not(:disabled) {
    background-color: #85528b;
    border-color: #85528b;
    color: var(--white);
}

.reviews-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.review-card {
    min-width: 0;
    scroll-snap-align: start;
    background-color: var(--white);
    border-radius: 12px;
    border-top: 3px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.review-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.review-author {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.review-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.review-name {
    /* sans fallback for Cyrillic names: Barlow Condensed has no Cyrillic glyphs */
    font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: #85528b;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.review-text,
.review-translation-text {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.review-translation-note {
    display: block;
    margin-top: 8px;
    color: var(--text-light);
    font-size: 13px;
    font-style: italic;
}

/* Set by reviews.js; without JS the full text stays visible */
.review-text.is-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    overflow: hidden;
}

.review-text[hidden] {
    display: none;
}

.review-toggle,
.review-translate {
    align-self: flex-start;
    margin-top: 12px;
    padding: 0;
    background: none;
    border: none;
    border-bottom: 1px solid currentColor;
    color: #85528b;
    font-size: 15px;
    cursor: pointer;
}

.review-toggle:hover,
.review-translate:hover {
    color: var(--primary);
}

/* Google actions */
.reviews-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 20px;
    margin-top: 16px;
    padding: 0 20px;
}

.reviews-actions .btn {
    width: 225px;
    max-width: 100%;
    gap: 10px;
}

.reviews-actions .btn svg {
    flex-shrink: 0;
}

/* Full review: centered popup on desktop, bottom sheet on phones */
.reviews-dialog-open {
    overflow: hidden;
}

.review-dialog {
    margin: auto;
    width: min(560px, calc(100% - 40px));
    max-height: 85vh;
    overflow-y: auto;
    padding: 36px 32px 32px;
    background-color: var(--white);
    border: none;
    border-top: 3px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.review-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.55);
}

.review-dialog-body {
    display: flex;
    flex-direction: column;
}

.review-dialog-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.review-dialog-close:hover {
    color: #85528b;
}

@keyframes reviewSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 992px) {
    .reviews-carousel {
        padding: 0 60px;
    }

    .reviews-track {
        grid-auto-columns: calc((100% - 30px) / 2);
    }

    .reviews-arrow-prev {
        left: 8px;
    }

    .reviews-arrow-next {
        right: 8px;
    }
}

@media (max-width: 640px) {
    .reviews-section {
        padding: 60px 0;
    }

    .reviews-summary {
        margin-bottom: 22px;
    }

    .reviews-carousel {
        padding: 0;
    }

    .reviews-track {
        grid-template-rows: auto;
        grid-auto-columns: 84%;
        gap: 16px;
        padding: 10px 20px 30px;
        scroll-padding: 0 20px;
    }

    .reviews-arrow {
        display: none;
    }

    .review-card {
        padding: 22px;
    }

    .reviews-actions {
        margin-top: 10px;
    }

    .reviews-actions .btn {
        width: 100%;
        max-width: 350px;
    }

    .review-dialog {
        margin: auto 0 0;
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        padding: 40px 22px calc(28px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
        animation: reviewSheetUp 0.3s ease;
    }
}
