/* Services Section */
#services.services-section {
    background: #f8f9fa;
    position: relative;
}

#services .container-xxl {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

#services .py-5 {
    padding: 80px 0 !important;
}

#services .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Section Header */
#services .text-primary {
       display: inline-block;
    background: var(--primary-green, #28a745);
    color: #ffffff;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-radius: 4px;
    position: relative;
}

#services .display-5 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark, #1e3a5f);
}

/* Grid System */
#services .row {
    display: flex;
    flex-wrap: wrap;
    
}

#services .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

#services .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

#services .gy-5 > * {
    margin-bottom: 3rem;
}

#services .gx-4 > * {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Service Item */
#services .service-item {
    position: relative;
    margin: 80px 0 60px 0; /* Increased margins for element visibility */
    box-shadow: 0 0 45px rgba(0, 0, 0, 0.07);
    border-radius: 15px;
    overflow: visible; /* CHANGED: Allow overflow instead of hidden */
    height: 400px;
    transition: all 0.4s ease;
    background: #ffffff;
}


#services .service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.15);
}

/* Main Background Image */
#services .service-item > .img-fluid {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 15px; /* Match container radius */
    transition: all 0.4s ease;
}

#services .service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-green, #52c469);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    border-radius: 15px;
}
#services .service-item:hover::before {
    opacity: 0.7; /* Green overlay on hover */
}

#services .service-item:hover > .img-fluid {
    /* transform: scale(1.05); */
    filter: brightness(0.8);
}

/* Service Icon Image */
#services .service-item .service-img {
    position: absolute;
    width: 100px;
    height: 100px;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 4;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#services .service-item .service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Service Detail Container */
#services .service-item .service-detail {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 1;
}

/* Service Title */
#services .service-item .service-title {
    position: absolute;
    padding: 65px 30px 25px 30px;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #ffffff;
    transition: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
}

#services .service-item:hover .service-title {
    top: -100%;
}

#services .service-title hr {
    border-color: var(--primary-green, #52c469);
    border-width: 2px;
    opacity: 1;
}

#services .service-title h3 {
    color: var(--text-dark, #1e3a5f);
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.4;
}

/* Service Text */
#services .service-item .service-text {
    position: absolute;
    overflow: hidden;
    padding: 65px 30px 25px 30px;
    width: 100%;
    height: 100%;
    top: 100%;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(31, 95, 30, 0.5);
    transition: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
}

#services .service-item:hover .service-text {
    top: 0;
}

#services .service-text::before {
    position: absolute;
    content: "";
    width: 100%;
    height: 100px;
    top: -100%;
    left: 0;
    transform: skewY(-12deg);
    background: #ffffff;
    transition: 0.5s;
    z-index: -1;
}

#services .service-item:hover .service-text::before {
    top: -55px;
}

#services .service-text p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* Read More Button */
#services .service-item .btn {
    position: absolute;
    width: 140px;
    height: 55px;
    left: 50%;
    bottom: -27px; /* Outside container but visible */
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark, #1e3a5f);
    background: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 5; /* High z-index to appear above overlay */
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#services .service-item .btn:hover {
    color: #ffffff !important;
    background: var(--primary-green, #52c469);
    border-color: var(--primary-green, #52c469);
    transform: translateX(-50%) translateY(-8px);
    box-shadow: 0 15px 40px rgba(82, 196, 105, 0.4);
}
#services .gy-5 > * {
    margin-bottom: 5rem; /* Increased spacing between rows */
}

/* Responsive Design */
@media (max-width: 991.98px) {
    #services .col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 767.98px) {
    #services .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    #services .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    #services .py-5 {
        padding: 60px 0 !important;
    }
    
    #services .display-5 {
        font-size: 2rem;
    }
    
    #services .service-item {
        margin: 50px 0 25px 0;
        height: 280px;
    }
    
    #services .service-img {
        width: 110px;
        height: 110px;
        top: -55px;
    }
    
    #services .service-title,
    #services .service-text {
        padding: 55px 20px 20px 20px;
    }
    
    #services .service-title h3 {
        font-size: 1.1rem;
    }
    
    #services .service-text p {
        font-size: 14px;
    }
    
    #services .service-item .btn {
        width: 110px;
        height: 45px;
        font-size: 13px;
    }
}

@media (max-width: 575.98px) {
    #services .gx-4 > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    #services .service-item {
        height: 260px;
        margin: 45px 0 20px 0;
    }
    
    #services .service-img {
        width: 100px;
        height: 100px;
        top: -50px;
    }
    
    #services .service-title h3 {
        font-size: 1rem;
    }
}

/* Animation Classes */
.wow.fadeInUp {
    opacity: 0;
    animation-name: fadeInUp;
    animation-duration: 1s;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.fw-medium { font-weight: 500 !important; }
.text-uppercase { text-transform: uppercase !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.w-25 { width: 25% !important; }
.text-white { color: #ffffff !important; }
.text-center { text-align: center !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }


