/* Gallery Card -------------------------------*/
.gallery-card {
    text-align: center;

    &.style2 {
        position: relative;
        border-radius: 50px;
        z-index: 5;

        .box-content {
            inset: 8px;
        }

        .box-img {
            position: relative;
            z-index: 3;
            border-radius: 40px;

            &:before {
                content: "";
                position: absolute;
                inset: -3px;
                border: 12px solid $theme-color;
                z-index: 1;
                border-radius: 50px;
            }

            img {
                width: 100%;
                height: 100%;
                border-radius: 40px;
                object-fit: cover;
            }
        }
    }

    .box-img {
        display: block;
        position: relative;
        z-index: 2;
        border-radius: 30px;
        overflow: hidden;
        perspective: 1400px;

        @include sm {
            border-radius: 20px;
            border: 20px;
        }

        img {
            width: 100%;
            border-radius: 30px;
        }
    }

    .icon-btn {
        z-index: 3;
        background-color: $white-color;
        color: $theme-color4;

        &:hover {
            background-color: $theme-color;
            color: $white-color;
        }
    }

    .box-content {
        position: absolute;
        inset: -1px;
        transform: rotate3d(1, 0, 0, 90deg);
        display: flex;
        justify-content: center;
        align-items: center;
        background: $theme-color4;
        pointer-events: none;
        border-radius: inherit;
        z-index: -1; // For solving line issue
        transition: z-index 1s ease-in-out;
    }

    &:hover {
        .box-img {
            &:after {
                transform: scale(1);
                opacity: 0.7;
            }
        }

        .icon-btn {
            transform: scale(1);
        }

        .box-content {
            z-index: 2;
            transition: z-index 0.5s ease-in-out;
        }
    }
}

.gallery-sec2 {
    max-width: 1720px;
    margin-left: auto;
    margin-right: auto;

    @include lg {
        padding-left: 24px;
        padding-right: 24px;
    }

    @include sm {
        padding: 0;
        max-width: 540px;
    }
}

.testi-slider2 {
    .swiper-slide {
        background-position: center;
        background-size: cover;
        width: 550px;
        height: 551px;

        img {
            display: block;
            width: 100%;
        }
    }
}


/* overlay-direction */
.overlay-direction .filter-item {
    -webkit-perspective: 0;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    visibility: visible;
    backface-visibility: hidden;
}

.overlay-direction .filter-item {
    perspective: 540px;
}

.in-top .box-content {
    transform-origin: 50% 0%;
    animation: in-top 500ms ease 0ms 1 forwards;
}

.in-right .box-content {
    transform-origin: 100% 0%;
    animation: in-right 500ms ease 0ms 1 forwards;
}

.in-bottom .box-content {
    transform-origin: 50% 100%;
    animation: in-bottom 500ms ease 0ms 1 forwards;
}

.in-left .box-content {
    transform-origin: 0% 0%;
    animation: in-left 500ms ease 0ms 1 forwards;
}

.out-top .box-content {
    transform-origin: 50% 0%;
    animation: out-top 500ms ease 0ms 1 forwards;
}

.out-right .box-content {
    transform-origin: 100% 50%;
    animation: out-right 500ms ease 0ms 1 forwards;
}

.out-bottom .box-content {
    transform-origin: 50% 100%;
    animation: out-bottom 500ms ease 0ms 1 forwards;
}

.out-left .box-content {
    transform-origin: 0% 0%;
    animation: out-left 500ms ease 0ms 1 forwards;
}

@-webkit-keyframes in-top {
    from {
        transform: rotate3d(-1, 0, 0, 90deg);
    }

    to {
        transform: rotate3d(0, 0, 0, 0deg);
    }
}

@keyframes in-top {
    from {
        transform: rotate3d(-1, 0, 0, 90deg);
    }

    to {
        transform: rotate3d(0, 0, 0, 0deg);
    }
}

@-webkit-keyframes in-right {
    from {
        transform: rotate3d(0, -1, 0, 90deg);
    }

    to {
        transform: rotate3d(0, 0, 0, 0deg);
    }
}

@keyframes in-right {
    from {
        transform: rotate3d(0, -1, 0, 90deg);
    }

    to {
        transform: rotate3d(0, 0, 0, 0deg);
    }
}

@-webkit-keyframes in-bottom {
    from {
        transform: rotate3d(1, 0, 0, 90deg);
    }

    to {
        transform: rotate3d(0, 0, 0, 0deg);
    }
}

@keyframes in-bottom {
    from {
        transform: rotate3d(1, 0, 0, 90deg);
    }

    to {
        transform: rotate3d(0, 0, 0, 0deg);
    }
}

@-webkit-keyframes in-left {
    from {
        transform: rotate3d(0, 1, 0, 90deg);
    }

    to {
        transform: rotate3d(0, 0, 0, 0deg);
    }
}

@keyframes in-left {
    from {
        transform: rotate3d(0, 1, 0, 90deg);
    }

    to {
        transform: rotate3d(0, 0, 0, 0deg);
    }
}

@-webkit-keyframes out-top {
    from {
        transform: rotate3d(0, 0, 0, 0deg);
    }

    to {
        transform: rotate3d(-1, 0, 0, 104deg);
    }
}

@keyframes out-top {
    from {
        transform: rotate3d(0, 0, 0, 0deg);
    }

    to {
        transform: rotate3d(-1, 0, 0, 104deg);
    }
}

@-webkit-keyframes out-right {
    from {
        transform: rotate3d(0, 0, 0, 0deg);
    }

    to {
        transform: rotate3d(0, -1, 0, 104deg);
    }
}

@keyframes out-right {
    from {
        transform: rotate3d(0, 0, 0, 0deg);
    }

    to {
        transform: rotate3d(0, -1, 0, 104deg);
    }
}

@-webkit-keyframes out-bottom {
    from {
        transform: rotate3d(0, 0, 0, 0deg);
    }

    to {
        transform: rotate3d(1, 0, 0, 104deg);
    }
}

@keyframes out-bottom {
    from {
        transform: rotate3d(0, 0, 0, 0deg);
    }

    to {
        transform: rotate3d(1, 0, 0, 104deg);
    }
}

@-webkit-keyframes out-left {
    from {
        transform: rotate3d(0, 0, 0, 0deg);
    }

    to {
        transform: rotate3d(0, 1, 0, 104deg);
    }
}

@keyframes out-left {
    from {
        transform: rotate3d(0, 0, 0, 0deg);
    }

    to {
        transform: rotate3d(0, 1, 0, 104deg);
    }
}

/*gallery  flipster start -------------------------*/
.gallery-area2 {
    position: relative;
    padding: 140px 0 50px 0;

    @include lg {
        padding: 140px 0 100px 0;
    }

    @include sm {
        .container {
            max-width: 100%;
        }
    }

    .shape-top {
        top: -30px;
    }

    .shape-bottom {
        bottom: -30px;
    }

    .slider-arrow {
        top: unset;
        bottom: 17%;

        @include xxl {
            display: block !important;
        }

        @include md {
            --icon-size: 40px;
            line-height: 42px;
        }

        @include xs {
            display: none !important;
        }

        &:hover {
            background-color: $theme-color4;
            border-color: $theme-color4;
        }

        &.slider-prev {
            position: absolute;
            left: 45.3%;

            @include xl {
                left: 44.5%;
            }

            @include lg {
                left: 43.5%;
            }

            @media(max-width: 620px) {
                left: 42.5%;
            }

        }

        &.slider-next {
            right: 45.3%;

            @include xl {
                right: 44.5%;
            }

            @include lg {
                right: 43.5%;
            }

            @media(max-width: 620px) {
                right: 42.5%;
            }
        }
    }
}

.gallery-box {
    position: relative;
    text-align: center;
    background-color: $white-color;
    box-shadow: 0px 10px 15px rgba(46, 46, 46, 0.2);
    border-radius: 50px;
    padding: 20px;

    @include xs {
        padding: 10px;
        border-radius: 20px;
    }



    .gallery-img {
        position: relative;
        overflow: hidden;
        border-radius: 38px;
        z-index: 2;

        @include xs {
            border-radius: 15px;
        }

        &:before {
            content: "";
            position: absolute;
            inset: 0;
            background: rgba(16, 55, 65, 0.8);
            box-shadow: 0px 10px 15px rgba(46, 46, 46, 0.2);
            border-radius: inherit;
            visibility: hidden;
            opacity: 0;
            transform: scale(0);
            transition: 0.4s ease-in-out;
            z-index: 2;

        }

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 38px;
            transition: 0.4s ease-in-out;

            @include xs {
                border-radius: 15px;
            }
        }
    }

    .gallery-content {
        position: absolute;
        inset: 0;
        z-index: 2;
        display: flex;
        justify-content: end;
        align-items: center;
        flex-direction: column;
        margin-bottom: 90px;
        visibility: hidden;
        opacity: 0;
        transform: scale(0);
        transition: 0.4s ease-in-out;
    }

    .box-title {
        font-size: 30px;
        line-height: 40px;
        margin-bottom: 0px;

        a:not(:hover) {
            color: $white-color;
        }
    }

    .gallery-subtitle {
        font-size: 18px;
        color: $white-color;
        margin-bottom: 8px;
    }

    .icon-btn {
        width: var(--btn-size, 60px);
        height: var(--btn-size, 60px);
        line-height: var(--btn-size, 60px);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        color: $white-color;
        padding: 2px;
        display: block;
        margin: auto;
        font-size: 20px;
        margin-bottom: 95px;


        &:hover {
            background: $white-color;
            color: $title-color;
        }
    }

    &:hover {
        .gallery-img {
            &:before {
                visibility: visible;
                opacity: 1;
                transform: scale(1);
            }

            img {
                transform: scale(1.2) rotate(-5deg);
            }
        }

        .gallery-content {
            visibility: visible;
            opacity: 1;
            transform: scale(1);
        }
    }
}