/* --- Service Section --- */
.service-detail-section {
    padding: 80px 0;
    position: relative;
    overflow: visible !important;
    /* ✅ CRITICAL - prevents sticky from breaking */
    min-height: 100vh;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* --- Container --- */
.service-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: flex-start;
    gap: 60px;
    position: relative;
    /* Removed overflow and transform that can break sticky */
}

/* Reverse layout */
.service-container.reverse {
    flex-direction: row-reverse;
}

/* --- Text Content --- */
.service-text-content {
    flex: 1;
    z-index: 1;
    min-height: 150vh;
    /* ✅ ensures enough scroll height for sticky to work */
}

/* --- Sticky Image --- */
.service-image-wrapper {
    flex: 0 0 45%;
    /* Fixed width instead of flex: 1 for better control */
    position: -webkit-sticky;
    /* Safari support */
    position: sticky;
    top: 120px;
    /* Space from top when stuck */
    align-self: flex-start;
    z-index: 2;
    height: fit-content;
    /* Important for sticky to work */
    max-height: calc(100vh - 140px);
    /* Prevents image from being too tall */
}

/* --- Image Styling --- */
.service-image-wrapper img {
    width: 100%;
    max-width: 520px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.5s ease;
}

.service-image-wrapper:hover img {
    transform: scale(1.02);
}

/* --- Typography --- */
.service-label {
    font-size: 14px;
    letter-spacing: 2px;
    color: #D32F2F;
    font-weight: 500;
    margin-bottom: 20px;
}

.service-title {
    font-size: 42px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 30px;
    text-transform: uppercase;
    color: white;
}

.service-description {
    font-size: 14px;
    line-height: 1.8;
    color: #888;
    margin-bottom: 10px;
}

/* --- Highlights --- */
.service-highlights {
    list-style: none;
    padding: 0;
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.service-highlights li {
    display: flex;
    gap: 10px;
    color: #ddd;
    font-size: 15px;
}

.service-highlights li i {
    color: #D32F2F;
}

/* --- Mobile Fix --- */
@media (max-width: 991px) {

    body,
    html {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .service-detail-section {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .service-container,
    .service-container.reverse {
        flex-direction: column;
        gap: 40px;
        padding: 0 20px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .service-image-wrapper {
        position: sticky;
        top: 80px;
        width: 100%;
        max-width: 100%;
    }

    .service-image-wrapper img {
        width: 100%;
        max-width: 100%;
        max-height: 400px;
        object-fit: cover;
    }

    .service-title {
        font-size: 36px;
        word-wrap: break-word;
    }
}

@media (max-width: 768px) {

    body,
    html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .service-detail-section {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 60px 0;
    }

    .service-container {
        padding: 0 15px;
        gap: 30px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .service-text-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .service-title {
        font-size: 28px;
        margin-bottom: 20px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .service-label {
        font-size: 12px;
        margin-bottom: 15px;
    }

    .service-description {
        font-size: 13px;
        line-height: 1.7;
        margin-bottom: 8px;
        word-wrap: break-word;
    }

    .service-highlights {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    .service-highlights li {
        font-size: 14px;
        word-wrap: break-word;
    }

    .service-image-wrapper {
        position: sticky;
        top: 60px;
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .service-image-wrapper img {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 200px;
        max-height: 280px;
        object-fit: cover;
        object-position: center;
        display: block;
    }
}

/* --- Critical Fixes for Sticky Positioning --- */
@media (min-width: 992px) {

    /* 1. Disable will-change/filter on content wrapper as it breaks sticky */
    #page-content {
        will-change: auto !important;
        transition: none !important;
        overflow: visible !important;
    }

    /* 2. Ensure all parents up to body/html allow overflow */
    body,
    html {
        overflow-x: visible !important;
    }

    /* 3. Ensure the detail section is visible */
    .service-detail-section {
        overflow: visible !important;
        position: relative;
    }

    /* 4. Ensure the container doesn't restrict height */
    .service-container {
        height: auto !important;
        align-items: flex-start !important;
    }
}