#popupContainer { z-index: 400; position: absolute; top: 0; left: 0; width: 100%; height: 100%; } #popupContainer .overlay-popup { position: absolute; transform: translate(-50%, -50%); z-index: 9999; padding: 1em 1.5em; background: rgba(0, 0, 0, 0.75); color: #fff; border-radius: 0.5em; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); max-width: 20%; text-align: center; transition: opacity 0.5s ease-out; } #popupContainer .overlay-popup .overlay-popup-image { position: absolute; top: 0; right: 0; width: 48px; height: 48px; transform: translate(50%, -50%); border-radius: 50%; object-fit: cover; border: 2px solid #444; } #popupContainer .overlay-popup.fade-out { opacity: 0; }