.list-services {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 40px;
    margin-bottom: 50px;

    .service {
        flex: 1;
        max-width: 25vw;
        height: 250px;
        position: relative;

        @media (max-width: 768px) {
            max-width: none;
            min-width: 50%;
        }

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .caption {
            position: absolute;
            top: 50%;
            left: 50%;
            font-size: 2rem;
            transform: translate(-50%, -50%);
            width: 100%;
            color: white;
            text-align: center;
        }
    }
}

.service-page {

    .service-intro {
        padding: 0px 0 30px;

        .intro-content {
            max-width: 800px;
            margin: 0 auto;
        }
    }

    .service-cards {
        padding: 50px 0;

        .title {
            text-align: center;
            color: var(--front-primary);
            margin-bottom: 3rem;
            font-size: 3rem;
        }

        .cards-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);

            &.cols-5 {
                grid-template-columns: repeat(5, 1fr);

                .card-item h3 {
                    font-size: 1.4rem;
                }

                @media (max-width: 1200px) {
                    grid-template-columns: repeat(3, 1fr);
                }
            }

            gap: 2rem;

            @media (max-width: 991px) {
                grid-template-columns: repeat(2, 1fr);
            }

            @media (max-width: 576px) {
                grid-template-columns: 1fr;
            }

            .card-item {
                background: #F9F4F1;
                border: 1px solid #EBE3DC;
                padding: 2.5rem 2rem;
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                transition: transform 0.3s ease;
                min-height: 250px;

                &:hover {
                    transform: translateY(-5px);
                }

                .card-icon {
                    width: 40px;
                    height: 40px;
                    margin-bottom: 1.5rem;
                    color: var(--front-primary);
                }

                h3 {
                    color: var(--front-primary);
                    margin-bottom: 1rem;
                }

                p {
                    color: #555;
                    margin: 0;
                }
            }
        }
    }


    .service-prestation {
        background-color: var(--front-primary);
        padding: 5rem 0;
        color: white;
        position: relative;
        padding: 50px 20px 50px;

        .prestation-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 4rem;
            max-width: 1000px;
            margin: 0 auto;

            @media (max-width: 991px) {
                flex-direction: column;
                gap: 3rem;
            }
        }

        .prestation-card {
            flex: 0 0 300px;
            height: 400px;
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;

            .decoration {
                position: absolute;
                bottom: -32px;
                left: -67px;
                width: 96px;
                height: 124px;
                background-image: url("../../../images/bastideco-initial-white-wmbiOvb.svg");
                background-repeat: no-repeat;
                background-size: contain;
                z-index: 0;
            }

            .splide__track,
            .splide__list,
            .splide__slide {
                height: 100%;
                z-index: 1;
            }

            li {
                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
        }

        .prestation-details {
            flex: 1;

            h2,
            h3,
            p,
            span,
            li {
                color: white;
            }

            h2,
            h3 {
                margin-top: 0;
            }

            .small-text {
                font-size: 1rem;
                margin-top: 0.5rem;
            }
        }
    }

    .service-gallery {
        padding: 5rem 0;
        display: flex;
        gap: 4rem;
        align-items: flex-start;
        scroll-margin-top: 150px;

        @media (max-width: 991px) {
            flex-direction: column;
        }

        &.reverse {
            flex-direction: row-reverse;

            @media (max-width: 991px) {
                flex-direction: column;
            }
        }

        .gallery-text {
            flex: 0 0 45%;

            h3 {
                font-family: 'Playfair Display', serif;
                font-size: 2rem;
                margin-bottom: 1.5rem;
            }

            .description {
                font-size: 1rem;
                line-height: 1.6;
                color: #666;

                h2,
                h3 {
                    margin-top: 0;
                }
            }
        }

        .gallery-grid {
            flex: 1;
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;

            .grid-item {
                width: 90px;
                height: 90px;
                background: #f0f0f0;
                overflow: hidden;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    transition: transform 0.3s;
                }

                &:hover img {
                    transform: scale(1.05);
                }
            }
        }
    }

    .service-steps {
        padding: 50px 0;

        .section-title {
            text-align: center;
            color: var(--front-primary);
            font-size: 3rem;
            margin-bottom: 5rem;
        }

        .steps-grid {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 2rem;

            .step-item {
                position: relative;
                padding-left: 0.5rem;
                max-width: 300px;

                .step-number {
                    font-size: 9rem;
                    line-height: 0.7;
                    color: transparent;
                    font-family: "Libre Baskerville", serif;
                    -webkit-text-stroke: 1px #aaa;
                    position: absolute;
                    left: -2rem;
                    top: -1.7rem;
                    z-index: 1;
                    opacity: 0.5;
                }

                .step-content {
                    position: relative;
                    z-index: 2;
                    padding-left: 2rem;

                    h3 {
                        font-weight: bold;
                        margin-bottom: 1rem;
                        color: #000;
                    }

                    p {
                        color: #444;
                    }
                }
            }
        }
    }

    .services-block-text {
        padding: 5rem 0;

        &.has-background-secondary {
            background-color: var(--front-secondary);
        }
    }

    .gallery-grid .grid-item {
        cursor: pointer;
    }
}

.gallery-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;

    &.active {
        display: flex;
    }

    .close-modal {
        position: absolute;
        top: 20px;
        right: 35px;
        color: #f1f1f1;
        font-size: 40px;
        font-weight: bold;
        transition: 0.3s;
        cursor: pointer;
        z-index: 1001;

        &:hover,
        &:focus {
            color: #bbb;
            text-decoration: none;
            cursor: pointer;
        }
    }

    .gallery-splide {
        width: 80%;
        max-width: 1200px;
        max-height: 90vh;

        @media (max-width: 768px) {
            width: 95%;
        }

        .splide__track {
            overflow: visible;
        }

        .splide__slide {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 80vh;

            img {
                max-width: 100%;
                max-height: 100%;
                width: auto;
                height: auto;
                object-fit: contain;
                border-radius: 4px;
            }
        }

        .splide__arrow {
            background: rgba(255, 255, 255, 0.2);
            width: 3rem;
            height: 3rem;

            svg {
                fill: white;
                width: 1.5rem;
                height: 1.5rem;
            }

            &:hover {
                background: rgba(255, 255, 255, 0.4);
            }
        }
    }
}