/* Styles for Servicios section
   - Four rows with intercalated text/image
   - Desktop: text ~75%, image ~25% (flex 3 / 1)
   - Mobile: stacked, image below text, 90% viewport width
   - Parallelogram background for text using ::before + inverse skew for content
   - Images clipped to a parallelogram shape (mirror depending on side)
*/

:root {
    /* Incrementado ~35% desde 8rem -> 11rem para encajar textos más largos */
    --service-height: 11rem; /* ajustable */
    --parallelogram-color: #f0f0f0; /* gris claro para el fondo inclinado */
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.service-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

/* Separación entre filas */
.service-row + .service-row {
    margin-top: 1.5rem;
}
.service-row:first-of-type {
    margin-top: 1.5rem;
}

/* Text 75% / Image 25% on desktop */
.service-text {
    flex: 3;
}
.service-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Parallelogram background for text block */
.parallelogram {
    position: relative;
    overflow: visible;
    width: calc(100% + 5rem);
    margin-left: -2.5rem;
}
.parallelogram::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 0;
    bottom: 0;
    right: -2.5rem;
    background: var(--parallelogram-color);
    transform: skew(-12deg);
    transform-origin: left center;
    border-radius: 6px;
    z-index: 0;
}
.parallelogram .parallelogram-content {
    position: relative;
    z-index: 1;
    padding: 1.25rem 1.25rem;
    transform: skew(-12deg);
}
.parallelogram h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}
.parallelogram p {
    margin: 0;
    line-height: 1.5;
}

.service-text .parallelogram-content {
    min-height: var(--service-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Image styles */
.service-image img {
    width: 100%;
    height: var(--service-height);
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

/* Clip the image to a parallelogram shape */
.service-image.right img {
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}
.service-image.left img {
    clip-path: polygon(0 0, 90% 0, 100% 100%, 10% 100%);
}

/* Reverse the order for even rows */
.service-row.reverse {
    flex-direction: row-reverse;
}
.service-row.reverse .parallelogram::before {
    transform: skew(12deg);
}
.service-row.reverse .parallelogram .parallelogram-content {
    transform: skew(12deg);
}

/* ================================================= */
/* ============ MOBILE: FULL CORRECTION ============ */
/* ================================================= */
@media (max-width: 768px) {
    /* Reset padding en contenedores padres */
    .fruite.py-5,
    .contact.py-0,
    .container.py-0 {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .row.g-4 > .col-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Cada fila de servicio: ancho del 90% del viewport */
    .service-row {
        display: block !important;
        width: 90vw !important;
        max-width: none !important;
        margin: 1.25rem auto !important;
        padding: 0 !important;
        box-sizing: border-box;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .service-text,
    .service-image {
        width: 100% !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    /* Eliminar paralelogramo */
    .parallelogram {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
    }

    .parallelogram::before {
        display: none !important;
    }

    .parallelogram .parallelogram-content {
        transform: none !important;
        padding: 1rem !important;
        background-color: var(--parallelogram-color);
        border-radius: 8px;
        margin: 0 !important;
    }

    /* Imagen SIEMPRE debajo del texto */
    .service-text {
        order: 1 !important;
    }
    .service-image {
        order: 2 !important;
        margin-top: 0.75rem !important;
        text-align: center !important;
    }

    .service-image img {
        clip-path: none !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        max-height: 220px;
        object-fit: cover;
        border-radius: 6px;
        display: block !important;
        margin: 0 auto !important;
    }

    /* Evitar scroll horizontal */
    body, html {
        overflow-x: hidden !important;
    }
}




/* Estilo para el indicador de video en las imágenes */
.service-image {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.service-image:hover {
    transform: scale(1.02);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 6px;
    z-index: 2;
}

.service-image:hover .video-overlay {
    opacity: 1;
}

.video-overlay i {
    color: white;
    background: rgba(0, 0, 0, 0.7);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}



/* Eliminar borde blanco y fondo del modal de video */
#videoModal .modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#videoModal .modal-body {
    padding: 0 !important;
    background: transparent !important;
}

/* Eliminar cualquier fondo del contenedor del iframe */
#videoModal .ratio {
    background: transparent !important;
}