/* Service Card Flip Effect */

/* The container - set the perspective */
.service1__item {
    perspective: 1000px;
    background-color: transparent !important;
    /* Override main.css */
    box-shadow: none !important;
    /* Override main.css */
    padding: 0 !important;
    /* Override main.css - padding moves to faces */
    border-radius: 0 !important;
    /* Override main.css */
    min-height: 480px;
    /* Increased height for square images */
    height: 100%;
    /* Ensure uniformity in grid */
    cursor: pointer;
    /* Indicate interactivity */
    margin-bottom: 30px;
}

/* The flipper container */
.service1__item_flip-container {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
    /* Smooth easing */
    transform-style: preserve-3d;
    border-radius: 10px;
}

/* Flip on hover of the card */
.service1__item:hover .service1__item_flip-container {
    transform: rotateY(180deg);
}

/* Front and Back faces */
.service1__item_front,
.service1__item_back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    /* Match original radius */
    padding: 15px;
    /* Match original padding */
    box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.06);
    /* Match original shadow */
    display: flex;
    flex-direction: column;
}

/* Front Face Styling */
.service1__item_front {
    background-color: #fff;
    z-index: 2;
    transform: rotateY(0deg);
    justify-content: flex-start;
    /* Align items to the top to reduce gap */
}

/* Back Face Styling */
.service1__item_back {
    transform: rotateY(180deg);
    /* Gradient using site colors: Primary Blue (#135de8) to Secondary Cyan (#00bde0) */
    background: linear-gradient(135deg, #135de8 0%, #00bde0 100%);
    color: white;
    text-align: center;
    justify-content: center;
    /* Center content vertically on back */
}

/* Back Content Styling */
.service1__item_back_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.service1__item_back_content h4 {
    color: white;
    margin-bottom: 10px;
    font-size: 20px;
}

.service1__item_back_content p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.service1__item_back_content .btn1 {
    background-color: white;
    color: #085fac;
    font-size: 14px;
    padding: 10px 25px;
}

.service1__item_back_content .btn1:hover {
    background-color: #f0f0f0;
    color: #064a8a;
}

/* Icon sizing */
.service1__item_heading_thumb img {
    display: none;
}

/* Heading Text */
.service1__item_heading_text h3 {
    font-size: 20px;
    font-weight: bold;
    color: #2b2b2d;
    margin-bottom: 5px;
    text-align: center;
}

.service1__item_img {
    margin-top: 10px;
    /* Minimal gap between title and image */
}

/* Arrow styling on Front */
.service1__item_content {
    margin-top: auto;
    /* Push to bottom */
}

.service1__item_content a {
    width: 56px;
    height: 56px;
    line-height: 56px;
    text-align: center;
    background-color: #2b2b2d;
    display: inline-block;
    border-radius: 50%;
    color: #fff;
    transition: 0.3s;
}

.service1__item_content a:hover {
    background-color: #00bde0;
    /* Secondary color on hover */
    transform: scale(1.1);
}

/* Responsive adjustments */
@media only screen and (max-width: 575px) {

    .service1__item_front,
    .service1__item_back {
        padding: 40px;
    }
}

/* Additional responsive breakpoints for better scaling */

/* Below 1400px - Keep 3 cards in a row but resizing them */
@media only screen and (max-width: 1399px) {

    /* Override Bootstrap grid to force 3 columns (like desktop) but compressed */
    .row .col-xxl-4.col-md-6.col_padding {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }

    .service1__item {
        min-height: 400px;
        /* Reduced to remove excessive white space */
        max-width: 100%;
        /* Reset max-width */
    }

    .service1__item_img img {
        max-height: none;
        /* Remove height limit */
        width: 100%;
        object-fit: cover;
        border-radius: 8px;
    }

    .service1__item_front,
    .service1__item_back {
        padding: 12px;
        /* Tighter padding */
    }

    /* Adjust typography for smaller cards */
    .service1__item_heading_text h3 {
        font-size: 18px;
    }
}

/* Tablets (991px and below) */
@media only screen and (max-width: 991px) {
    .service1__item {
        min-height: 380px;
    }

    .service1__item_front,
    .service1__item_back {
        padding: 12px;
    }

    .service1__item_img img {
        max-height: 200px;
        width: 100%;
        object-fit: cover;
        border-radius: 10px;
    }

    .service1__item_heading_text h3 {
        font-size: 18px;
    }

    .service1__item_back_content h4 {
        font-size: 18px;
    }

    .service1__item_back_content p {
        font-size: 14px;
    }
}

/* Mobile landscape and small tablets (767px and below) */
@media only screen and (max-width: 767px) {
    .service1__item {
        min-height: 400px;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .service1__item_img img {
        max-height: 240px;
    }
}

/* Enhanced mobile portrait (575px and below) - override previous rule */
@media only screen and (max-width: 575px) {
    .service1__item {
        min-height: 420px;
    }

    .service1__item_front,
    .service1__item_back {
        padding: 20px;
    }

    .service1__item_img img {
        max-height: 260px;
    }
}