.memorial-gallery-wrapper {
    max-width: 100%;
    margin: 20px auto;
    font-family: Arial, sans-serif;
}

#memorial-upload-form {
    border: 2px dashed #aaa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: #f9f9f9;
    transition: background 0.3s, border-color 0.3s;
    position: relative;
    margin-bottom: 20px;
}
#memorial-upload-form.dragover {
    background: #f1f8ff;
    border-color: #6c63ff;
}
#memorial-upload-form input[type=file] {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.upload-text { font-size: 16px; color: #555; }

.memorial-gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.memorial-gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
}

.memorial-gallery-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.memorial-gallery-item .delete-image {
    position: absolute; top: 6px; right: 6px;
    background: rgba(255,0,0,0.9); color: #fff;
    border: none; border-radius: 4px; padding: 4px 8px;
    font-size: 12px; cursor: pointer; transition: opacity 0.2s;
}
.memorial-gallery-item .delete-image:hover { opacity: 0.9; }

/* upload em andamento */
.uploading { flex-direction: column; }
.uploading-text { margin-bottom: 6px; font-size: 13px; color: #333; }
.progress-bar { width: 90%; height: 6px; background:#eee; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: #6c63ff; transition: width 0.3s; }

/* mensagens */
.memorial-error-box {
    background: #fff3f3; color: #a40000; border:1px solid #ffcfcf; padding:12px; border-radius:8px;
}

/* responsivo */
@media (max-width:640px){
    .memorial-gallery-list { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
