.services-section {
    padding: 60px 0;
    background-color: var(--services-section-bg-color);
    contain: layout style paint;
}

.services-section h2 {
    text-align: center;
    color: var(--paragraph-title-color);
    margin-bottom: 70px; /* Increased from 40px to 60px to add more space */
    text-transform: uppercase;
    font-weight: bold;
}

.services-grid {
    display: flex;
    flex-direction: column;
    gap: 40px; /* Increased from 30px to 40px for more space between rows */
    max-width: 1200px;
    margin: 0 auto;
}

.services-row {
    display: flex;
    justify-content: center;
    gap: 40px; /* Increased from 30px to 40px for more space between items */
}

.service-item {
    background-color: var(--service-item-bg-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    position: relative;
    flex: 1;
    max-width: 350px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.service-icon {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    /* Add these lines to make a perfect circle container */
    width: 72px;
    height: 72px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Hide anything outside the circle */
    transition: transform 0.3s ease;
}

.service-item:hover .service-icon {
    transform: translateX(-50%) scale(1.1);
}

.service-icon img {
    width: 80%;
    height: 80%;
    padding: 0; /* Remove padding */
    background-color: transparent; /* Remove background from image */
    border-radius: 0; /* Remove border radius from image */
    object-fit: cover; /* Make image cover the entire container */
    user-select: none; /* Prevent selection */
}

.service-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.service-content h3 {
    margin-top: 45px;
    margin-bottom: 15px;
}

.service-content p {
    margin-bottom: 0;
}

.service-item h3 {
    color: var(--service-item-color-title);
    font-size: 1.2rem;
    margin-top: 45px; /* Increased from 30px to 45px to add more space between icon and title */
    margin-bottom: 15px;
    font-weight: bold;
    text-transform: uppercase;
}

.service-item p {
    font-size: 1.1rem;
    color: var(--service-item-color-text);
    line-height: 1.4;
}

/* Responsive styles */
@media (max-width: 1140px) {
    .services-row {
        flex-wrap: wrap;
        gap: 45px; /* Further increased spacing for tablet view */
    }
    
    .service-item {
        min-width: 45%;
        padding: 20px 30px; /* Increased side padding for tablet view */
    }
    
    .services-section {
        padding: 60px 25px; /* Add horizontal padding to the section on tablets */
    }
    
    .services-grid {
        gap: 45px; /* Further increased row spacing for tablet */
    }
}

@media (max-width: 768px) {
    .service-item {
        min-width: 100%;
        max-width: 90%; /* Limit width to 90% of container on mobile */
        padding: 20px 30px; /* Further increased side padding for phones */
        margin-bottom: 10px; /* Reduced from 20px to 10px */
    }
    
    .services-row {
        flex-direction: column;
        align-items: center;
        gap: 35px; /* Reduced from 50px to 35px */
    }
    
    .services-section {
        padding: 30px 70px; /* More horizontal padding for phone view */
    }
    
    .services-grid {
        gap: 35px; /* Reduced from 50px to 35px */
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .service-item {
        padding: 20px 20px; /* Maximum side padding for very small screens */
        max-width: 95%;
    }
    .services-section
    {
        padding: 20px 30px; /* Reduced padding for very small screens */
    }
}
