// Perspective
@mixin perspective( $args ) {
    -webkit-perspective: $args;
    perspective: $args;
}

// Transform
@mixin transform( $args ) {
    -webkit-transform: $args;
    transform: $args;
}

// Transform style
@mixin transform-style( $args ) {
    -webkit-transform-style: $args;
    transform-style: $args;
}

// Transition
@mixin transition( $args ) {
    -webkit-transition: $args;
    transition: $args;
}

// Backface
@mixin backface-visibility( $args ) {
    -webkit-backface-visibility: $args;
    backface-visibility: $args;
}

/*------------------------------------------------------------------
Flip Box
-------------------------------------------------------------------*/
.oew-flip-box {
    position: relative;
    height: 280px;
    @include perspective( 1000px );
    @include transform-style( preserve-3d );

    .elementor-icon {
        color: #fff;
    }

    .elementor-view-framed .elementor-icon {
        color: #fff;
        border-color: #fff;
    }

    .elementor-view-stacked .elementor-icon {
        color: #fff;
        background-color: rgba(0, 0, 0, .5);
    }

    .elementor-icon-wrap {
        margin-bottom: 20px;
    }

    .oew-flip-box-button {
        background-color: #fff;
        color: #333;

        &:hover {
            background-color: #eee;
        }
    }
}

.oew-flip-box-front {
    background-color: #13aff0;
}

.oew-flip-box-back {
    display: block;
    background-color: #fe8a52;
}

.oew-flip-box-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    @include transition( all .6s ease-in-out );
}

.oew-flip-box-layer-overlay {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: stretch;
    -webkit-align-items: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    width: 100%;
    height: 100%;
    padding: 35px;
    text-align: center;
}

.oew-flip-box-layer-title {
    color: #fff;
    font-size: 20px;
    line-height: 1;
    font-weight: 600;

    &:not(:last-child) {
        margin: 0 0 20px 0;
        padding: 0;
    }
}

.oew-flip-box-layer-desc {
    font-size: 14px;
    color: #fff;

    &:not(:last-child) {
        margin: 0 0 20px 0;
        padding: 0;
    }
}

.oew-flip-box-image {
    display: inline-block;
    width: 100%;
    margin: 0 0 20px 0;

    img {
        width: 50%;
    }
}

.oew-flip-box-3d-yes {
    .oew-flip-box-layer-inner {
        @include transform( translateZ(90px) scale(.91) );
    }

    .oew-flip-box-layer-overlay {
        @include transform( translateZ(.1px) );
        @include transform-style( preserve-3d );
    }
}

.oew-flip-box-effect-flip {
    .oew-flip-box {
        @include perspective( 1000px );
        @include transform-style( preserve-3d );

        &:hover .oew-flip-box-back {
            @include transform( none );
        }
    }

    .oew-flip-box-layer {
        @include transform-style( preserve-3d );
        @include backface-visibility( hidden );
    }

    .oew-flip-box-front {
        @include transform( none );
        z-index: 1;
    }

    &.oew-flip-box-direction-right {
        .oew-flip-box-back {
            @include transform( rotateX(0) rotateY(-180deg) );
        }

        .oew-flip-box:hover .oew-flip-box-front {
            @include transform( rotateX(0) rotateY(180deg) );
        }
    }

    &.oew-flip-box-direction-left {
        .oew-flip-box-back {
            @include transform( rotateX(0) rotateY(180deg) );
        }

        .oew-flip-box:hover .oew-flip-box-front {
            @include transform( rotateX(0) rotateY(-180deg) );
        }
    }

    &.oew-flip-box-direction-up {
        .oew-flip-box-back {
            @include transform( rotateX(-180deg) rotateY(0) );
        }

        .oew-flip-box:hover .oew-flip-box-front {
            @include transform( rotateX(180deg) rotateY(0) );
        }
    }

    &.oew-flip-box-direction-down {
        .oew-flip-box-back {
            @include transform( rotateX(180deg) rotateY(0) );
        }

        .oew-flip-box:hover .oew-flip-box-front {
            @include transform( rotateX(-180deg) rotateY(0) );
        }
    }
}

.oew-flip-box-effect-push {
    .oew-flip-box-front {
        @include transform( none );
    }

    .oew-flip-box {
        overflow: hidden;

        &:hover .oew-flip-box-back {
            @include transform( none );
        }
    }

    &.oew-flip-box-direction-right {
        .oew-flip-box:hover .oew-flip-box-front {
            @include transform( translateX(100%) translateY(0) );
        }

        .oew-flip-box-back {
            @include transform( translateX(-100%) translateY(0) );
        }
    }

    &.oew-flip-box-direction-left {
        .oew-flip-box:hover .oew-flip-box-front {
            @include transform( translateX(-100%) translateY(0) );
        }

        .oew-flip-box-back {
            @include transform( translateX(100%) translateY(0) );
        }
    }

    &.oew-flip-box-direction-up {
        .oew-flip-box:hover .oew-flip-box-front {
            @include transform( translateX(0) translateY(-100%) );
        }

        .oew-flip-box-back {
            @include transform( translateX(0) translateY(100%) );
        }
    }

    &.oew-flip-box-direction-down {
        .oew-flip-box:hover .oew-flip-box-front {
            @include transform( translateX(0) translateY(100%) );
        }

        .oew-flip-box-back {
            @include transform( translateX(0) translateY(-100%) );
        }
    }
}

.oew-flip-box-effect-slide {
    .oew-flip-box {
        overflow: hidden;
    }

    .oew-flip-box:hover .oew-flip-box-back {
        @include transform( none );
    }

    &.oew-flip-box-direction-right .oew-flip-box-back {
        @include transform( translateX(-100%) translateY(0) );
    }

    &.oew-flip-box-direction-left .oew-flip-box-back {
        @include transform( translateX(100%) translateY(0) );
    }

    &.oew-flip-box-direction-up .oew-flip-box-back {
        @include transform( translateX(0) translateY(100%) );
    }

    &.oew-flip-box-direction-down .oew-flip-box-back {
        @include transform( translateX(0) translateY(-100%) );
    }
}

.oew-flip-box-effect-zoom-out .oew-flip-box {
    .oew-flip-box-front {
        -webkit-transition: opacity .35s, width .1ms, -webkit-transform .7s;
        transition: opacity .35s, width .1ms, -webkit-transform .7s;
        transition: transform .7s, opacity .35s, width .1ms;
        transition: transform .7s, opacity .35s, width .1ms, -webkit-transform .7s;
        opacity: 1;
        z-index: 1;
        width: 100%;
        @include transform( scale(1) );
    }

    &:hover .oew-flip-box-front {
        width: 0;
        opacity: 0;
        -webkit-transition: opacity .7s .1s, width .1ms .7s, -webkit-transform .8s;
        transition: opacity .7s .1s, width .1ms .7s, -webkit-transform .8s;
        transition: transform .8s, opacity .7s .1s, width .1ms .7s;
        transition: transform .8s, opacity .7s .1s, width .1ms .7s, -webkit-transform .8s;
        @include transform( scale(.7) );
    }
}

.oew-flip-box-effect-zoom-in .oew-flip-box {
    .oew-flip-box-back {
        -webkit-transition: opacity .5s .2s, -webkit-transform .7s;
        transition: opacity .5s .2s, -webkit-transform .7s;
        transition: transform .7s, opacity .5s .2s;
        transition: transform .7s, opacity .5s .2s, -webkit-transform .7s;
        opacity: 0;
        @include transform( scale(.7) );
    }

    &:hover .oew-flip-box-back {
        -webkit-transition: opacity .5s, -webkit-transform .7s;
        transition: opacity .5s, -webkit-transform .7s;
        transition: transform .7s, opacity .5s;
        transition: transform .7s, opacity .5s, -webkit-transform .7s;
        opacity: 1;
        @include transform( scale(1) );
    }
}

.oew-flip-box-effect-fade .oew-flip-box {
    .oew-flip-box-back {
        opacity: 0;
    }

    &:hover .oew-flip-box-back {
        opacity: 1;
    }
}

.elementor-widget-oew-flip-box.oew-flip-box-flipped {
    .oew-flip-box-front {
        display: none;
    }

    .oew-flip-box-back {
        @include transform( none );
        opacity: 1;
    }
}

/* RTL */
body.rtl {
    .oew-flip-box-effect-flip {
        &.oew-flip-box-direction-right .oew-flip-box-back {
            @include transform( rotateX(0) rotateY(180deg) );

            &:hover .oew-flip-box-front {
                @include transform( rotateX(0) rotateY(-180deg) );
            }
        }

        &.oew-flip-box-direction-left .oew-flip-box-back {
            @include transform( rotateX(0) rotateY(-180deg) );

            &:hover .oew-flip-box-front {
                @include transform( rotateX(0) rotateY(180deg) );
            }
        }
    }

    .oew-flip-box-effect-push {
        &.oew-flip-box-direction-right {
            .oew-flip-box:hover .oew-flip-box-front {
                @include transform( translateX(-100%) translateY(0) );
            }

            .oew-flip-box-back {
                @include transform( translateX(100%) translateY(0) );
            }
        }

        &.oew-flip-box-direction-left {
            .oew-flip-box:hover .oew-flip-box-front {
                @include transform( translateX(100%) translateY(0) );
            }

            .oew-flip-box-back {
                @include transform( translateX(-100%) translateY(0) );
            }
        }
    }

    .oew-flip-box-effect-slide {
        &.oew-flip-box-direction-right .oew-flip-box-back {
            @include transform( translateX(100%) translateY(0) );
        }

        &.oew-flip-box-direction-left .oew-flip-box-back {
            @include transform( translateX(-100%) translateY(0) );
        }
    }
}

/*------------------------------------------------------------------
Responsive
-------------------------------------------------------------------*/
@media (max-device-width: 1024px) {
    .oew-flip-box {
        cursor: pointer;
    }
}
