#contactMain {
    width: 201px;
    height: 66px;
    background: #FFFFFF 0 0 no-repeat padding-box;
    border-radius: 19px;
    opacity: 1;
    text-align: center;
    font: normal normal medium 20px/33px IBM Plex Sans;
    letter-spacing: 0;
    color: #4540E1;
}


#ImgHead {
    margin-bottom: -36em;

    div {
        height: 480px;
        background: #4540E1;
    }

    h1 {
        width: 100% !important;
        font-size: 60px;
        margin-bottom: 0.5em;
    }

    p {
        font-size: 20px;
        max-width: 90%; /* Prevent text overflow */
    }

    img {
        border-radius: 2em;
        max-height: 75%;
        max-width: 75%;
        margin: auto;
    }
}


.text-blue {
    color: #4540E1 !important;
}

.btnConseil {
    background: #4540E1 !important;
    color: white !important;
    padding: 1em 2em !important;
    border-radius: 1em !important;
    font-weight: bold !important;
}





.gridHeader {
    position: relative;
    top: -480px;
    background: transparent !important;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    grid-column-gap: 20px;
    height: 480px; /* Match the height of the container */
    overflow: hidden; /* Prevent content overflow */
}

.header-background {
    background-image: url('../img/offre-conseil.png') !important;
    background-position: center right !important;
    background-repeat: no-repeat !important;
    background-size: cover !important; /* Changed back to cover for full height */
    height: 100%; /* Ensure full height */
}

.gridHeader > div:nth-child(1) {
    background: transparent !important;
    /*width: 75%;*/
    /*margin: auto;*/
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%; /* Ensure full height */
    overflow: hidden; /* Changed from auto to hidden to remove scrollbar */
}

p.text-white {
    margin-top: 1em;
}

h1.text-white {
    margin-top: 0;
}


h3, h4 {
    color: #0B034F;
}

p, ul {
    color: #585880 !important;
}


#AnalyseBesoin, #RessourcesTechnologiques, #RedirectToContact {
    background-color: #EEEEFD;
}


#conseilTech {
    padding-bottom: 6em !important;
    margin-top: 9em;
}

#RedirectToContact {
    padding-bottom: 10em;
    padding-top: 5em !important;
}

.grid222 {
    display: grid;
    grid-template-columns: repeat(2, minmax(auto, 1fr));
    grid-template-rows: repeat(1, minmax(auto, 1fr));
    grid-column-gap: 60px;
    grid-row-gap: 60px;



}


#conseilCards {
    width: fit-content;
    margin: 4em auto auto auto;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    grid-column-gap: 3em;
    grid-row-gap: 6em;


    h2 {
        font-size: 1.75em !important;
        margin-bottom: 1em !important;
        margin-top: 1em !important;
    }

    p {
        font-size: 1em !important;
    }
}

#conseilCards > div {
    max-width: 562px;
}

#conseilCards img {
    max-width: 100%;
    height: auto;
}

.cardConseil {
    padding: 50px;
    background: #FFFFFF 0 0 no-repeat padding-box;
    box-shadow: 0 0 40px #0000000F;
    border-radius: 14px;
    max-width: 100%;

    > h4 {
        font-size: 23px;
        font-weight: bold;
    }

    > p {
        font-size: 17px;
    }

}

#imgCardConseil {
    width: 100%
    /*width: 690px !important;*/
    /*height: 460px !important;*/
}

.cardConseilIcon {
    height: 90px;
    width: 90px;
}

h2 {
    color: #0B034F;
}


@media screen and (max-width: 1200px) {
    /* Removed the 1600px breakpoint that was hiding the image too early */
    .gridHeader {
        grid-template-columns: 1.2fr 0.8fr; /* Adjust the grid to give more space to the text */
        height: 480px; /* Maintain full height */
    }
    
    .gridHeader > div:nth-child(1) {
        width: 95%;
        padding: 1.5rem;
    }
    
    #ImgHead h1 {
        font-size: 50px;
        margin-bottom: 0.5em;
    }
    
    #ImgHead p {
        font-size: 18px;
        max-width: 95%; /* Prevent text overflow */
    }
}

@media screen and (max-width: 1280px) {
    /* Hide the background image under 1280px */
    .header-background {
        background-image: none !important;
    }
    
    .gridHeader {
        grid-template-columns: 1fr; /* Single column layout */
    }
    
    .gridHeader > div:nth-child(1) {
        width: 90%;
        text-align: center;
        margin: auto;
    }
    
    #ImgHead div {
        background: #4540E1; /* Ensure blue background is visible */
    }
    
    /* Make conseilCards responsive */
    #conseilCards {
        width: 90%;
        grid-column-gap: 2em;
        grid-row-gap: 4em;
    }
    
    #conseilCards h2 {
        font-size: 1.5em !important;
    }
}

@media screen and (min-device-width: 992px) and (max-device-width: 1199px) {
    /* Make conseilCards responsive */
    #conseilCards {
        width: 95%;
        grid-column-gap: 2em;
        grid-row-gap: 4em;
    }
    
    #conseilCards h2 {
        font-size: 1.4em !important;
    }
    
    #conseilCards p {
        font-size: 0.9em !important;
    }
    
    #conseilCards .btn {
        font-size: 16px !important;
    }
}

@media screen and (min-device-width: 768px) and (max-device-width: 991px) {
    #ImgHead {
        & div {
            height: 400px; /* Increased from 360px for better visibility */
        }

        h1 {
            font-size: 40px;
            margin-bottom: 0.5em;
        }
        
        p {
            max-width: 95%; /* Prevent text overflow */
        }
    }

    .gridHeader {
        top: -400px; /* Adjusted to match the new height */
        height: 400px; /* Match container height */
    }

    #conseilTech {
        margin-top: 14em;
    }

    .grid222 {
        display: flex;
        flex-direction: column;
    }

    .cardConseilIcon {
        height: 80px;
        width: 80px;
    }

    #RedirectToContact {
        div {
            h2 {
                font-size: 31px !important;
            }
        }
    }
    
    /* Make conseilCards responsive */
    #conseilCards {
        width: 90%;
        grid-template-columns: 1fr; /* Change to single column */
        grid-template-rows: auto;
        grid-row-gap: 3em;
    }
    
    #conseilCards > div {
        max-width: 100%;
    }
    
    #conseilCards h2 {
        font-size: 1.5em !important;
    }
}

@media screen and (min-device-width: 576px) and (max-device-width: 767px) {
    #ImgHead {
        & div {
            height: 400px; /* Increased from 360px */
        }

        h1 {
            font-size: 35px;
            margin-bottom: 0.5em;
        }

        p {
            font-size: 17px;
            max-width: 95%; /* Prevent text overflow */
        }
    }

    .gridHeader {
        top: -400px; /* Adjusted to match the new height */
        height: 400px; /* Match container height */
        grid-template-columns: 1fr; /* Changed from 2fr 1fr to 1fr for full width */
    }
    
    .header-background {
        background-image: none !important; /* Hide the background image */
    }
    
    .gridHeader > div:nth-child(1) {
        width: 90%;
        text-align: center;
        margin: auto;
    }

    #conseilTech {
        margin-top: 14em;
    }

    .grid222 {
        display: flex;
        flex-direction: column;
    }

    .cardConseilIcon {
        height: 50px;
        width: 50px;
    }

    #RedirectToContact {
        div {
            h2 {
                font-size: 23px !important;
            }
        }
    }
    
    /* Make conseilCards responsive */
    #conseilCards {
        width: 90%;
        grid-template-columns: 1fr; /* Change to single column */
        grid-template-rows: auto;
        grid-row-gap: 3em;
    }
    
    #conseilCards > div {
        max-width: 100%;
    }
    
    #conseilCards h2 {
        font-size: 1.4em !important;
    }
    
    #conseilCards p {
        font-size: 0.9em !important;
    }
    
    #conseilCards .btn {
        font-size: 16px !important;
    }
}

@media screen and (max-device-width: 575px) {
    #ImgHead {
        & div {
            height: 400px;
        }

        h1 {
            font-size: 35px;
            margin-bottom: 0.5em;
        }

        p {
            font-size: 17px;
            max-width: 95%; /* Prevent text overflow */
        }
    }

    .gridHeader {
        top: -400px;
        height: 400px; /* Match container height */
        display: block;
        background-color: #4540E1 !important; /* Ensure blue background when image is hidden */
    }
    
    .header-background {
        background-image: none !important; /* Only hide the image at very small screens */
    }
    
    .gridHeader > div:nth-child(1) {
        width: 90%;
        text-align: center;
        padding: 1rem;
    }

    #conseilTech {
        margin-top: 12em;

        div {
            width: 100% !important;
        }
    }

    .grid222 {
        display: flex;
        flex-direction: column;
    }

    .cardConseil {

        padding: 1.5em;
    }

    .cardConseilIcon {
        height: 50px;
        width: 50px;
    }


    #RedirectToContact {
        div {
            flex-direction: column;
            row-gap: 1em;

            div {
                width: 80% !important;
                margin: auto;
            }

            h2 {
                text-align: center;
                width: 100% !important;
                font-size: 23px !important;
            }

            p {
                width: 100% !important;
                font-size: 17px !important;
            }
        }
    }

    .buttonStd {
        padding: 0.5em;
    }
    
    /* Make conseilCards responsive */
    #conseilCards {
        width: 95%;
        grid-template-columns: 1fr; /* Change to single column */
        grid-template-rows: auto;
        grid-row-gap: 2.5em;
    }
    
    #conseilCards > div {
        max-width: 100%;
    }
    
    #conseilCards h2 {
        font-size: 1.3em !important;
    }
    
    #conseilCards p {
        font-size: 0.9em !important;
    }
    
    #conseilCards .btn {
        font-size: 16px !important;
        padding: 0.8em 1.5em !important;
    }
}

/* Styles for the conseilFormation section */
#conseilFormation {
    padding-top: 12em;
    padding-bottom: 12em;
    background-color: #F5F5F5;
}

#conseilFormation .bg-white {
    border-radius: 2em;
    overflow: hidden;
}

#conseilFormation .w-50:first-child {
    position: relative;
    overflow: hidden;
}

#conseilFormation img {
    object-fit: cover;
    height: 100%;
    width: 100%;
    object-position: center;
}

#conseilFormation h2 {
    color: #0B034F;
}

#conseilFormation p {
    color: #585880 !important;
}

/* Engagements section styles */
#conseilFormation .d-flex[style*="margin-top:12em"] {
    margin-top: 12em !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    width: 75% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#conseilFormation .d-flex[style*="margin-top:12em"] .w-50:first-child {
    width: 30% !important;
}

#conseilFormation .d-flex[style*="margin-top:12em"] .w-50:last-child {
    width: 70% !important;
}

#conseilFormation .d-flex[style*="margin-top:12em"] h2 {
    color: #0B034F;
    font-size: 2rem !important;
    margin-bottom: 1.5rem !important;
    font-weight: bold;
}

#conseilFormation .d-flex[style*="margin-top:12em"] .w-66 {
    width: 100% !important;
    margin: 0 !important;
    padding-right: 2rem;
}

#conseilFormation .d-flex[style*="margin-top:12em"] .w-75 {
    width: 100% !important;
    margin-bottom: 1.5rem !important;
    display: flex;
    align-items: center;
    margin-left: 2rem !important;
}

#conseilFormation .d-flex[style*="margin-top:12em"] img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    margin-right: 1rem;
}

/* Responsive styles for engagements section */
@media screen and (max-width: 991px) {
    #conseilFormation .d-flex[style*="margin-top:12em"] {
        flex-direction: column !important;
        margin-top: 8em !important;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-50:first-child,
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-50:last-child {
        width: 100% !important;
        margin-bottom: 2rem;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-66 {
        width: 90% !important;
        margin: 0 auto !important;
        padding-right: 0;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-75 {
        width: 90% !important;
        margin: 0 auto 1.5rem auto !important;
    }
}

@media screen and (max-width: 767px) {
    #conseilFormation .d-flex[style*="margin-top:12em"] {
        margin-top: 6em !important;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] h2 {
        font-size: 1.75rem !important;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] p {
        font-size: 16px !important;
    }
}

@media screen and (max-width: 575px) {
    #conseilFormation .d-flex[style*="margin-top:12em"] {
        margin-top: 4em !important;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] h2 {
        font-size: 1.5rem !important;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-66,
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-75 {
        width: 95% !important;
    }
}

@media screen and (max-width: 1200px) {
    #conseilFormation {
        padding-top: 8em;
        padding-bottom: 8em;
    }
    
    #conseilFormation > .w-75 {
        width: 85% !important;
    }
    
    #conseilFormation .ps-5,
    #conseilFormation .pe-5 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

@media screen and (max-width: 991px) {
    #conseilFormation {
        padding-top: 6em;
        padding-bottom: 6em;
    }
    
    #conseilFormation > .w-75 {
        width: 90% !important;
    }
    
    #conseilFormation > .w-75.d-flex.flex-row {
        flex-direction: column !important;
    }
    
    #conseilFormation > .w-75.d-flex.flex-row > .w-50 {
        width: 100% !important;
    }
}

@media screen and (max-width: 767px) {
    #conseilFormation {
        padding-top: 4em;
        padding-bottom: 4em;
    }
    
    #conseilFormation > .w-75 {
        width: 95% !important;
    }
    
    #conseilFormation .gap-5 {
        gap: 1.5rem !important;
    }
    
    /* Engagements section responsive */
    #conseilFormation .d-flex[style*="margin-top:12em"] {
        flex-direction: column !important;
        margin-top: 6em !important;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-50 {
        width: 100% !important;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-66 {
        width: 90% !important;
    }
    
    #conseilFormation .d-flex[style*="margin-top:12em"] .w-75 {
        width: 90% !important;
        margin: 0 auto;
    }
    
    #conseilFormation h2 {
        font-size: 1.75rem !important;
    }
    
    #conseilFormation p {
        font-size: 16px !important;
    }
    
    #conseilFormation .btnConseil {
        font-size: 16px !important;
        padding: 0.8em 1.5em !important;
    }
}

@media screen and (max-width: 575px) {
    #conseilFormation {
        padding-top: 3em;
        padding-bottom: 3em;
    }
    
    #conseilFormation > .w-75 {
        width: 100% !important;
        border-radius: 0;
    }
    
    #conseilFormation .bg-white {
        border-radius: 0;
    }
    
    #conseilFormation .gap-5 {
        gap: 1rem !important;
    }
    
    #conseilFormation h2 {
        font-size: 1.5rem !important;
    }
    
    #conseilFormation .ps-5,
    #conseilFormation .pe-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
