.gallery{
    .container-gallery-preview{
        // margin: 20px 0;
        max-height: 300px;
        height: 0px;
        overflow-y: auto;
        overflow-x: hidden;
        display: grid;
        grid-template-columns: repeat(4,1fr);
        column-gap: 1rem;
        row-gap: 1rem;
        opacity: 0;
        pointer-events: none;
        transition: .3s;

        @media (min-width: 1300px){
            grid-template-columns: repeat(5,1fr);
        }

        @media (min-width: 1500px){
            grid-template-columns: repeat(6,1fr);
        }

        @media (max-width: 768px){
            grid-template-columns: repeat(3,1fr);
        }

        @media (max-width: 414px){
            grid-template-columns: repeat(2,1fr);
        }

        .template-preview-image{
            display: none;
        }

        .container-preview-image{
            .preview-image{
                position: relative;
                border-radius: 10px;
                overflow: hidden;
                cursor: pointer;
                border: 1px solid var(--primary);

                &:before{
                    content: '';
                    display: block;
                    width: 100%;
                    padding-bottom: 64%;
                }

                .file-name{
                    width: 100%;
                    padding: 0 15px;
                    position: absolute;
                    left: 0;
                    bottom: 5px;
                    text-align: center;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    color: var(--theme-primary);
                    font-weight: 700;
                }

                .custom-loader{
                    position: absolute;
                    left: 50%;
                    top: 50%;
                    transform: translate(-50%, -50%);
                    width: 80px;
                    height: 80px;
                    transition: opacity .3s;

                    span{
                        box-sizing: border-box;
                        display: block;
                        position: absolute;
                        width: 64px;
                        height: 64px;
                        margin: 8px;
                        border: 8px solid var(--primary);
                        border-radius: 50%;
                        animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
                        border-color: var(--primary) transparent transparent transparent;

                        &:nth-child(1) {
                            animation-delay: -0.45s;
                        }

                        &:nth-child(2) {
                            animation-delay: -0.3s;
                        }

                        &:nth-child(3) {
                            animation-delay: -0.15s;
                        }
                    }

                    @keyframes lds-ring {
                        0% {
                            transform: rotate(0deg);
                        }
                        100% {
                            transform: rotate(360deg);
                        }
                    }
                }

                img{
                    position: absolute;
                    left: 0;
                    top: 0;
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    border-radius: 10px;
                    opacity: 0;
                    transition: opacity .3s;

                    &.icon{
                        max-height: calc(100% - 3rem);
                        top: 1rem;
                        object-fit: contain;
                    }
                }

                .file-name{
                    width: 100%;
                    padding: 0 15px;
                    position: absolute;
                    left: 0;
                    bottom: 5px;
                    text-align: center;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    color: var(--theme-primary);
                    font-weight: 700;
                }

                &.image-loaded{
                    .custom-loader{
                        opacity: 0;
                    }

                    img{
                        opacity: 1;
                    }
                }
            }

            .actions{
                width: 100%;
                display: flex;
                margin-top: 10px;

                .remove-image, .remove-loaded-image{
                    border: 0;
                    flex-grow: 1;
                    flex-shrink: 0;
                    width: 37px;
                    background-color: var(--danger);
                    border-radius: 3px;
                    // margin-left: 5px;

                    svg{
                        fill: #FFF;
                        width: 15px;
                        height: 15px;
                    }
                }
            }
        }

        &.render-gallery{
            opacity: 1;
            height: 184px;
            transition-delay: .2s;
            pointer-events: all;
            margin-top: 20px;
        }
    }

    .container-gallery-upload{
        margin-bottom: 30px;
        width: 100%;
        height: 120px;
        position: relative;
        border-radius: 20px;
        margin-top: 5px;
        box-shadow: 6px 9px 20px 0px rgba(50, 50, 50, 0.15);
        // border: 1px solid #FFF;
        // transition: width .3s, height .3s, box-shadow .3s, border-color .3s;

        &:before{
            content: '';
            width: calc(100% - 20px);
            height: calc(100% - 20px);
            border: 2px dashed #bccddd;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            border-radius: 10px;
            transition: opacity .3s;
        }

        .file-upload{
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
        }

        // .add-button{
        //     width: 40px;
        //     height: 40px;
        //     border-radius: 50%;
        //     position: absolute;
        //     bottom: 10px;
        //     right: 10px;
        //     background-color: var(--primary);

        //     &:after, &:before{
        //         width: 15px;
        //         height: 2px;
        //         background-color: #fff;
        //         position: absolute;
        //         left: 50%;
        //         top: 50%;
        //         transform: translate(-50%, -50%);
        //     }

        //     &:after{
        //         height: 15px;
        //         width: 2px;
        //     }
        // }

        .mask-input{
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            opacity: .8;
            transition: opacity .3s;

            svg{
                fill: var(--purple);
                width: 30px;
                height: 30px;
            }

            .upload-text{
                text-align: center;
                color: var(--purple);
                line-height: 15px;
                padding: 0 20px;
            }
        }
    }
}
