.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7); /* Dark semi-transparent background */
    z-index: 99999; /* High z-index */
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-popup-overlay.show {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.custom-popup-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

.custom-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background 0.2s;
    padding: 0;
}

.custom-popup-close:hover {
    background: var(--red);
    color: #fff;
}

.custom-popup-image-container {
    flex-shrink: 0;
    width: 100%;
    background-color: transparent;
    text-align: center;
}

.custom-popup-image-container a {
    display: block;
}

.custom-popup-image-container img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 60vh; 
    object-fit: contain; 
}

.custom-popup-text {
    padding: 20px;
    overflow-y: auto;
    text-align: center;
    flex-grow: 1; 
}
