section.home_content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    position: relative;

    picture.background_stars {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        pointer-events: none;

        img {
            width: 100%;
            height: 100%;
            object-fit: fill;
            object-position: center;
            image-rendering: auto;
        }
    }

    picture.background {
        position: absolute;
    }


    .banner {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        width: 100%;

        picture img {
            width: 100%;
            height: 80dvh;
            object-fit: contain;
        }

        picture.main-banner {
            width: 83%;
            z-index: 2;
        }

        picture.background.left {
            left: 0;
            z-index: 0;
        }
    }

    .raffles {
        position: relative;
        width: 100%;
        z-index: 1;

        .background_white {
            z-index: 2;
            width: 83%;
            max-width: 1400px;
            margin: auto;
            padding: 2rem;
            box-shadow: 0px 3px 49.5px 0px #0000003D;
            border-radius: 3rem;
            position: relative;

            picture.background_img {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                z-index: 0;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    border-radius: 3rem;
                }
            }

            h3,
            .expanding_cards {
                position: relative;
                z-index: 1;
            }
        }

        .background_img {
            position: absolute;
            z-index: 0;
            width: 100%;
            height: 120%;
            top: -4rem;
            left: 0;

            img {
                width: 100%;
                height: 100%;
            }
        }

        picture.background.right {
            right: 0;
            z-index: 0;
        }

        picture.background.right {
            right: 0;
            z-index: 0;
            top: -25%;
        }

        .selling_point {
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 2rem;
            margin: auto;
            width: 83%;
            padding: 3rem;

            .background_selling_points {
                position: absolute;
                width: 100%;
                height: 120%;
                top: -5rem;
                left: 0;
                z-index: 0;
                object-fit: cover;
                border-radius: 3rem;
            }

            h3.white_text {
                position: relative;
                z-index: 1;
            }

            a {
                position: relative;
                z-index: 1;
                padding: 1rem 3rem;
                color: var(--rojo);
                text-align: center;
                font-style: italic;
                font-weight: 700;
                border-radius: 45px;
                background: var(--blanco);
                text-decoration: none;
                font-size: 2rem;
                margin: auto;
            }
        }

    }

    .testimonials {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        width: 100%;
        position: relative;

        div {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            position: relative;
            width: 100%;
        }

        .second_block picture.background.right.star {
            right: 10%;
            top: 15%;
        }

        .second_block picture.background.right {
            right: 0;
            top: 57%;
        }

        .second_block picture.background.left {
            left: 10%;
            top: 60%;
        }

        video {
            height: fit-content;
            max-width: 85dvw;

        }

        picture.background.left {
            top: -10rem;
            left: 0;
            z-index: 0;
        }
    }

    .allies {
        width: 83%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;

        .allies_images {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            gap: 2rem;
            flex-wrap: wrap;

            img {
                width: 100%;
                height: auto;
                object-fit: contain;
                flex: 0 1 calc(25% - 1.5rem);
                max-height: 120px;
            }
        }
    }

    h3 {
        font-weight: 700;
        font-size: 2.5rem;
        color: var(--rojo);
        text-align: center;

        &.white_text {
            color: var(--blanco);
        }
    }

    h4 {
        font-weight: 400;
        font-style: Regular;
        font-size: 40px;
        color: var(--rojo);
        text-align: center;
    }
}

.expanding_cards {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
    margin: 3rem;
    min-height: 400px;

    .element {
        position: relative;
        border-radius: 2.5rem;
        display: flex;
        cursor: pointer;
        flex: 0 0 80px;
        transition: flex 0.4s cubic-bezier(.99, .08, .31, .84);
        overflow: hidden;

        .title_vertical_text {
            writing-mode: vertical-lr;
            transform: rotate(-180deg);
            text-align: left;
            margin: 2rem 1rem;
            cursor: pointer;
            white-space: nowrap;
        }

        /* .content_data span,
        .title {
            text-shadow: 3px 3px 3px var(--negro);
        } */

        .title {
            text-align: left;
            margin: 0 0 1rem 0;
            cursor: pointer;
            position: relative;
        }

        span {
            position: relative;
            z-index: 1;
            font-weight: 700;
            font-style: Italic;
            font-size: 2.5rem;
            color: var(--blanco);
            opacity: 0;
            animation: fadeIn .6s ease-in-out forwards;
        }

        .content_data {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            position: absolute;
            bottom: 2rem;
            left: 1rem;
            right: 1rem;
        }

        .content_data span {
            font-weight: 400;
            font-style: Regular;
            font-size: 30px;
            color: var(--blanco);
            animation-delay: 0.2s;
        }

        img {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            z-index: 0;
            border-radius: 2.5rem;
            object-fit: cover;
            transition: filter 0.4s ease-in-out;
            filter: brightness(.3);
        }
    }

    .element.expanded {
        flex: 1 1 0;
        flex-direction: column;
        align-items: baseline;
        justify-content: end;
        padding: 2rem 0;

        .title,
        .content_data {
            position: relative;
            left: 1rem;
            right: 1rem;
            bottom: auto;
        }

        .content_data {
            opacity: 1;
            margin: 0;
        }

        img {
            filter: brightness(.5);
            object-fit: cover;

        }
    }
}

.first_block h3 {
    margin-bottom: 0rem;
}

.second_block h4 {
    margin-top: 0rem;
}

section .third_block h4 {
    font-weight: bold;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Lazy loading styles */
.home_content img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.home_content img[loading="lazy"].loaded {
    opacity: 1;
}

/* Loading spinner para expanding cards e imágenes de fondo */
.expanding_cards .element:not(.loaded)::after,
.background_img:not(.loaded)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

.expanding_cards .element.loaded::after,
.background_img.loaded::after {
    opacity: 0;
    animation: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Aliados con fade-in suave */
.allies_images img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.allies_images img[loading="lazy"].loaded {
    opacity: 1;
}

/* Fondo de estrellas con fade-in */
.background_stars img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.background_stars img[loading="lazy"].loaded {
    opacity: 1;
}

/* Tablet */
@media (max-width: 1024px) {
    section.home_content {
        gap: 3rem;


        h3 {
            font-size: 2rem;
        }

        h4 {
            font-size: 2rem;
        }

    }

    .expanding_cards {
        margin: 2rem;
        min-height: 50dvh;

        .element {
            flex: 0 0 60px;

            span {
                font-size: 2.5rem;
            }

            .content_data {
                bottom: 1.5rem;
            }

            .content_data span {
                font-size: 1.5rem;
            }

            picture,
            img {
                border-radius: 2.5rem;
            }
        }
    }
}

/* Mobile */
@media (max-width: 768px) {
    section.home_content {

        .raffles {
            .background_white {
                padding: 1.5rem;

                picture.background_img {
                    opacity: 0;
                    transition: opacity 0.3s ease-in-out;
                }
            }

            .selling_point {
                padding: 2rem;

                .background_selling_points {
                    top: -3rem;
                }
            }
        }

        .allies {
            .allies_images {
                gap: 1.5rem;

                img {
                    flex: 0 1 calc(50% - 0.75rem);
                    max-height: 80px;
                }
            }
        }
    }

    /* Mostrar background cuando la página está lista */
    section.home_content.page-loaded {
        .raffles .background_white picture.background_img {
            opacity: 1;
        }
    }

    .expanding_cards {
        flex-direction: column;
        margin: 1.5rem;
        min-height: auto;
        gap: 0.75rem;

        .element {
            flex: 0 0 80px;
            min-height: 80px;
            max-height: 80px;
            transition: flex 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                min-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);

            .title_vertical_text {
                writing-mode: horizontal-tb;
                transform: rotate(0deg);
                text-align: center;
                margin: 1rem;
                position: static;
            }

            span {
                font-size: 1.5rem;
                opacity: 1;
                animation: none;
            }

            .content_data {
                bottom: 1.5rem;
                left: 1.5rem;
                right: 1.5rem;
            }

            .content_data span {
                font-size: 1.125rem;
            }

            picture img,
            img {
                border-radius: 2.5rem;
            }
        }

        .element.expanded {
            flex: 1 1 auto;
            min-height: 45dvh;
            max-height: 45dvh;
        }
    }

    .testimonials {
        max-width: 83%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    section.home_content {
        gap: 1rem;

        .raffles {
            .selling_point {
                padding: 1.5rem;

                .background_selling_points {
                    top: -2rem;
                }

                a {
                    font-size: 1.5rem;
                }
            }
        }

        h3 {
            font-size: 1.5rem;
        }

        h4 {
            font-size: 1.5rem;
            margin: 0;
        }

        .allies {
            gap: 1rem;

            .allies_images {
                gap: 2rem;
                flex-direction: column;
                justify-content: center;
                align-items: center;

                img {
                    max-height: 4rem;
                }
            }
        }

        .banner {

            picture img {
                height: 100%;
            }
        }
    }

    .expanding_cards {
        margin: 1rem;

        .element {
            flex: 0 0 60px;
            min-height: 60px;
            max-height: 60px;
            transition: flex 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                min-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);

            span {
                font-size: 1.20rem;
                max-width: 90%;
            }

            .title_vertical_text {
                margin: 0.75rem;
            }

            .content_data {
                bottom: 1rem;
                left: 1rem;
                right: 1rem;
            }

            .content_data span {
                font-size: 1rem;
            }
        }

        .element.expanded {
            flex: 1 1 auto;
            min-height: 35dvh;
            max-height: 35dvh;

            img {
                filter: brightness(.4);
                object-fit: fill;

            }
        }


    }
}