// Display flex
@mixin flex() {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}

// Flex wrap
@mixin wrap() {
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

// Justify content
@mixin justify( $args ) {
    -webkit-justify-content: $args;
    justify-content: $args;
}

// Flex Direction
@mixin flex-direction( $args ) {
    -webkit-flex-direction: $args;
    flex-direction: $args;
}

/*------------------------------------------------------------------
Testimonial
-------------------------------------------------------------------*/
.oew-testimonial-wrapper {

    &.oew-testimonial-bubble {
        .oew-testimonial-content {
            position: relative;
            background-color: #f4f4f4;
            padding: 20px;

            &:after {
                content: '';
                display: block;
                width: 14px;
                height: 14px;
                background-color: #f4f4f4;
                position: absolute;
                top: calc(100% - 7px);
                -webkit-transform: scaleX(.75) rotate(45deg);
                -ms-transform: scaleX(.75) rotate(45deg);
                transform: scaleX(.75) rotate(45deg);
                border-width: 0;
                -webkit-box-sizing: content-box;
                box-sizing: content-box;
            }
        }

        &.oew-testimonial-text-align-left .oew-testimonial-content:after {
            left: calc(20px + (50px/2));
        }

        &.oew-testimonial-text-align-center .oew-testimonial-content:after {
            left: 50%;
            -webkit-transform: translateX(-50%) scaleX(.75) rotate(45deg);
            -ms-transform: translateX(-50%) scaleX(.75) rotate(45deg);
            transform: translateX(-50%) scaleX(.75) rotate(45deg);
        }

        &.oew-testimonial-text-align-right .oew-testimonial-content:after {
            right: calc(20px + (50px/2));
        }
    }

    &.oew-testimonial-inline {
        @include flex();
        align-content: center;
        align-items: center;

        &.oew-testimonial-image-before {
           .oew-testimonial-image {
                padding-right: 20px;
            }

            .oew-testimonial-symbol {
                padding-left: 20px;
            } 
        }

        &.oew-testimonial-image-after {
           .oew-testimonial-image {
                padding-left: 20px;
            }

            .oew-testimonial-symbol {
                padding-right: 20px;
            } 
        }

        .oew-testimonial-image {
            width: 30%;

            img {
                width: 100%;
                height: auto;
            }
        }

        .oew-testimonial-content {
            margin: 0;
        }

        .oew-testimonial-meta {
            margin-top: 15px;
        }

        .oew-testimonial-symbol {
            margin: 0;
        }
    }

    &.oew-testimonial-text-align-left {
        text-align: left;

        .oew-testimonial-symbol {
            @include justify( flex-start );
        }
    }

    &.oew-testimonial-text-align-center {
        text-align: center;

        .oew-testimonial-symbol {
            @include justify( center );
        }
    }

    &.oew-testimonial-text-align-right {
        text-align: right;

        .oew-testimonial-symbol {
            @include justify( flex-end );
        }
    }

    .oew-testimonial-symbol {
        @include flex();
        margin-bottom: 30px;

        .oew-testimonial-symbol-inner {
            line-height: 1;
        }

        path {
            fill: #dadada;
        }
    }

    .oew-testimonial-content {
        font-size: 22px;
        font-style: italic;
        margin-bottom: 30px;
    }

    .oew-testimonial-meta {
        width: 100%;
        line-height: 1;

        &.oew-testimonial-image-position-aside {
            .oew-testimonial-image,
            .oew-testimonial-details {
                display: table-cell;
                vertical-align: middle;
            }

            .oew-testimonial-image {
                padding-right: 15px;
            }

            .oew-testimonial-details {
                text-align: left;
            }
        }

        &.oew-testimonial-image-position-top {
            .oew-testimonial-image {
                margin-bottom: 10px;
            }

            .oew-testimonial-details {
                display: block;
            }
        }
    }

    .oew-testimonial-meta-inner {
        display: inline-block;
    }

    .oew-testimonial-image img {
        height: 60px;
        width: 60px;
        max-width: 100%;
        -webkit-border-radius: 50%;
        border-radius: 50%;
        -o-object-fit: cover;
        object-fit: cover;
    }

    .oew-testimonial-name {
        display: block;
        font-size: 16px;
        line-height: 1.5;
    }

    .oew-testimonial-company {
        display: block;
        font-size: 12px;
    }

    .oew-testimonial-rating {
        padding: 0;
        margin: 10px 0 0;
        list-style: none;

        li {
            display: inline-block;

            i {
                color: #d8d8d8;
            }
        }

        &.rating-five li i {
            color: #f2b01e;
        }

        &.rating-four li:nth-child(1) i,
        &.rating-four li:nth-child(2) i,
        &.rating-four li:nth-child(3) i,
        &.rating-four li:nth-child(4) i {
            color: #f2b01e;
        }

        &.rating-three li:nth-child(1) i,
        &.rating-three li:nth-child(2) i,
        &.rating-three li:nth-child(3) i {
            color: #f2b01e;
        }

        &.rating-two li:nth-child(1) i,
        &.rating-two li:nth-child(2) i {
            color: #f2b01e;
        }

        &.rating-one li:nth-child(1) i {
            color: #f2b01e;
        }
    }
}

/* RTL */
body.rtl {
    .oew-testimonial-wrapper {

        .oew-testimonial-meta.oew-testimonial-image-position-aside {
            .oew-testimonial-image {
                padding-left: 15px;
                padding-right: 0;
            }

            .oew-testimonial-details {
                text-align: right;
            }
        }
    }
}

/* Responsive */
@media only screen and (max-width: 959px) {
    body {
        .oew-testimonial-wrapper.oew-testimonial-inline {
            flex-direction: column;

            &.oew-testimonial-image-before {
                .oew-testimonial-image {
                    padding: 0 0 20px;
                }

                .oew-testimonial-symbol {
                    padding: 20px 0 0;
                }
            }

            &.oew-testimonial-image-after {
                .oew-testimonial-image {
                    padding: 20px 0 0;
                }

                .oew-testimonial-symbol {
                    padding: 0 0 20px;
                }
            }
        }
    }
}