//
//  Advanced Review Widget
//  ____________________________________________

//
//  Variables
//  --------------------------------------------

@amreview-widget-grid-review__background: #f8fcff;

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

& when (@media-common = true) {
    .amreview-widget-container {
        .amreview-review-items {
            .am-flex(none, none, wrap);
        }

        .amreview-review-wrapper.review-item {
            box-sizing: border-box;
            padding: 20px;
            width: 100%;
            border-bottom: 1px solid #cde1ef;
        }

        .amreview-image-wrapper {
            width: 80px;
            height: 80px;
        }

        .amreview-description-wrapper {
            .am-flex(space-between);

            flex-direction: column;
            flex-grow: 1;
            -webkit-box-pack: justify;
            -ms-flex-pack: justify;
            overflow: hidden;
        }

        .amreview-rating-wrapper {
            .am-flex(center);

            flex-direction: column;
            -webkit-box-pack: center;
            -ms-flex-pack: center;
            margin: 0 15px 15px 0;
            padding: 0;
        }

        .amreview-title-wrapper {
            flex-basis: 100%;
            overflow: hidden;
            color: #006bb4;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .amreview-details-wrapper {
            .am-flex(none, none, wrap);

            flex-direction: column;
            margin-top: 20px;
        }

        .amreview-message {
            height: 60px;
            word-wrap: break-word;
            word-break: break-all;
        }

        .amreview-date {
            color: @amreview-line__color;
            font-size: 12px;
        }

        .amreview-footer {
            .am-flex(space-between);

            position: relative;
            -webkit-box-pack: justify;
            -ms-flex-pack: justify;
        }

        .product-item-photo {
            margin: 0 15px 15px 0;
        }
    }

    .amreview-widget-container.-advanced {
        margin-bottom: 15px;
    }

    .amreview-rating-label {
        margin: 0 @amrev__indent 5px 0;
        color: #8f8f8f;
        font-size: 12px;
    }

    .amreview-widget-container.-grid .amreview-rating-wrapper {
        min-width: 160px;
    }

    .amreview-widget-container.-sidebar .amreview-rating-wrapper {
        flex-grow: 1;
    }

    .amreview-widget-container .amreview-title {
        & {
            position: relative;
            margin-bottom: 10px;
            padding: 15px 40px 15px 20px;
            background: @amreview-widget-grid-review__background;
            word-break: break-all;
            word-break: break-word;
            font-weight: 700;
            font-size: 16px;
            cursor: pointer;
        }

        &:after {
            position: absolute;
            top: 50%;
            right: 20px;
            width: 15px;
            height: 15px;
            background: @amreview-widget-arrow-up__background;
            background-size: contain;
            content: '';
            transform: translateY(-50%);
        }

        &.-collapsed:after {
            background: @amreview-widget-arrow-down__background;
            background-size: contain;
        }
    }

    .amreview-widget-container .amreview-rating-item {
        & {
            .am-flex(space-between, center, wrap);

            -webkit-box-pack: justify;
            -ms-flex-pack: justify;
        }

        &:not(:last-child) {
            margin-bottom: 15px;
        }

        &.-one-rating {
            align-items: flex-start;
            flex-direction: column;
        }

        &.-one-rating .amreview-rating-value {
            .am-flex(space-between, center, wrap);

            -webkit-box-pack: justify;
            -ms-flex-pack: justify;
            width: 100%;
        }

        .amreview-number {
            font-size: 30px;
        }

        .amstars-rating-container {
            margin-bottom: 0;
        }
    }

    //redefinition of magento default product image styles
    .amreview-image-wrapper {
        .product-image-container,
        .product-image-wrapper {
            width: 100%;
            height: 100%;
        }

        .product-image-wrapper {
            padding: 0 !important; //redefinition magento inline style
        }

        .product-image-photo {
            max-height: 100%;
            width: auto;
        }
    }

    .amreview-full-link {
        &,
        &:visited,
        &:active,
        &:hover {
            margin-left: 14px;
            color: #6b8fab;
            font-size: 12px;
        }

        &:after {
            position: absolute;
            top: 50%;
            right: -@amrev__indent;
            display: inline-block;
            margin-left: 3px;
            width: 10px;
            height: 10px;
            background: @amreview-widget-arrow-right__background;
            background-size: contain;
            content: '';
            transform: translateY(-50%);
        }
    }
}

//
//  Mobile -
//  --------------------------------------------

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .amreview-widget-container .amreview-message {
        height: 80px;
    }
}

//
//  Desktop
//  --------------------------------------------

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) {
    .amreview-widget-container.-grid {
        .amreview-review-items {
            -webkit-box-pack: justify;
            -ms-flex-pack: justify;
            justify-content: space-between;
        }

        .amreview-rating-wrapper {
            margin-bottom: 0;
        }

        .amreview-review-wrapper.review-item {
            width: 49%;
            border-bottom: 0;
            background: @amreview-widget-grid-review__background;
        }

        .amreview-title {
            padding: 10px 0;
            background: none;
            cursor: unset;
            pointer-events: none;
        }

        .amreview-title:after {
            display: none;
        }

        .amreview-description-wrapper {
            min-width: 200px;
        }

        .amreview-message {
            max-width: 290px;
        }
    }

    .amreview-widget-container.-sidebar .amreview-rating-wrapper {
        min-width: 120px;
        max-width: 30%;
    }
}
