.__header__house {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.__header__house h2 {
    margin-bottom: 0px;
}

.sparkles h2 {
    margin-top: 0px;
}

h2 {
    color: #DF0037;
    text-align: center;
    font-size: 40px;
    font-weight: 700;
}

.sparkles {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.__run {
    margin-top: 20px;
    color: #FFF;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border-radius: 41px;
    border: 5px solid #FFA800;
    background: #DF0037;
    min-width: 350px;
}

.__run:hover {
    background: #FFA800;
    border: 5px solid #DF0037;
    cursor: pointer;
}

.gallery-container {
    padding: 20px;
    background-color: #ffffff;
}

.gallery-container-mobile {
    display: none;
    padding: 20px;
    background-color: #ffffff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 150px);
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    position: relative;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.gallery-item img[loading="lazy"] {
    background: transparent;
}

.gallery-item img.loaded,
.gallery-item img[complete] {
    opacity: 1;
}

/* Efecto de carga para imágenes */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0.5;
    z-index: 1;
    transition: opacity 0.3s ease-in-out;
}

.gallery-item.loaded::before {
    opacity: 0;
    animation: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Distribución tipo mosaico con proporciones específicas */
/* 1.png - Horizontal */
.gallery-item-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

/* 2.png - Vertical alargada */
.gallery-item-2 {
    grid-column: 3 / 5;
    grid-row: 1 / 4;
}

/* 3.png - Horizontal */
.gallery-item-3 {
    grid-column: 5 / 7;
    grid-row: 1 / 2;
}

/* 4.png - Horizontal como 1.png */
.gallery-item-4 {
    grid-column: 1 / 3;
    grid-row: 3 / 5;
}

/* 5.png - Vertical alargada como 2.png */
.gallery-item-5 {
    grid-column: 3 / 5;
    grid-row: 4 / 7;
}

/* 6.png - Vertical alargada como 5.png */
.gallery-item-6 {
    grid-column: 5 / 7;
    grid-row: 2 / 5;
}

/* 7.png - Horizontal como 1.png y 4.png */
.gallery-item-7 {
    grid-column: 1 / 3;
    grid-row: 5 / 7;
}

/* 8.png - Horizontal en la parte inferior derecha */
.gallery-item-8 {
    grid-column: 5 / 7;
    grid-row: 5 / 7;
}

/* Mosaico exclusivo para mobile (9 imágenes) */
.gallery-container-mobile .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 90px;
    grid-auto-flow: dense;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto;
}

.gallery-container-mobile .gallery-item-1 {
    grid-column: 1;
    grid-row: span 2;
}

.gallery-container-mobile .gallery-item-2 {
    grid-column: 2;
    grid-row: span 3;
}

.gallery-container-mobile .gallery-item-3 {
    grid-column: 1;
    grid-row: span 2;
}

.gallery-container-mobile .gallery-item-4 {
    grid-column: 2;
    grid-row: span 2;
}

.gallery-container-mobile .gallery-item-5 {
    grid-column: 1;
    grid-row: span 3;
}

.gallery-container-mobile .gallery-item-6 {
    grid-column: 2;
    grid-row: span 3;
}

.gallery-container-mobile .gallery-item-7 {
    grid-column: 1;
    grid-row: span 2;
}

.gallery-container-mobile .gallery-item-8 {
    grid-column: 2;
    grid-row: span 2;
}

.gallery-container-mobile .gallery-item-9 {
    grid-column: 1 / 3;
    grid-row: span 2;
}

/* Responsive */
@media (width <=1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 10px;
    }

    /* Columna izquierda: Horizontales (1, 3, 4, 7, 8) */
    .gallery-item-1 {
        grid-column: 1 / 2;
        grid-row: auto;
        min-height: 250px;
    }

    .gallery-item-3 {
        grid-column: 1 / 2;
        grid-row: auto;
        min-height: 250px;
    }

    .gallery-item-4 {
        grid-column: 1 / 2;
        grid-row: auto;
        min-height: 250px;
    }

    .gallery-item-7 {
        grid-column: 1 / 2;
        grid-row: auto;
        min-height: 250px;
    }

    .gallery-item-8 {
        grid-column: 1 / 2;
        grid-row: auto;
        min-height: 250px;
    }

    /* Columna derecha: Verticales (2, 5, 6) */
    .gallery-item-2 {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        min-height: 500px;
    }

    .gallery-item-5 {
        grid-column: 2 / 3;
        grid-row: 3 / 5;
        min-height: 500px;
    }

    .gallery-item-6 {
        grid-column: 2 / 3;
        grid-row: 5 / 7;
        min-height: 500px;
    }
}

@media (width <=768px) {
    .gallery-container {
        display: none;
    }

    .gallery-container-mobile {
        display: block;
        padding: 10px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 8px;
    }

    .gallery-container .gallery-item {
        grid-column: 1 !important;
        grid-row: auto !important;
        min-height: 200px;
    }

    /* Orden: 1, 2, 3, 4, 5, 6, 7, 8 */

    .gallery-container-mobile .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 8px;
    }

    .gallery-container-mobile .gallery-item {
        grid-column: 1 !important;
        grid-row: auto !important;
        min-height: 200px;
    }
}

@media (width <=480px) {
    .gallery-container {
        padding: 10px;
    }

    .gallery-container-mobile {
        padding: 8px;
    }

    .gallery-grid {
        gap: 5px;
    }

    .gallery-item {
        min-height: 180px;
    }

    .gallery-container-mobile .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 6px;
    }

    .gallery-container-mobile .gallery-item {
        grid-column: 1 !important;
        grid-row: auto !important;
        min-height: 180px;
    }

    .__run {
        min-width: 270px;
    }
}