#custom-lightbox {
    align-items: center;
    display: none;
    height: 100vh;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 0;
    width: 100vw;
    z-index: 9999;
}

#custom-lightbox.active {
    display: flex;
}

#custom-lightbox .lightbox-overlay {
    background: rgba(0, 0, 0, 0.72);
    height: 100vh;
    left: 0;
    opacity: 0;
    position: absolute;
    top: 0;
    transition: opacity 0.2s;
    width: 100vw;
}

#custom-lightbox.visible .lightbox-overlay {
    opacity: 1;
}

#custom-lightbox .lightbox-content {
    align-items: center;
    display: flex;
    justify-content: center;
    max-height: 90vh;
    max-width: 90vw;
    position: relative;
    z-index: 10;
}

#custom-lightbox .lightbox-image {
    border-radius: 10px;
    max-height: 70vh;
    max-width: 70vw;
    opacity: 0;
    transition: opacity 0.2s, transform 0s;
}

#custom-lightbox.visible:not(.loading):not(.error) .lightbox-image {
    opacity: 1;
}

#custom-lightbox .lightbox-loader {
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    border-top-color: #fff;
    display: none;
    height: 42px;
    left: 50%;
    margin-left: -21px;
    margin-top: -21px;
    position: absolute;
    top: 50%;
    width: 42px;
    z-index: 12;
    animation: mbmProductLightboxSpin 0.8s linear infinite;
}

#custom-lightbox.loading .lightbox-loader {
    display: block;
}

#custom-lightbox .lightbox-error {
    color: #fff;
    display: none;
    font-size: 15px;
    margin: 0;
    max-width: 320px;
    text-align: center;
}

#custom-lightbox.error .lightbox-error {
    display: block;
}

#custom-lightbox .lightbox-arrow {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 2rem;
    height: 4rem;
    justify-content: center;
    margin: 2rem;
    transition: background 0.2s;
    width: 4rem;
}

#custom-lightbox .lightbox-arrow:hover,
#custom-lightbox .lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

#custom-lightbox .lightbox-close {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 2rem;
    height: 3rem;
    justify-content: center;
    line-height: 1;
    position: fixed;
    right: 20px;
    top: 20px;
    transition: background 0.2s;
    width: 3rem;
    z-index: 12;
}

.mbm-product-lightbox-open {
    overflow: hidden;
}

#product_thumbnails .product-thumbnail {
    cursor: pointer;
}

@keyframes mbmProductLightboxSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 600px) {
    #custom-lightbox .lightbox-image {
        max-height: 50vh;
        max-width: 82vw;
    }

    #custom-lightbox .lightbox-arrow {
        font-size: 1rem;
        height: 3rem;
        margin: 0;
        width: 3rem;
    }

    #custom-lightbox .lightbox-content {
        max-width: 100vw;
    }

    #custom-lightbox .lightbox-close {
        right: 10px;
        top: 70px;
    }
}
