.reviews {
    .reviews__header {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        column-gap: 24px;
        border-bottom: solid 1px var(--Gray-6, #9A9AA2);
        padding-bottom: 20px;
        
        

        .reviews__title {
            color: var(--Base-Dark, #171717);
            font-size: clamp(22px, 4vw, 40px);
            font-style: normal;
            font-weight: 500;
            line-height: 130%;
            letter-spacing: 0.8px;
        }

        .reviews__button {
            width: 100%;
            max-width: 400px;

            .button {
                width: 100%;
            }
        }
    }

    .reviews__body {
        padding-top: 20px;

        .reviews__bar {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            column-gap: 24px;

            .reviews__buttons {
                width: 100%;
                max-width: 400px;
                display: flex;
                flex-direction: column;
                row-gap: 16px;

                .button {
                    width: 100%;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;

                    &.review-add {
                        justify-content: center;
                    }

                    &:hover {
                        fill: #ffffff;
                    }

                    &.inactive {
                        opacity: .3;
                        pointer-events: none;
                    }
                }
            }
            
            .reviews__rating {
                display: flex;
                align-items: center;
                row-gap: 4px;
                column-gap: 8px;
                
                
                
                .reviews__rating-value {
                    color: var(--Dark-wine-2, #770E16);
                    font-size: clamp(56px, 4vw, 84px);
                    font-style: normal;
                    font-weight: 700;
                    line-height: 80%;
                    letter-spacing: 0.84px;
                }

                .reviews__rating-text {
                    color: var(--Gray-7, #7A7A85);
                    font-size: clamp(16px, 3vw, 20px);
                    font-style: normal;
                    font-weight: 400;
                    line-height: 150%;
                    letter-spacing: 0.2px;
                }

                .reviews__rating-stars {
                    display: inline-flex;
                    gap: 6px;
                    

                    .reviews__rating-star {
                        width: 24px;
                        aspect-ratio: 1/1;
                        position: relative;
                        background: url('../../icons/star.svg') center / contain no-repeat;
                        
                        
                        
                        

                        &:before {
                            content: "";
                            position: absolute;
                            inset: 0;
                            width: var(--star-fill);
                            background: url('../../icons/star-fill.svg') left center / auto 100% no-repeat;
                            overflow: hidden;
                        }
                    }
                }
            }
        }

        .reviews__items {
            display: flex;
            column-gap: 20px;
            overflow-x: auto;
            margin-top: 32px;
            cursor: grab;

            &.is-dragging {
                cursor: grabbing;
                user-select: none;
            }

            &::-webkit-scrollbar {
                height: 10px;
            }

            &::-webkit-scrollbar-track {
                background: transparent;
            }

            &::-webkit-scrollbar-thumb {
                background: rgb(69 8 13 / 25%);
                border-radius: 999px;
                border: 2px solid transparent;
                background-clip: content-box;
            }

            &::-webkit-scrollbar-thumb:hover {
                background: rgb(69 8 13 / 100%);
            }

            .reviews__item {
                border-radius: 20px;
                background-color: var(--Gray-1, #FAFAFA);
                padding: 20px 20px;
                width: 100%;
                min-width: 500px;
                flex: 1 0;

                .reviews__item-author {
                    display: grid;
                    grid-template-columns: auto 1fr;
                    row-gap: 4px;
                    column-gap: 16px;

                    .author__photo {
                        width: 64px;
                        height: 64px;
                        border-radius: 50%;
                        background-color: var(--Dark-wine-Main, #45080D);
                        color: #ffffff;
                        font-size: 26px;
                        font-style: normal;
                        font-weight: 500;
                        line-height: 130%;
                        letter-spacing: 0.8px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        grid-row: 1/3;
                        align-items: center;
                    }

                    .author__name {
                        color: var(--Base-Dark, #171717);
                        font-size: 16px;
                        font-style: normal;
                        font-weight: 500;
                        line-height: 140%;
                        letter-spacing: 0.16px;
                        align-self: flex-end;
                    }
                    
                    .author__rating {
                        align-self: flex-start;
                        display: flex;
                        align-items: center;
                        
                        .author__rating-stars {
                            display: inline-flex;
                            align-self: flex-end;
                            gap: 3px;

                            .author__rating-star {
                                width: 12px;
                                height: 12px;
                                position: relative;
                                background: url('../../icons/star-fill.svg') center / contain no-repeat;
                            }
                        }
                    }
                }

                .reviews__item-text {
                    color: var(--Base-Dark, #171717);
                    font-size: 16px;
                    font-style: normal;
                    font-weight: 400;
                    line-height: 140%;
                    letter-spacing: 0.16px;
                    margin-top: 24px;
                }

                .reviews__item-image {
                    max-width: 100px;
                    margin-top: 16px;

                    img {
                        border-radius: 12px;
                    }
                }

                .reviews__item-meta {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    column-gap: 24px;
                    margin-top: 24px;

                    .reviews__item-reaction {

                        .reaction {
                            display: flex;
                            align-items: center;
                            padding: 4px 10px;
                            background-color: #ffffff;
                            border-radius: 8px;
                            min-height: 38px;

                            .reaction__value {
                                color: var(--Gray-7, #7A7A85);
                                font-size: 16px;
                                font-style: normal;
                                font-weight: 400;
                                line-height: 140%;
                                letter-spacing: 0.16px;
                                filter: blur(0px);
                                transition: filter .3s ease;
                            }

                            .reaction__button {
                                fill: #7A7A85;
                                width: 24px;
                                height: 24px;
                                display: inline-flex;
                                align-items: center;
                                justify-content: center;
                                transform: scale(1) rotate(0deg);

                                &.disabled {
                                    pointer-events: none;
                                }

                                &.active {
                                    fill: #45080D;
                                }
                            }

                            &.loading {
                                pointer-events: none;

                                .reaction__value {
                                    filter: blur(1px);
                                }
                            }

                            &.animate-like {
                                .reaction__button {
                                    animation: reactionLike 1.5s ease-in-out forwards;
                                }
                            }
                        }
                    }

                    .reviews__item-date {
                        color: var(--Gray-7, #7A7A85);
                        font-size: 16px;
                        font-style: normal;
                        font-weight: 400;
                        line-height: 140%;
                        letter-spacing: 0.16px;
                    }
                }
            }
        }

        .reviews__empty {
            border-radius: 12px;
            background-color: var(--Gray-1, #FAFAFA);
            min-height: 300px;
            padding: 24px 24px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            margin-top: 34px;

            .reviews__empty-title {
                color: var(--Gray-7, #7A7A85);
                text-align: center;
                font-size: 20px;
                font-style: normal;
                font-weight: 400;
                line-height: 150%;
                letter-spacing: 0.2px;
            }

            .reviews__empty-image {
                margin-top: 24px;
                max-width: 120px;
            }
        }
    }

    @media (max-width: 620px) {
        & {
            .reviews__body {
                .reviews__bar {
                    flex-direction: column;
                    row-gap: 20px;
                }

                .reviews__items {
                    display: flex;
                    flex-direction: column;
                    row-gap: 16px;
                    overflow-x: visible;

                    &::-webkit-scrollbar {
                        height: 10px;
                    }

                    .reviews__item {
                        min-width: 100%;
                    }
                }
            }
        }
    }
}

.reviews__view {
    flex: 1;
    display: flex;
    flex-direction: column;
    
    
    .reviews__header {
        border-bottom: solid 1px var(--Gray-4, #D1D1D2);
        padding-bottom: 32px;
        
        .reviews__title {
            color: var(--Base-Dark, #171717);
            font-size: 26px;
            font-style: normal;
            font-weight: 600;
            line-height: 130%;
            letter-spacing: 0.52px;
            margin-bottom: 40px;
        }

        .reviews__controls {
            .reviews__filter {
                display: flex;
                column-gap: 8px;
                
                .button__filter {
                    border-radius: 8px;
                    border: 1px solid var(--Gray-4, #D1D1D2);
                    background-color: #ffffff;
                    min-height: 30px;
                    display: inline-flex;
                    align-items: center;
                    column-gap: 6px;
                    color: var(--Gray-7, #7A7A85);
                    fill: var(--Dark-wine-2, #770E16);
                    padding: 2px 8px;
                    transition: all .3s ease;
                                        
                    
                    .button__stars {
                        fill: inherit;
                        display: inline-flex;
                        align-items: center;
                        justify-content: center;
                        column-gap: 2px;
                    }

                    .button__value {
                        color: inherit;
                        text-align: center;
                        font-size: 14px;
                        font-style: normal;
                        font-weight: 400;
                        line-height: 140%;
                        letter-spacing: 0.14px;
                    }

                    &:hover {
                        background-color: var(--Gray-1, #FAFAFA);
                    }

                    &.active {
                        background-color: var(--Dark-wine-2, #770E16);
                        border-color: var(--Dark-wine-2, #770E16);
                        color: #ffffff;
                        fill: #ffffff;
                    }
                }
            }
        }
    }

    .reviews__diagram {
        margin-top: 40px;
        
        .reviews__rating {
            display: flex;
            align-items: center;
            row-gap: 4px;
            column-gap: 8px;
            
            .reviews__rating-value {
                color: var(--Dark-wine-2, #770E16);
                font-size: clamp(56px, 4vw, 84px);
                font-style: normal;
                font-weight: 700;
                line-height: 80%;
                letter-spacing: 0.84px;
            }

            .reviews__rating-text {
                color: var(--Gray-7, #7A7A85);
                font-size: clamp(16px, 3vw, 20px);
                font-style: normal;
                font-weight: 400;
                line-height: normal;
                letter-spacing: 0.2px;
            }

            .reviews__rating-stars {
                display: inline-flex;
                gap: 6px;
                

                .reviews__rating-star {
                    width: 24px;
                    aspect-ratio: 1/1;
                    position: relative;
                    background: url('../../icons/star.svg') center / contain no-repeat;
                    
                    
                    
                    

                    &:before {
                        content: "";
                        position: absolute;
                        inset: 0;
                        width: var(--star-fill);
                        background: url('../../icons/star-fill.svg') left center / auto 100% no-repeat;
                        overflow: hidden;
                    }
                }
            }
        }

        .diagram__items {
            display: flex;
            flex-direction: column;
            row-gap: 16px;
            margin-top: 20px;
            
            .diagram__item {
                display: flex;
                column-gap: 20px;
                align-items: center;
                
                .diagram__item-stars {
                    display: flex;
                    column-gap: 8px;
                    
                    .diagram__item-star {
                        background: url('../../icons/star-gold.svg') center / contain no-repeat;
                        width: 22px;
                        height: 21px;
                        

                        &.fill {
                            background: url('../../icons/star-gold-fill.svg') left center / auto 100% no-repeat;
                        }
                    }
                }

                .diagram__item-progress {
                    flex: 1 0;
                    height: 20px;
                    border-radius: 0 5px 5px 0;
                    background-color: #F9F0F0;
                    position: relative;

                    &:before {
                        content: "";
                        display: block;
                        border-radius: 0 5px 5px 0;
                        background-color: var(--Dark-wine-2, #770E16);
                        position: absolute;
                        left: 0;
                        top: 0;
                        height: 100%;
                        width: var(--percent);
                    }
                }

                .diagram__item-value {
                    color: var(--Base-Dark, #171717);
                    font-size: 20px;
                    font-style: normal;
                    font-weight: 400;
                    line-height: normal;
                    letter-spacing: 0.2px;
                    text-align: right;
                }
            }
        }
    }

    .reviews__items {
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        margin-top: 32px;
        row-gap: 32px;

        &::-webkit-scrollbar {
            width: 10px;
        }

        &::-webkit-scrollbar-track {
            background: transparent;
        }

        &::-webkit-scrollbar-thumb {
            background: rgb(69 8 13 / 25%);
            border-radius: 999px;
            border: 2px solid transparent;
            background-clip: content-box;
        }

        &::-webkit-scrollbar-thumb:hover {
            background: rgb(69 8 13 / 100%);
        }

        .reviews__item {
            border-radius: 12px;
            border: 1px solid var(--Gray-4, #D1D1D2);
            background-color: #ffffff;
            padding: 20px 20px;
            width: 100%;
            min-width: 500px;
            flex: 1 0;
            

            .reviews__item-author {
                display: grid;
                grid-template-columns: auto 1fr;
                row-gap: 4px;
                column-gap: 16px;

                .author__photo {
                    width: 64px;
                    height: 64px;
                    border-radius: 50%;
                    background-color: var(--Dark-wine-Main, #45080D);
                    color: #ffffff;
                    font-size: 26px;
                    font-style: normal;
                    font-weight: 500;
                    line-height: 130%;
                    letter-spacing: 0.8px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    grid-row: 1/3;
                    align-items: center;
                }

                .author__name {
                    color: var(--Base-Dark, #171717);
                    font-size: 16px;
                    font-style: normal;
                    font-weight: 500;
                    line-height: 140%;
                    letter-spacing: 0.16px;
                    align-self: flex-end;
                }
                
                .author__rating {
                    align-self: flex-start;
                    display: flex;
                    align-items: center;
                    
                    .author__rating-stars {
                        display: inline-flex;
                        align-self: flex-end;
                        gap: 3px;

                        .author__rating-star {
                            width: 12px;
                            height: 12px;
                            position: relative;
                            background: url('../../icons/star-fill.svg') center / contain no-repeat;
                        }
                    }
                }
            }

            .reviews__item-text {
                color: var(--Base-Dark, #171717);
                font-size: 16px;
                font-style: normal;
                font-weight: 400;
                line-height: 140%;
                letter-spacing: 0.16px;
                margin-top: 24px;
            }

            .reviews__item-image {
                max-width: 100px;
                margin-top: 16px;

                img {
                    border-radius: 12px;
                }
            }

            .reviews__item-meta {
                display: flex;
                align-items: center;
                justify-content: space-between;
                column-gap: 24px;
                margin-top: 24px;

                .reviews__item-reaction {
                    .reaction {
                        display: flex;

                        .reaction__value {
                            color: var(--Gray-7, #7A7A85);
                            font-size: 16px;
                            font-style: normal;
                            font-weight: 400;
                            line-height: 140%;
                            letter-spacing: 0.16px;
                            filter: blur(0px);
                            transition: filter .3s ease;
                        }

                        .reaction__button {
                            fill: #7A7A85;
                            width: 24px;
                            height: 24px;
                            display: inline-flex;
                            align-items: center;
                            justify-content: center;
                            transform: scale(1) rotate(0deg);

                            &.disabled {
                                pointer-events: none;
                            }

                            &.active {
                                fill: #45080D;
                            }
                        }

                        &.loading {
                            pointer-events: none;

                            .reaction__value {
                                filter: blur(1px);
                            }
                        }

                        &.animate-like {
                            .reaction__button {
                                animation: reactionLike 1.5s ease-in-out forwards;
                            }
                        }
                    }
                }

                .reviews__item-date {
                    color: var(--Gray-7, #7A7A85);
                    font-size: 16px;
                    font-style: normal;
                    font-weight: 400;
                    line-height: 140%;
                    letter-spacing: 0.16px;
                }
            }
        }
    }

    @media (max-width: 620px) {
        & {
            width: 100%;

            .reviews__header {
                padding-bottom: 20px;
                
                .reviews__controls {
                    .reviews__filter {
                        overflow-x: auto;

                        &::-webkit-scrollbar {
                            display: none;
                        }
                    }
                }
            }

            .reviews__diagram {
                margin-top: 20px;

                .diagram__items {
                    display: none;
                }
            }

            .reviews__items {
                row-gap: 16px;
                
                .reviews__item {
                    min-width: 100%;
                    padding: 20px 16px;
                }
            }
        }
    }
}

.reviews__write {
    .reviews__header {
        margin-bottom: 40px;

        .reviews__title {
            color: var(--Base-Dark, #171717);
            font-size: 26px;
            font-style: normal;
            font-weight: 600;
            line-height: 130%;
            letter-spacing: 0.52px;
        }
    }

    .reviews__body {
        .reviews__form {
            .form__field {
                &.form__field-stars {
                    margin-bottom: 16px;
                }

                textarea.input {
                    min-height: 116px;
                }
            }

            .form__buttons {
                align-items: flex-start;
                margin-top: 24px;

                .button {
                    width: auto;
                    min-width: 250px;
                }
            }
        }
    }

    @media (max-width: 620px) {
        & {
            .reviews__body {
                .reviews__form {
                    .form__buttons {
                        .button {
                            width: 100%;
                        }
                    }
                }
            }
        }
    }
}

.modal.modal__finespirits {
    &.modal-reviews {
        overflow: visible;
        .modal__block {
            max-width: 886px;
            background-color: var(--Gray-1, #FAFAFA);
            top: 50px;
            max-height: calc(100dvh - 100px);
            display: flex;
            flex-direction: column;

            .modal__block-content {
                flex: 1;
                min-height: 0;
                display: flex;
            }
        }
    }

    &.modal-reviews {
        .modal__block {
            max-width: 886px;
        }
    }

    &.modal-review-write {
        .modal__block {
            max-width: 886px;
        }
    }

    @media (max-width: 620px) {
        & {
            &.modal-reviews {
                .modal__block {
                    top: 16px;
                    max-height: calc(100dvh - 32px);
                    width: calc(100% - 32px);
                }
            }

            &.modal-review-write {
                .modal__block {
                    top: 16px;
                    width: calc(100% - 32px);
                }
            }
        }
    }
}

@keyframes reactionLike {
    0% {
        transform: scale(1) rotate(0deg);
    }
    20% {
        transform: scale(1) rotate(-22deg);
    }
    45% {
        transform: scale(1.4) rotate(-22deg);
    }
    70% {
        transform: scale(1.0) rotate(-22deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}


.form__field-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;

    input {
        display: none;
    }

    label {
        width: 32px;
        aspect-ratio: 1/1;
        cursor: pointer;
        background: url('../../icons/star.svg') center / contain no-repeat;

        &:hover,
        &:hover ~ label {
            background-image: url('../../icons/star-fill.svg');
        }
    }

    input:checked {
        & ~ label {
           background-image: url('../../icons/star-fill.svg'); 
        }
    }
}