/* ═══════════════════════════════════════════════════════════════
   services.css — Services Section
   ═══════════════════════════════════════════════════════════════ */

.services-section {
    position: relative;
    padding: var(--space-section-py) var(--space-section-px);
    background-color: var(--color-dark-bg);
    background-image: url("../assets/service-section/service-section-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: center;
    overflow: hidden;
}

.services-container {
    position: relative;
    z-index: var(--z-normal);
    max-width: 1600px;
    margin: 0 auto;
    /* padding: 0 var(--space-section-px); */
}

/* ── Label ── */
.section-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}

.section-label img {
    filter: brightness(0) invert(1);
}

.flipped {
    transform: scaleX(-1);
}

.section-label span {
    font-family: var(--font-heading);
    font-size: var(--label-span-font-size);
    font-weight: var(--label-span-font-weight);
    letter-spacing: var(--label-span-letter-spacing);
    color: var(--color-white);
    text-transform: uppercase;
}

/* ── Heading ── */
.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--color-white);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 56px;
    line-height: 1.1;
}

/* ── Grid ── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: clamp(20px, 4vw, 60px);
    justify-content: center;
}

/* ── Card ── */
.service-card {
    background: var(--color-bg-card-alt);
    color: var(--color-text-dark-body);
    padding: 32px 20px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    position: relative;
    transition:
        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease;
    overflow: hidden;
}

.service-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

/* ── Icon blob ── */
.service-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 22px;
    background: linear-gradient(135deg, #3b82f6, var(--color-primary-hover));
    border-radius: 38% 62% 55% 45% / 45% 45% 55% 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
    transition: all 0.4s ease;
    cursor: pointer;
}

.service-card:hover .service-icon {
    animation:
        morph 6s ease-in-out infinite,
        floatUp 0.4s ease forwards;
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.6);
}

.service-icon svg,
.service-icon img {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: var(--color-white);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-icon svg.filled {
    fill: var(--color-white);
    stroke: none;
}

.service-card h3 {
    font-family: var(--font-kanit);
    font-weight: 700;
    font-size: 28px;
    color: var(--color-text-dark-body);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.service-card p {
    font-family: var(--font-inter);
    font-weight: 500;
    font-size: 16px;
    color: var(--color-text-card-body);
    line-height: 1.6;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */

/* ══════════════════════════════
   NEW SERVICES CARDS HOVER EFFECT
══════════════════════════════ */

.service-card-wrapper {
    transition: box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card-wrapper:hover {
    box-shadow: 0px 8px 28px rgba(0, 131, 207, 0.12), 0px 3px 14px rgba(0, 0, 0, 0.08) !important;
}

/* Image zoom effect on hover - stays contained within overflow:hidden container */
.service-card-wrapper:hover .collapsed-content img {
    transform: scale(1.08);
}

/* Disable hover effect when expanded */
.service-card-wrapper[data-expanded="true"]:hover .collapsed-content img {
    transform: scale(1);
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */

@media (max-width: 1600px) and (min-width: 1280px) {
    .services-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }

    .service-card {
        padding: 30px 16px 24px;
    }

    .service-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 18px;
    }

    .service-icon svg,
    .service-icon img {
        width: 26px;
        height: 26px;
    }

    .service-card h3 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .service-card p {
        font-size: 14px;
        line-height: 1.5;
    }
}

@media (max-width: 1279px) and (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1023px) and (min-width: 601px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        min-height: 280px; /* Ensure cards have proper height on mobile */
    }
    
    .service-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }
    
    .service-icon svg,
    .service-icon img {
        width: 26px;
        height: 26px;
    }
    
    .service-card h3 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .service-card p {
        font-size: 14px;
        line-height: 1.5;
    }
}

@media (max-width: 400px) {
    .service-card {
        min-height: 260px;
        padding: 24px 16px 20px;
    }
    
    .service-icon {
        width: 52px;
        height: 52px;
        margin-bottom: 14px;
    }
    
    .service-icon svg,
    .service-icon img {
        width: 24px;
        height: 24px;
    }
    
    .service-card h3 {
        font-size: 18px;
    }
    
    .service-card p {
        font-size: 13px;
    }
}


/* ══════════════════════════════════════════════════════════════
   SERVICES SECTION ANIMATIONS
══════════════════════════════════════════════════════════════ */

/* Only hide elements BEFORE animation starts (controlled by JS) */
#services.before-animation .mb-\[10px\],
#services.before-animation h2,
#services.before-animation .service-card-wrapper {
    opacity: 0;
}

#services.before-animation .mb-\[10px\] {
    transform: translateY(20px);
}

#services.before-animation h2 {
    transform: translateY(20px);
}

#services.before-animation .service-card-wrapper {
    transform: translateY(30px) scale(0.95);
}

/* Transitions - Slower and more elegant for header */
#services .mb-\[10px\] {
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#services h2 {
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.3s;
}

#services .service-card-wrapper {
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stagger animation for cards */
#services .service-card-wrapper:nth-child(1) {
    transition-delay: 0.2s;
}

#services .service-card-wrapper:nth-child(2) {
    transition-delay: 0.25s;
}

#services .service-card-wrapper:nth-child(3) {
    transition-delay: 0.3s;
}

#services .service-card-wrapper:nth-child(4) {
    transition-delay: 0.35s;
}

#services .service-card-wrapper:nth-child(5) {
    transition-delay: 0.4s;
}

#services .service-card-wrapper:nth-child(6) {
    transition-delay: 0.45s;
}

/* Animated state - elements return to normal */
#services.animate-in .mb-\[10px\],
#services.animate-in h2,
#services.animate-in .service-card-wrapper {
    opacity: 1;
    transform: none;
}


/* ══════════════════════════════════════════════════════════════
   "OUR PROCESS" SECTION - SLOWER ANIMATIONS
══════════════════════════════════════════════════════════════ */

/* Hide "Our Process" section before animation */
#services.before-animation .text-left .mb-\[10px\] {
    opacity: 0;
    transform: translateY(25px);
}

#services.before-animation .text-left h2 {
    opacity: 0;
    transform: translateY(25px);
}

#services.before-animation .process-step {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
}

/* Slower animations for "Our Process" badge */
#services .text-left .mb-\[10px\] {
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Slower animations for "Here's How It Works?" heading */
#services .text-left h2 {
    transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.4s;
}

/* Process steps with stagger */
#services .process-step {
    transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.0s cubic-bezier(0.16, 1, 0.3, 1);
}

#services .process-step:nth-child(2) {
    transition-delay: 0.6s;
}

#services .process-step:nth-child(3) {
    transition-delay: 0.7s;
}

#services .process-step:nth-child(4) {
    transition-delay: 0.8s;
}

#services .process-step:nth-child(5) {
    transition-delay: 0.9s;
}

/* Animated state */
#services.animate-in .text-left .mb-\[10px\],
#services.animate-in .text-left h2,
#services.animate-in .process-step {
    opacity: 1;
    transform: none;
}
