.other-projects-section {
    margin-top: 140px;
    background-color: #fff;
    position: relative; /* necesario para que ::before funcione */
}

/* Barra gris detrás de todo */
.other-projects-section::before {
    content: "";
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 65%;
    height: 750px;
    background-color: #FAFAFA;
    border-radius: 3px;
    z-index: 0;
    transition: height 0.3s ease, width 0.3s ease;
}

.other-projects-section h2 {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 12px;
    font-family: 'Lato', sans-serif;
    font-size: 3rem;
    font-weight: 500;
    color: #0f0f0f;
}

.other-projects-section p {
    font-size: 17px;
    z-index: 1;
    color: #0f0f0f;
    line-height: 1.4;
    margin: 0 auto 0;
    font-weight: 400;
    max-width: 500px;
    margin-bottom: -125px;
    text-align: center;
}

/* Grid de tarjetas */
.projects-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin: 0 auto;
}

.project-card {
    position: relative;
    z-index: 3;
    flex: 1;
    max-height: 800px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.project-card .project-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    padding: 20px 10px;
    text-align: center;
    color: var(--color-texto-claro);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
    letter-spacing: 2px;
}

.project-card .project-name h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 26px;
    text-transform: uppercase;
    margin: 0;
    line-height: 30px;
}

/* ================================= */
/*     Soporte para cambio de img    */
/* ================================= */

/* Por defecto (desktop) - mostrar solo imágenes desktop */
.img-mobile {
    display: none !important;
}

.img-desktop {
    display: block !important;
}

.img-universal {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================ */
/* Responsividad Tablets       */
/* ============================ */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 90vw;
    }

    .other-projects-section::before {
        height: 500px;
        width: 70%;
        top: -40px;
    }

    .project-card {
        max-height: 500px;
    }

    .other-projects-section h2 {
        font-size: 2.5rem;
    }

    .project-card .project-name h3 {
        font-size: 28px;
        line-height: 28px;
        padding: 10px 5px;
    }

    /* En tablets seguir mostrando imágenes desktop */
    .img-mobile {
        display: none !important;
    }

    .img-desktop {
        display: block !important;
    }
}

/* ============================ */
/* Móviles - Cambiar a imágenes móviles */
/* ============================ */
@media (max-width: 768px) {
    .other-projects-section::before {
        /* Ajustar altura de la barra gris para móviles */
        height: 850px; /* Aumentar para cubrir hasta el final de las imágenes */
        width: 90%;
        top: 50px; /* Mantener la posición de inicio */
    }
    .project-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* negro con 30% opacidad */
    z-index: 2; /* debajo del texto pero encima de la imagen */
}
    .other-projects-section {
        margin-top: 20px;
        padding-top: 0px;
        margin-bottom: 20px;
        padding-bottom: 0px;
    }

    .other-projects-section h2 {
        padding: 30px 0px;
        font-size: 2rem;
    }

    .other-projects-section p {
        font-size: 1rem;
        margin-bottom: 0px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        max-width: 95vw;
        gap: 15px;
    }

    .project-card {
        height: 250px;
        max-height: none;
    }

    .project-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .project-card .project-name {
        padding: 15px 8px;
    }

    .project-card .project-name h3 {
        font-size: 22px;
        line-height: 24px;
    }

    /* En móviles mostrar solo las imágenes móviles con opacidad */
    .img-desktop {
        display: none !important;
    }

    .img-mobile {
        display: block !important;
        width: 100%;
        height: 100%;
        object-fit: cover;

        transition: opacity 0.3s ease;
    }



/* Móviles pequeños */
@media (max-width: 600px) {
    .other-projects-section {
        padding: 60px 5vw;
        margin-top: 0px;
    }

    .other-projects-section h2 {
        font-size: 27px;
        text-align: center;
        letter-spacing: 1px;
    }

    .projects-grid {
        max-width: 95vw;
    }

    .other-projects-section::before {
        /* Ajustar altura para móviles pequeños */
        height: 950px; /* Altura ajustada para móviles pequeños */
        width: 95%;
    }
}