/* Services Flip Cards Section */
.services-flip {
    padding: 120px 0;
    background: white;
    position: relative;
}

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

.services-header {
    text-align: center;
    margin-bottom: 80px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.services-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 400;
    color: #2d2926;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.services-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #5a5550;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 60px;
    width: 100%;
}

/* Title below card */
.service-title-below {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: #2d2926;
    text-align: center;
    margin: 15px 0 0 0;
    position: absolute;
    bottom: -45px;
    left: 0;
    right: 0;
    letter-spacing: 0.5px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    opacity: 0.9;
}

/* Force 4 columns on desktop */
@media (min-width: 901px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Service Card Container */
.service-flip-card {
    width: 100%;
    height: 400px;
    position: relative;
    cursor: pointer;
    perspective: 1000px !important;
    -webkit-perspective: 1000px !important;
    margin-bottom: 60px;
}

/* Inner Container for 3D Flip */
.service-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s ease !important;
    -webkit-transition: -webkit-transform 0.8s ease !important;
    transform-style: preserve-3d !important;
    -webkit-transform-style: preserve-3d !important;
    border-radius: 15px;
}

/* Hover Effect - Flip the Card */
.service-flip-card:hover .service-flip-inner {
    transform: rotateY(180deg) !important;
    -webkit-transform: rotateY(180deg) !important;
}

/* Front and Back Face Positioning */
.service-flip-front, .service-flip-back {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    -moz-backface-visibility: hidden !important;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Front Face - Image */
.service-flip-front {
    background: white;
    transform: rotateY(0deg) !important;
    -webkit-transform: rotateY(0deg) !important;
    z-index: 2;
}

.service-flip-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 15px;
}

/* Title Overlay on Front */
.service-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px 20px 20px;
    color: white;
    z-index: 3;
}

.service-title-overlay h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Back Face - Description */
.service-flip-back {
    background: #f0ede8 !important;
    color: #5a5550;
    transform: rotateY(180deg) !important;
    -webkit-transform: rotateY(180deg) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 25px 20px;
    z-index: 1;
    position: relative;
}

.service-content {
    text-align: center;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.service-icon {
    margin-bottom: 15px;
    background: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-icon i {
    font-size: 1.8rem;
    color: #c9a96e;
    opacity: 1;
}

.service-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0 0 15px 0;
    color: #2d2926;
}

.service-content p {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 18px 0;
    color: #5a5550;
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-features li {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    margin: 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a5550;
}

.service-features li i {
    margin-right: 8px;
    font-size: 0.75rem;
    color: #c9a96e;
}

/* Animation on scroll */
.service-flip-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.service-flip-card:nth-child(1) { animation-delay: 0.1s; }
.service-flip-card:nth-child(2) { animation-delay: 0.2s; }
.service-flip-card:nth-child(3) { animation-delay: 0.3s; }
.service-flip-card:nth-child(4) { animation-delay: 0.4s; }

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

/* Responsive Design */
@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .service-flip-card {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .services-flip {
        padding: 80px 0;
    }
    
    .services-container {
        padding: 0 15px;
    }
    
    .services-header {
        margin-bottom: 50px;
    }
    
    .services-header h2 {
        font-size: 2.4rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-top: 40px;
    }
    
    .service-flip-card {
        height: 320px;
    }
    
    .service-content {
        padding: 20px;
    }
    
    .service-content h3 {
        font-size: 1.3rem;
    }
    
    .service-content p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .services-header h2 {
        font-size: 2rem;
    }
    
    .services-subtitle {
        font-size: 0.9rem;
    }
    
    .service-flip-card {
        height: 300px;
    }
    
    .service-title-overlay h3 {
        font-size: 1.2rem;
    }
    
    .service-content h3 {
        font-size: 1.2rem;
    }
    
    .service-content p {
        font-size: 0.8rem;
    }
    
    .service-features li {
        font-size: 0.8rem;
    }
}
