section.md-mosaic {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 6rem;
    background-color: #222427;

    h1 {
        color: #fff;
    }

    ul {
        padding-top: 3rem;
        margin: 0;
        gap: 0;
        display: grid;
        list-style-type: none;
        width: 100%;
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: 1fr 1fr;
    }

    ul:has(li:nth-child(12)) {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
}

section.md-mosaic ul li {
    aspect-ratio: 1 / 1;
}

section.md-mosaic ul li a {
    display: flex;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

section.md-mosaic ul li a img {
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    z-index: 1;
    position: relative;
    object-fit: cover;
}

section.md-mosaic ul li a:hover img {
    transform: scale(1.05);
}


section.md-mosaic ul li a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 2;
}

section.md-mosaic ul li a:hover::before {
    opacity: 1;
}

section.md-mosaic ul li a::after {
    content: "\e922";
    font-family: "icomoon";
    font-weight: 100;
    color: white;
    font-size: 4rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 3;
}

section.md-mosaic ul li a:hover::after {
    opacity: 1;
}

@media screen and (max-width: 991px) {
    section.md-mosaic {
        padding-top: 8rem;
    }
    section.md-mosaic ul {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }

    section.md-mosaic ul:has(li:nth-child(12)) {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(auto-fill, 1fr);
    }
}

@media screen and (max-width: 767px) {
    section.md-mosaic ul {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, 1fr);
    }

    section.md-mosaic ul:has(li:nth-child(12)) {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(auto-fill, 1fr);
    }
}

/* Modal para mostrar imagen completa */
.production-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.production-modal.active {
    display: flex;
    opacity: 1;
}

.production-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: modalZoomIn 0.3s ease;
}

.production-modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.production-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 3rem;
    font-weight: 100;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.production-modal-close:hover {
    transform: scale(1.2);
}

.production-modal-loader {
    color: white;
    font-size: 2rem;
}

@keyframes modalZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}