#cpa-popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    overflow: hidden; /* Prevent background scrolling */
}

.cpa-content {
    pointer-events: all;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px 25px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    border-radius: 8px;
    z-index: 10000;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    display: inline-block;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    color: #222;
}

#cpa-close {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 14px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1;
    user-select: none;
}

#cpa-close:hover, #cpa-close:focus {
    background: #fff;
    color: #000;
    outline: none;
}

/* Responsive tweaks for smaller screens */
@media (max-width: 480px) {
    .cpa-content {
        max-width: 95vw;
        max-height: 85vh;
        border-radius: 0;
        padding: 15px 20px;
        font-size: 16px;
    }

    #cpa-close {
        top: 8px;
        right: 10px;
        font-size: 32px;
        padding: 14px 18px;
    }
}

/* Make images inside the popup responsive */
.cpa-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 4px;
}
