/* ========================================================================= */
/* --- INTERACTIVE SERVICE MATRIX: SERVICES REDESIGN --- */
/* ========================================================================= */

.services-section-new {
    background-color: #f8f9fa;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.services-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.services-subtitle {
    font-size: 1.2rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
}

.service-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-node {
    position: relative;
    cursor: pointer;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-tap-highlight-color: transparent;
}

.service-node-content {
    background: #ffffff;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.4s ease;
}

.service-icon {
    width: 180px; /* Increased size */
    height: 180px; /* Increased size */
    margin: 0 auto 20px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

.service-icon img {
    width: 120px; /* Increased size */
    height: 120px; /* Increased size */
    object-fit: contain;
}

.service-node-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    transition: color 0.4s ease;
}

.service-node-details {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #28a745, #34c759);
    color: #fff;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s ease;
    pointer-events: none;
}

/* Hide mobile details on desktop */
.service-node-details-mobile {
    display: none;
}

@media (hover: hover) {
    .service-node:hover .service-node-details {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }
}

.service-node.active .service-node-details {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.details-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.details-desc {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.details-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid #fff;
    transition: all 0.3s ease;
}

.details-link:hover {
    color: #fff;
    padding-bottom: 2px;
}

/* ========================================================================= */
/* --- MOBILE OPTIMISATIONS (EXPANDABLE CARD) --- */
/* ========================================================================= */
@media (max-width: 767px) {
    .services-section-new {
        padding: 60px 0;
    }

    .services-title {
        font-size: 2rem;
    }

    .services-subtitle {
        font-size: 1rem;
    }

    .service-matrix {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-node {
        background: #ffffff;
        padding: 25px 20px;
        transition: background 0.4s ease;
    }

    .service-node-content {
        padding: 0;
        background: transparent !important; /* Ensure content background is transparent */
    }

    .service-icon {
        width: 130px; /* Increased mobile size */
        height: 130px; /* Increased mobile size */
        margin-bottom: 15px;
        transition: max-height 0.5s ease-in-out, opacity 0.3s ease, margin-bottom 0.5s ease;
        max-height: 130px; /* Match height */
        opacity: 1;
    }

    .service-icon img {
        width: 80px; /* Increased mobile size */
        height: 80px; /* Increased mobile size */
    }

    .service-node-title {
        font-size: 1.4rem;
        transition: color 0.4s ease;
    }

    /* Hide desktop overlay on mobile */
    .service-node .service-node-details {
        display: none;
    }

    /* Show mobile details container */
    .service-node-details-mobile {
        display: block;
        color: #fff;
        text-align: center;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transform: translateY(-10px);
        transition: max-height 0.6s ease-in-out, opacity 0.4s ease-in-out, transform 0.5s ease-in-out, margin-top 0.6s ease-in-out;
    }

    /* --- ACTIVE STATE ON MOBILE --- */

    .service-node.active {
        background: linear-gradient(45deg, #28a745, #34c759);
    }

    /* Ensure the content wrapper is also transparent when active */
    .service-node.active .service-node-content {
        background: transparent !important;
    }

    .service-node.active .service-node-title {
        color: #fff;
        margin-bottom: 10px; /* Add some space below title when active */
    }

    .service-node.active .service-icon {
        max-height: 0;
        opacity: 0;
        margin-bottom: 0;
        overflow: hidden;
    }

    .service-node.active .service-node-details-mobile {
        max-height: 1000px; /* Large value to allow expansion */
        opacity: 1;
        transform: translateY(0);
        margin-top: 10px;
    }

    .service-node-details-mobile .details-title {
        display: none; /* Hide duplicate title */
    }

    .service-node-details-mobile .details-desc {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .service-node-details-mobile .details-link {
        display: inline-block;
        padding: 10px 24px;
        border: 2px solid #fff;
        border-radius: 50px;
        text-decoration: none;
        font-weight: 600;
    }
}
