
body.closing {
    animation: closePage 0.5s forwards;
}

@keyframes closePage {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Descripción del proyecto */
.project-description {
    padding: 0;
    font-family: 'Dosis', sans-serif;
    font-size: 1.2rem;
    color: #bbb;
    text-align: left;
    margin: 2rem 0 0;
    width: 100%;
}
.swiper-main {
    position: relative;
    width: 100%;
    display: flex;
    padding: 2rem 4rem 0;
    height: 100%;
    align-items: center;
}

@media (max-width: 800px) {
    .swiper-main {
        padding: 2rem 0 0;
    }
    .swiper-button-prev, .swiper-rtl .swiper-button-next {
        display: none !important;
    }
    .swiper-button-next, .swiper-rtl .swiper-button-prev {
        display: none !important;
    }
}

/* Ajustar el contenedor principal */
.swiper-container { 
    width: 100%;
    height: auto; /* Ajusta la altura automáticamente */
    overflow: hidden; /* Evita desbordes */
    margin: 0 auto; /* Centrar horizontalmente */
    padding: 0; /* Eliminar cualquier padding adicional */
}

/* Ajustar las diapositivas */
.swiper-slide {
    display: flex; /* Para centrar el contenido */
    justify-content: center;
    align-items: center;
}

/* Imágenes y vídeos dentro del carrusel */
.swiper-slide img,
.swiper-slide video {
    width: 100%; /* Ocupar todo el ancho disponible */
    height: auto; /* Mantener proporción */
    max-height: 30rem; /* Limitar la altura máxima al 80% del viewport */
    object-fit: contain; /* Ajustar contenido sin recortar */
    border-radius: 1rem;
}

.swiper-slide img {
    cursor: zoom-in;
}

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#lightbox.open {
    display: flex;
}

#lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    max-height: 90dvh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    user-select: none;
}

#lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 2.5rem;
    line-height: 1;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    z-index: 1;
}

#lightbox-close:hover {
    opacity: 1;
}

#lightbox-prev,
#lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    cursor: pointer;
    padding: 1.2rem 0.9rem;
    opacity: 0.85;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 1;
    user-select: none;
}

#lightbox-prev {
    left: 0;
    border-radius: 0 0.4rem 0.4rem 0;
}

#lightbox-next {
    right: 0;
    border-radius: 0.4rem 0 0 0.4rem;
}

#lightbox-prev:hover,
#lightbox-next:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.55);
}

#lightbox.single #lightbox-prev,
#lightbox.single #lightbox-next {
    display: none;
}

@media (max-width: 768px) {
    #lightbox-img {
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    #lightbox-close {
        top: 0.5rem;
        right: 0.75rem;
        font-size: 2.8rem;
        padding: 0.25rem 0.5rem;
    }

    #lightbox-prev,
    #lightbox-next {
        padding: 1.5rem 0.75rem;
        font-size: 1.5rem;
        opacity: 0.65;
    }
}

.swiper-button-prev, .swiper-rtl .swiper-button-next {
    left: var(--swiper-navigation-sides-offset, 0) !important;
}

.swiper-button-next, .swiper-rtl .swiper-button-prev {
    right: var(--swiper-navigation-sides-offset, 0) !important;
}

.swiper-pagination {
    position: static !important;
    margin-top: 1rem;
}
/* Paginación del carrusel */
.swiper-pagination-bullet {
    background-color: rgba(255, 255, 255, 0.35);
    width: 12px;
    height: 12px;
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background-color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
    }

    main {
        flex: 1;
        display: flex !important;
        flex-direction: column;
        padding: 0 !important;
        min-height: 0;
    }

    .swiper-main {
        flex: 1;
        min-height: 0;
        padding: 0;
        align-items: stretch;
    }

    .swiper-container {
        height: 100%;
    }

    .swiper-slide {
        height: 100% !important;
    }

    .swiper-slide img,
    .swiper-slide video {
        width: 100%;
        height: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 0;
    }

    .project-description {
        padding: 1.5rem 1.25rem;
    }
}
