.services-section {
    padding: 3rem 1.5rem;
    background-color: #F8FAFC;
    text-align: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2A235F;
    margin-bottom: 2rem;
    position: relative;
    font-family: 'Inter', sans-serif;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #2A235F, #4B5EAA);
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
    border-radius: 2px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    width: 100%;
    height: 260px;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.8s ease;
    -webkit-transition: -webkit-transform 0.8s ease;
    will-change: transform;
    -webkit-will-change: transform;
}

.service-card:hover .card-inner {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 1rem;
    box-sizing: border-box;
}

.card-front {
    background-size: cover;
    background-position: center;
    background-color: #2A235F;
    color: #FFFFFF;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
    transform: rotateY(0deg) translateZ(1px);
    -webkit-transform: rotateY(0deg) translateZ(1px);
}

.card-front h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    font-family: 'Inter', sans-serif;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.card-back {
    background-color: #FFD700;
    color: #1F2937;
    transform: rotateY(180deg) translateZ(1px);
    -webkit-transform: rotateY(180deg) translateZ(1px);
    z-index: 1;
}

.card-back p {
    font-size: 0.9rem;
    margin: 0 0 1rem;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
    text-align: center;
    padding: 0 0.5rem;
}

.btn-details {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: #2A235F;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, transform 0.2s ease;
    -webkit-transition: background-color 0.3s ease, -webkit-transform 0.2s ease;
}

.btn-details:hover {
    background-color: #473ba5;
    transform: translateY(-2px);
    -webkit-transform: translateY(-2px);
}

.no-services {
    font-size: 1.1rem;
    color: #6B7280;
    margin-top: 1.5rem;
    font-family: 'Inter', sans-serif;
}

/* Safari Specific Fixes */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .card-inner {
        -webkit-backface-visibility: visible;
        backface-visibility: visible;
    }
    
    .service-card {
        -webkit-perspective: 1000;
    }
}

/* Responsive */

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .service-card {
        height: 220px;
    }

    .card-front h3 {
        font-size: 1.3rem;
    }

    .card-back p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .services-section {
        padding: 2rem 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .service-card {
        height: 200px;
    }
}
.card-inner {
    transition: transform 0.8s ease;
    -webkit-transition: -webkit-transform 0.8s ease;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.card-inner.flipped {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}
