.split-video-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: auto;
    min-height: clamp(350px, 30vw, 600px);
    max-height: 600px;
    width: 91%;
    max-width: 1760px;
    margin-block: clamp(16px, 4vw, 32px);
    margin-inline: auto;
    border-radius: 20px;
    box-sizing: border-box;
    background-size: cover;
    background-repeat: no-repeat;

    &.split-video-section--inverted {
        @media (min-width: 769px) {
            grid-template-columns: 1fr 1fr;
            direction: rtl;

            .split-video-section__content {
                direction: ltr;
                border-radius: 20px 0px 0px 20px;
                background-position: left;
            }

            .split-video-section__video-container {
                direction: ltr;

                .split-video-section__video-wrapper {
                    border-radius: 0 20px 20px 0;
                    overflow: hidden;
                }

                .split-video-section__video {
                    border-radius: 0 20px 20px 0;
                }
            }
        }
    }

    .split-video-section__video-container {
        position: relative;
        width: 100%;
        min-height: 100%;
        height: auto;
        overflow: hidden;

        .split-video-section__video {
            height: 101%;
            object-fit: cover;
            border-radius: 20px 0px 0px 20px;
        }
    }

    .split-video-section__content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        /* margin-left: clamp(20px, 4vw, 124px);
    /* margin-right: clamp(20px, 4vw, 124px); */
        padding-left: clamp(20px, 4vw, 124px);
        padding-right: clamp(20px, 4vw, 124px);
        padding-block: clamp(30px, 4vw, 80px);
        border-radius: 0px 20px 20px 0px;
        color: var(--color-dark-blue);

        .split-video-section__title {
            h2 {
                font-family: var(--font-corona);
                font-size: var(--title-h2);
                font-style: normal;
                font-weight: 600;
                line-height: normal;
                max-width: clamp(280px, 60vw, 580px);
                margin-bottom: clamp(8px, 2vw, 13px);
            }
        }

        .split-video-section__subtitle {
            font-family: var(--font-helvetica);
            font-size: var(--text-description);
            font-style: normal;
            font-weight: 500;
            line-height: normal;
            /* max-width: clamp(280px, 60vw, 580px); */
            max-width: 90%;
            margin-bottom: 20px;

            p {
                margin-bottom: 20px;

                &:last-child {
                    margin-bottom: 0;
                }
            }
        }

        .split-video-section__title h2 span {
            color: var(--color-yellow);
            display: block;
        }
    }

    .split-video-section__video-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        z-index: 1;
        border-radius: 20px 0px 0px 20px;

        @media (max-width: 768px) {
            border-radius: 20px !important;
        }
    }

    .split-video-section__video-poster {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 2;
        transition: opacity 0.4s;
    }

    .split-video-section__video {
        position: absolute;
        top: 50%;
        left: 50%;
        height: 120vh;
        width: 120vw;
        min-width: 100%;
        min-height: 100%;
        transform: translate(-50%, -50%);
        border: none;
        display: block;
        max-width: none;
        max-height: none;

        @media (max-width: 768px) {
            width: 200vw;
            height: 200vw;
        }
    }

    .split-video-section__video iframe {
        width: 100vw;
        height: 100vh;
        min-width: 100%;
        min-height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        border: none;
        display: block;
        pointer-events: none;
    }

    .split-video-section__video video {
        object-fit: cover;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .split-video-section {
        grid-template-columns: 1fr;
        gap: 0;
        width: 100%;
        max-height: unset;
        background-image: none !important;
        background-color: var(--color-white);
        padding-block: 32px;

        .split-video-section__video-container {
            aspect-ratio: 4/3;
            width: 95%;
            margin-inline: auto;
            height: 300px;

            .split-video-section__video,
            .split-video-section__video-poster {
                border-radius: 20px !important;
            }
        }

        .split-video-section__content {
            padding: 0;
            justify-content: flex-start;
            padding-top: 1rem;
            width: 95%;
            margin-inline: auto;
            background-image: none !important;
            background-color: var(--color-white);

            .split-video-section__title {
                font-size: 30px;
                margin-bottom: 13px;
                color: var(--color-dark-blue);
            }

            .split-video-section__subtitle {
                font-size: 17px;
                line-height: 1.2;
                font-weight: 400;
                color: var(--color-dark-blue);
                margin-bottom: 20px;
                max-width: 100%;
            }
        }
    }

    /* Span del título: flujo natural en mobile */
    .split-video-section__title h2 span {
        display: inline;
    }

    .split-video-section__video-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        z-index: 1;
    }
    .split-video-section__video {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 200vw;
        height: 200vw;
        min-width: 100%;
        min-height: 100%;
        transform: translate(-50%, -50%);
        border: none;
        display: block;
        max-width: none;
        max-height: none;
    }
    .split-video-section__video iframe {
        width: 200vw;
        height: 200vw;
    }
    .split-video-section__video video {
        object-fit: cover;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
    }
}

/* =============================================
   Animations
   ============================================= */
@keyframes fadeInLeftSplitVideo {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRightSplitVideo {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUpSplitVideo {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.split-video-section__video-container,
.split-video-section__content {
    opacity: 0;
}

/* Standard Layout (Video Left, Content Right) */
.split-video-section.is-animated .split-video-section__video-container {
    animation: fadeInLeftSplitVideo 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    @media (max-width: 768px) {
        animation: fadeInUpSplitVideo 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
}

.split-video-section.is-animated .split-video-section__content {
    animation: fadeInRightSplitVideo 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    @media (max-width: 768px) {
        animation: fadeInUpSplitVideo 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    }
}

/* Inverted Layout (Content Left, Video Right) */
.split-video-section.split-video-section--inverted.is-animated .split-video-section__video-container {
    animation: fadeInRightSplitVideo 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    @media (max-width: 768px) {
        animation: fadeInUpSplitVideo 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
}

.split-video-section.split-video-section--inverted.is-animated .split-video-section__content {
    animation: fadeInLeftSplitVideo 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    @media (max-width: 768px) {
        animation: fadeInUpSplitVideo 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    }
}

/* Home page: first split-video-section is already in viewport on load.
   JS adds .is-no-animation to skip any slide-in transition. */
.split-video-section.is-no-animation .split-video-section__video-container,
.split-video-section.is-no-animation .split-video-section__content {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
}
