/* ============================================================
   WP Popup Manager — Frontend Styles
   ============================================================ */

/* ── Overlay backdrop ──────────────────────────────────────── */
.wppm-overlay {
    position: fixed;
    inset: 0;                     /* top/right/bottom/left: 0 */
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom bar overrides the flex centering */
.wppm-overlay.wppm-position-bottom-bar {
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.3);
}

/* Corner widgets — no full backdrop */
.wppm-overlay.wppm-position-bottom-right,
.wppm-overlay.wppm-position-bottom-left {
    background: transparent;
    pointer-events: none;          /* let clicks through the empty area */
    align-items: flex-end;
}

.wppm-overlay.wppm-position-bottom-right {
    justify-content: flex-end;
}

.wppm-overlay.wppm-position-bottom-left {
    justify-content: flex-start;
}

/* ── Inner popup box ───────────────────────────────────────── */
.wppm-popup-inner {
    position: relative;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    padding: 28px 32px 24px;
    max-width: 600px;
    width: 90%;
    box-sizing: border-box;
    pointer-events: all;           /* re-enable for corner variants */
    max-height: 90vh;
    overflow-y: auto;
}

/* Bottom bar stretches full width */
.wppm-position-bottom-bar .wppm-popup-inner {
    max-width: 100%;
    width: 100%;
    border-radius: 0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Corner widgets are smaller */
.wppm-position-bottom-right .wppm-popup-inner,
.wppm-position-bottom-left  .wppm-popup-inner {
    max-width: 340px;
    width: 340px;
    margin: 0 16px 16px;
    font-size: 14px;
}

/* ── Close button ──────────────────────────────────────────── */
.wppm-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
    transition: color 0.15s;
}

.wppm-close:hover {
    color: #000;
}

/* Bottom bar close sits inline */
.wppm-position-bottom-bar .wppm-close {
    position: static;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Content area ──────────────────────────────────────────── */
.wppm-content {
    word-break: break-word;
}

.wppm-content iframe,
.wppm-content img {
    max-width: 100%;
    height: auto;
}

/* ── CTA button ────────────────────────────────────────────── */
.wppm-cta-wrap {
    margin-top: 18px;
    text-align: center;
}

.wppm-position-bottom-bar .wppm-cta-wrap {
    margin-top: 0;
    flex-shrink: 0;
}

.wppm-cta-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #0073aa;
    color: #ffffff !important;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.wppm-cta-btn:hover {
    background: #005a87;
}

/* ── Accessibility: respect reduced-motion preference ──────── */
@media (prefers-reduced-motion: reduce) {
    .wppm-overlay {
        transition: none;
    }
}

/* ── Test Mode badge ───────────────────────────────────────── */
.wppm-test-badge {
    display: inline-block;
    background: #d63638;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 12px;
}
