/* Overlay Background */
.spa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px); /* Modern touch for the background */
}

/* Hidden State controlled by JS */
.spa-modal-overlay.spa-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Modal Container */
.spa-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* The Advert Image */
.spa-modal-content .spa-advert-img {
    display: block;
    max-width: 600px; /* Constrain the 1080px image on desktop */
    width: 100%;
    height: auto;
    max-height: 90vh; /* Prevents overflow on very short screens */
    object-fit: contain;
    border-radius: 8px;
}

/* Close Button */
.spa-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background-color: #fff;
    color: #333;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 2;
    transition: transform 0.2s ease;
}

.spa-close-btn:hover {
    transform: scale(1.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .spa-modal-content {
        max-width: 85vw;
    }
    
    .spa-close-btn {
        top: -10px;
        right: -10px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}