:root {
    --title-web: 37px;
    --title-mobile: 20px;
}

#slider {
    padding-top: 20px;
    padding-bottom: 20px;
    margin-top: 60px;
    margin-bottom: 100px;
    height: 35vw;
    position: relative;
    perspective: 1000px;
    transform-style: preserve-3d;

    [type="radio"] {
        display: none;
    }

    label {
        margin: auto;
        width: 60%;
        height: 100%;
        border-radius: var(--border-radius);
        position: absolute;
        right: 0;
        left: 0;
        cursor: pointer;
        transition: transform 0.4s ease, z-index 0.4s ease;
        pointer-events: auto;

        img {
            width: 100%;
            height: 100%;
            border-radius: var(--border-radius);
        }
    }

    /* Slides traseros */
    #s1:checked ~ #slide4,
    #s2:checked ~ #slide5,
    #s3:checked ~ #slide1,
    #s4:checked ~ #slide2,
    #s5:checked ~ #slide3 {
        box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
        transform: scale(0.85) translateX(-30%);
        z-index: 1;
    }

    #s1:checked ~ #slide5,
    #s2:checked ~ #slide1,
    #s3:checked ~ #slide2,
    #s4:checked ~ #slide3,
    #s5:checked ~ #slide4 {
        box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.3),
            0 2px 2px 0 rgba(0, 0, 0, 0.2);
        transform: scale(0.95) translateX(-15%);
        z-index: 2;
    }

    /* Slide activo */
    #s1:checked ~ #slide1,
    #s2:checked ~ #slide2,
    #s3:checked ~ #slide3,
    #s4:checked ~ #slide4,
    #s5:checked ~ #slide5 {
        box-shadow: 0 13px 25px 0 rgba(0, 0, 0, 0.3),
            0 11px 7px 0 rgba(0, 0, 0, 0.19);
        transform: scale(1) translateX(0);
        z-index: 10;
    }

    /* Slides a los lados del activo */
    #s1:checked ~ #slide2,
    #s2:checked ~ #slide3,
    #s3:checked ~ #slide4,
    #s4:checked ~ #slide5,
    #s5:checked ~ #slide1 {
        box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.3),
            0 2px 2px 0 rgba(0, 0, 0, 0.2);
        transform: scale(0.95) translateX(15%);
        z-index: 2;
    }

    #s1:checked ~ #slide3,
    #s2:checked ~ #slide4,
    #s3:checked ~ #slide5,
    #s4:checked ~ #slide1,
    #s5:checked ~ #slide2 {
        box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
        transform: scale(0.85) translateX(30%);
        z-index: 1;
    }
}

.producto {
    margin-bottom: 80px;
    display: flex;
    will-change: transform, opacity; /* Fix renderizado Edge */

    .prod_info {
        width: 50%;
        padding: 10px;
        font-size: 19px;

        .texto {
            max-height: none;
            overflow: hidden;

            p {
                margin: 0 0 12px 0;
                text-align: justify; /* Justifica párrafos limpios */
            }

            p.titulo-producto {
                font-size: 1.1em;
            }

            ul {
                margin: 0 0 12px 0;
                padding-left: 20px;
                text-align: justify;

                li {
                    margin-bottom: 6px;
                }
            }
        }

        .aseguradoras {
            display: flex;
            height: 35px;
            filter: grayscale(100%);

            * {
                height: inherit;
                padding: 5px;
            }
        }

        .botones {
            display: flex;
            justify-content: flex-end;
            gap: 1em;
            margin-top: 15px;

            .ver-mas {
                display: none;
            }
        }
    }

    .prod_info.left {
        text-align: end;

        .aseguradoras {
            flex-direction: row-reverse;
        }
    }

    .prod_info.right {
        text-align: start;

        .aseguradoras {
            flex-direction: row;
        }
    }

    .trapecio-derecho,
    .trapecio-izquierdo {
        background: var(--gradient);
        display: flex;
        align-items: center;
        width: 50%;
        height: 400px;
        padding: 20px;
        position: relative;
        overflow: hidden;

        img {
            opacity: 15%;
            position: absolute; /* Reemplaza fixed para corregir el traba de scroll en Edge */
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            pointer-events: none;
        }

        p {
            color: var(--background-color);
            font-family: AllianzNeo-Bold;
            font-size: var(--title-web);
            margin: 0;
            padding: 0;
            width: 100%;
            z-index: 1;
        }
    }

    .trapecio-izquierdo {
        clip-path: polygon(0 0, 100% 0, 60% 100%, 0 100%);
        padding-right: 15%;

        p {
            text-align: left;
        }
    }

    .trapecio-derecho {
        clip-path: polygon(0 100%, 100% 100%, 100% 0, 40% 0);
        padding-left: 15%;

        p {
            text-align: right;
        }
    }
}

#sobre_mi {
    padding-left: 10px;
    display: flex;
    align-items: flex-end;

    img {
        max-width: 30%;
        height: auto;
    }

    div {
        > :first-child {
            font-size: var(--title-web);
            font-family: AllianzNeo-Bold;
            color: var(--primary-color);
            padding: 10px;
        }

        p {
            font-size: 2.5vw;
            color: var(--dark-gray);
            font-family: AllianzNeo-Regular;
            padding: 10px;
        }
    }
}

@media screen and (max-width: 700px) {
    #slider {
        margin-top: 0;
        margin-bottom: 60px;
        height: 44vw;

        label {
            width: 75%;
        }
    }

    #productos {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;

        .producto {
            width: 45%;
            min-height: 200px;
            margin-bottom: 3%;
            display: flex;
            flex-direction: column;
            justify-content: left;
            background-color: var(--light-gray);
            border-radius: var(--border-radius);
            box-shadow: 6px 6px 8px 0 rgba(0, 0, 0, 0.25);

            > * {
                width: 100%;
                padding: 2px;
                clip-path: unset;
                height: auto;
                text-align: unset;
            }

            .trapecio-derecho,
            .trapecio-izquierdo {
                border-radius: var(--border-radius) var(--border-radius) 0 0;
                padding: 50px 5px !important;
                height: 80px !important;
                overflow: hidden;

                p {
                    font-size: 2.5vw;
                    text-align: left;
                }

                img {
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    max-height: 137px;
                }
            }

            .prod_info {
                padding: 5px !important;
                font-size: 3vw;

                .texto {
                    font-size: 3vw;
                    max-height: 150px;
                    overflow: hidden;
                    scrollbar-width: none;
                    pointer-events: none;

                    p, ul {
                        text-align: justify;
                        margin-bottom: 6px;
                    }

                    ul {
                        padding-left: 15px;
                    }
                }

                .aseguradoras {
                    height: 25px;
                    flex-direction: row-reverse;
                }

                .botones {
                    display: flex;
                    flex-direction: column;

                    * {
                        width: 100%;
                    }

                    .ver-mas {
                        display: block;
                    }
                }
            }
        }

        .producto.right {
            flex-direction: column-reverse !important;
        }
    }

    #sobre_mi {
        img {
            max-width: 50% !important;
        }

        div {
            > :first-child {
                font-size: var(--title-mobile) !important;
            }

            p {
                font-size: 3vw;
            }
        }
    }

    /* Animación modal en móvil */
    #productos .producto.modal {
        transform: scale(0.9) translateY(20px);
        transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
        box-shadow: 0 0 0 10000px rgba(0, 0, 0, 0.7);
        background-color: var(--light-gray);

        .trapecio-derecho,
        .trapecio-izquierdo {
            p {
                font-size: 5vw;
            }
        }

        .prod_info {
            padding: 15px !important;
            font-size: 3.8vw;

            .texto {
                font-size: 3.8vw;
                max-height: none !important;

                p, ul {
                    text-align: justify;
                }
            }
        }
    }
}
