.services-section {
    position: relative;
    background-image: url('../img/banner/6.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff;
    text-align: center;
    padding: 50px 20px;
}

.services-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(249 244 233);
    z-index: 1;
}

.services-section * {
    position: relative;
    z-index: 2;
}

.services-section h2 {
    color: #040404;
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: bold;
}

.services-section .sub-heading {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: #000;
}

/* Service Card Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default: 3 cards in a row */
    gap: 20px;
    justify-items: center;
}

/* Apply margin-left to the first card when there are exactly 2 cards */
.services-grid > .service-card:nth-last-child(2):first-child {
    margin-left: 10%; /* Adds margin-left to the first card when only 2 cards are present */
}

/* Service Card Styling */
.service-card {
    background: #fff;
    color: #333;
    border-radius: 0px 0px 150px 150px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
    height: auto;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 1-3 cards per row based on screen size */
    }

    /* Reset margin-left on smaller screens */
    .services-grid > .service-card:nth-last-child(2):first-child {
        margin-left: 0; /* Reset margin for smaller screens */
    }
}



.service-card:hover {
    transform: translateY(-10px);
}

.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #000;
    font-weight: 700;
    margin-left: 8%;
}

.card-content p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
    text-align: justify;
    padding: 8%;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .services-section h2 {
        font-size: 2rem;
    }

    .services-section .sub-heading {
        font-size: 1rem;
    }

    .service-card img {
        height: 180px;
    }

    .card-content h3 {
        font-size: 1.3rem;
    }

    .card-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .services-section h2 {
        font-size: 1.8rem;
    }

    .services-section .sub-heading {
        font-size: 0.9rem;
    }

    .service-card {
        max-width: 90%;
        height: auto;
    }

    .service-card img {
        height: 160px;
    }

    .card-content h3 {
        font-size: 1.2rem;
    }

    .card-content p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .services-section {
        padding: 30px 10px;
    }

    .services-section h2 {
        font-size: 1.5rem;
    }

    .services-section .sub-heading {
        font-size: 0.8rem;
    }

    .service-card {
        width: 100%;
        max-width: 320px;
        height: 100%;
        border-radius: 0px 0px 80px 80px;
    }

    .card-content h3 {
        font-size: 1.1rem;
    }

    .card-content p {
        font-size: 0.8rem;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
    }
}