.gallery-wrapper {
    position: relative;
    max-width: 1450px;
    width: 100%;
    margin: 0 auto;
}
.gallery-message {
    font-size: 1.2rem;
    text-align: center;
    padding-top: 85px;
}
.gallery-loader {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    border: 5px solid #eee;
    border-top-color: var(--red);
    transition: opacity .4s;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    transform: translateY(50px);
    opacity: 0;
    min-height: 500px;
    transition: transform .4s, opacity .4s;
}
.gallery-fade-in {
    transform: translateY(0);
    opacity: 1;
}
.gallery-fade-out {
    opacity: 0;
}
.gallery-item {
    position: relative;
    width: 24%;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px .5% 0;
}
.gallery-item img {
    width: auto;
    height: 115%;
    transition: opacity .4s, transform .4s;
}
.gallery-item img.vertical-img {
    width: 115%;
    height: auto;
}
.gallery-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    fill: #111;
    opacity: 0;
    transition: opacity .4s;
}
.gallery-item:hover .gallery-icon {
    opacity: 1;
}
.gallery-item:hover img {
    opacity: .6;
    transform: scale(1.05);
}

@media screen and (max-width: 1200px) {
    .gallery-item {
        width: 32.3333333333%;
    }
}

@media screen and (max-width: 900px) {
    .gallery-item {
        width: 49%;
    }
}

@media screen and (max-width: 600px) {
    .gallery-item,
    .gallery-item img {
        width: 100%;
        height: auto;
    }
}