// /**
//  * Copyright © 2015 Magento. All rights reserved.
//  * See COPYING.txt for license details.
//  */

//
//    Common
//--------------------------------------

& when (@media-common = true) {

.data.switch .counter {
    .lib-css(color, @text__color__muted);
    &:before {
        content:"(";
    }
    &:after {
        content:")";
    }
}
.rating-summary {
    .lib-rating-summary();
    
    .rating-result {
        display: block;
        width: 83px;
    }
}

.product-reviews-summary,
.table-reviews {
    .rating-summary {
        .lib-rating-summary-label-hide();
    }
}

.review-control-vote {
    .lib-rating-vote();
    &:before {
        .lib-rating-icons-content(
            @_icon-content: @icon-star-empty
        );
    }
}

//
//    Review product page
//--------------------------------------
.review {
    &-toolbar {
        padding: 0;
        border-top: 1px solid @color-gray79;
        margin: 0 0 @indent__base;
        text-align: center;
        &:first-child {
            display: none;
        }
        .pages {
            display: block;
            text-align: center;
            border-bottom: 1px solid @color-gray79;
            padding: @indent__base 0;
        }
        .limiter {
            display: none;
        }
    }
    &-add {
        .block-title {
            display: none;
        }
    }
    &-form {
        .action.submit.primary {
            .lib-button-revert-secondary-size();
            margin: 0;
        }
        .actions-toolbar .actions-primary {
            padding: 0;
        }
    }
    &-fieldset {}
    .fieldset &-legend.legend {
        line-height: 1.3;
        border-bottom: 0;
        padding: 0;
        span {
            margin: 0;
        }
        strong {
            display: block;
            font-weight: 600;
        }
        margin-bottom: @indent__base;
    }
    .fieldset &-field-ratings {
        > .label {
            margin-bottom: @indent__s;
            font-weight: 600;
            padding: 0;
        }
    }
    &-control-vote label:before,
    &-control-vote:before {
        font-size: 32px;
        line-height: 32px;
        height: 32px;
        letter-spacing: 10px;
    }
    &-field-rating {
        .label {
            font-weight: 600;
        }
        .control {
            margin-top: @indent__s;
            margin-bottom: 1.2*@indent__xl;
        }
    }
    &-list {
        .block-title strong {
            .lib-heading(h2);
        }
        margin-bottom: @indent__l;
    }
    &-item {
        padding: @indent__base 0;
        border-bottom: 1px solid @color-gray79;
        margin: 0;
        .lib-clearer();
        &:last-child {
            border-width: 0;
        }
    }
    &-ratings {
        display: table;
        max-width: 100%;
        margin-bottom: @indent__s;
        &:extend(.abs-rating-summary all);
    }
    &-author {
        display: inline;
        .review-details-value {
            font-weight: 400;
        }
    }
    &-date {
        display: inline;
        .review-details-label {
            &:extend(.abs-visually-hidden all);
        }
    }
    &-title {
        .lib-heading(h3);
        margin: 0 0 @indent__base;
    }
    &-content {
        margin-bottom: @indent__base;
    }
}
.page-main {
    .column {
        .review-add {
            margin-bottom: 0;
        }
    }
}

}

//
//    Desktop
//--------------------------------------
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) {
    .review {
        &-form {
            max-width: 500px;
        }

        @review-ratings-left: 280px;
        &-ratings {
            max-width: @review-ratings-left - @indent__xl;
            float: left;
            margin-bottom: 0;
        }
        &-ratings ~ &-content,
        &-ratings ~ &-details {
            margin-left: @review-ratings-left;
        }
    }

    .review {
        @reviews-indent-desktop: 30px;
        &-toolbar {
            margin: 0 0 @reviews-indent-desktop;
            .pages {
                padding: @reviews-indent-desktop 0;
            }
        }
        .fieldset &-legend.legend {
            margin-bottom: @reviews-indent-desktop;
        }
        &-item {
            padding: @reviews-indent-desktop 0;
        }
        &-title {
            margin: 0 0 @reviews-indent-desktop;
        }
    }
}

//
//    Common
//--------------------------------------

& when (@media-common = true) {

.data.table.reviews {
    .rating-summary {
        margin-top: -4px;
    }
}

.customer.review.view {
    .review.title,
    .ratings.summary.items,
    .product.details {
        margin-bottom: @indent__base;
    }
}

.product-reviews-summary {
    margin-bottom: 10px;
    .products.wrapper.list & {
        margin: 0 auto;
    }
    .rating-summary {
        display:inline-block;
        vertical-align: middle;
    }
    .reviews-actions {
        display:inline-block;
        vertical-align: middle;
        font-size: 14px;
        margin-top: 0;
        line-height: 16px;
        a {
            color: @product-reviews-summary-links;
            padding: 0 15px 0 10px;
        }
        a:not(:last-child) {
            border-right: 1px solid #ccc;
        }
        .action.view span {
        }
    }
    &.no-rating {
        .reviews-actions {
            a:first-child {
                padding-left: 0;
            }
        }
    }
}

.product-info-main,
.customer-review {
    .product-reviews-summary {
        margin-bottom: 20px;
    }
    .rating-summary {
        margin-right: 15px;
    }
}

}

//
//    Desktop
//--------------------------------------
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .product-reviews-summary {
        .products.wrapper.list & {
            margin: 0;
        }
    }
}


//
//    Common
//--------------------------------------

& when (@media-common = true) {

//
//    Account
//--------------------------------------
.block-reviews-dashboard {
    .items {
        .item {
            .lib-css(margin-bottom, @indent__base);
            &:last-child {
                margin-bottom: 0;
            }
        }
    }
    .product-name {
        display: inline-block;
        &:not(:last-child) {
            .lib-css(margin-bottom, @indent__xs);
        }
    }
    .rating-summary {
        .label {
            .lib-css(font-weight, @font-weight__semibold);
            .lib-css(margin-right, @indent__s);
        }
    }
}

.table-reviews,
.block-reviews-dashboard {
    .product-name {
        .lib-css(font-weight, @font-weight__regular);
    }
}

.table-reviews {
    .rating-summary {
        display: inline-block;
        vertical-align: baseline;
    }
}

}

//
//    Mobile
//--------------------------------------
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .account {
        .table-reviews {
            .col.actions {
                &:extend(.abs-col-no-prefix all);
            }
        }
    }
}

//
//    Desktop
//--------------------------------------
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .block-reviews-dashboard {
        .product-name {
            &:extend(.abs-account-block-font-size all);
        }
    }
}

//
//    Common
//--------------------------------------

& when (@media-common = true) {

.customer-review {
    .product-details {
        &:extend(.abs-add-clearfix all);
        &:extend(.abs-margin-for-blocks-and-widgets all);
        .rating-average-label {
            &:extend(.abs-visually-hidden all);
        }
    }
    .product-media {
        width: 30%;
        max-width: 285px;
        float: left;
        margin-right: 3%;
    }
    .product-info {
    }
    .review-details {
        margin: 0;
        .title {
            &:extend(.abs-account-title all);
        }
        .customer-review-rating {
            .lib-css(margin-bottom, @indent__base);
            .item {
                .lib-css(margin-bottom, @indent__s);
                &:last-child {
                    margin-bottom: 0;
                }
            }
            &:extend(.abs-rating-summary all);
        }
        .review-title {
            .lib-heading(h3);
            .lib-css(font-weight, @font-weight__semibold);
            .lib-css(margin-bottom, @indent__base);
        }
        .review-content {
            margin: 0;
            .lib-css(margin-bottom, @indent__base);
        }
        .review-date {
            .lib-css(color, @primary__color__light);
        }
    }
}

}

//
//    Mobile
//--------------------------------------
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .customer-review {
        .product-name {
            .lib-css(margin-bottom, @indent__xs);
        }
        .product-reviews-summary {
            .rating-summary {
                display: block;
                .lib-css(margin-bottom, @indent__xs);
            }
        }
    }
}

//
//    Desktop
//--------------------------------------
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .customer-review {
        .product-details {
            &:extend(.abs-margin-for-blocks-and-widgets-desktop all);
        }
    }
}
