.custompopup-overlay {
    display: none; /* Hidden by default, shown via JS */
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Black with opacity */
    align-items: center;
    justify-content: center;
}

.custompopup-content {
    position: relative;
    background-color: transparent;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    animation: popupFadeIn 0.3s ease-in-out;
}

.custompopup-img {
    max-width: 100%;
    max-height: 80vh; /* Responsive max height */
    height: auto;
    border-radius: 8px; /* Optional rounding */
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.custompopup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    color: #fff;
    background: #000;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    line-height: 31px;
    text-align: center;
    border: 2px solid #fff;
    z-index: 2;
    transition: background 0.2s, color 0.2s;
}

.custompopup-close:hover,
.custompopup-close:focus {
    color: #000;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .custompopup-close {
        top: -10px;
        right: -10px;
        width: 30px;
        height: 30px;
        line-height: 26px;
        font-size: 20px;
    }
}
