/* Overlay */
.cpm-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 9998;
}

/* Popup container */
.cpm-popup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 10px;
    box-sizing: border-box;
}

/* Inner box */
.cpm-popup-inner {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    border-radius: 12px;
    padding: 18px 18px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow-y: auto;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* Larger screens (tablets, small desktops) */
@media (min-width: 768px) {
    .cpm-popup-inner {
        max-width: 640px;
        padding: 22px 24px 24px;
        font-size: 16px;
    }
}

/* Big desktops / TVs */
@media (min-width: 1200px) {
    .cpm-popup-inner {
        max-width: 720px;
    }
}

/* Close button */
.cpm-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* Content area */
.cpm-popup-content {
    margin-top: 12px;
    color: #222;
}

.cpm-popup-content h1,
.cpm-popup-content h2,
.cpm-popup-content h3 {
    margin-top: 0;
}

.cpm-popup-content img,
.cpm-popup-content video,
.cpm-popup-content iframe {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Optional wrapper for embed */
.cpm-video-wrap {
    margin-top: 10px;
    position: relative;
}

/* Visible state */
.cpm-popup-overlay.cpm-visible,
.cpm-popup.cpm-visible {
    opacity: 1;
    visibility: visible;
}

/* Prevent scroll when popup open */
body.cpm-popup-open {
    overflow: hidden;
}

/* CTA button */
.cpm-popup-content .btn-cta {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 14px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    background: #e63946;
    color: #ffffff;
    text-align: center;
    min-width: 150px;
}

.cpm-popup-content .btn-cta:hover {
    opacity: 0.9;
}

/* On very small screens, make CTA full-width */
@media (max-width: 480px) {
    .cpm-popup-inner {
        padding: 16px 14px 18px;
        border-radius: 10px;
    }

    .cpm-popup-content .btn-cta {
        width: 100%;
    }
}
