/* Layout and behaviour */
.mfp-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mfp-overlay[hidden] { display: none; }
.mfp-overlay.mfp-visible { opacity: 1; }

.mfp-overlay .mfp-box {
    position: relative;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mfp-overlay.mfp-visible .mfp-box { transform: none; }

body.mfp-lock { overflow: hidden; }

/* Single popup preview (Elementor editor) */
.mfp-overlay.mfp-overlay--preview {
    position: relative;
    min-height: 100vh;
    padding: 40px 16px;
}
.mfp-overlay--preview .mfp-box { max-height: none; overflow: visible; }

/* Look: wrapped in :where() so the theme's hp-popup-* styles win when present */
:where(.mfp-box) {
    background: #fff;
    color: #475569;
    border-radius: 20px;
    padding: 40px 36px 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
:where(.mfp-title) {
    margin: 0 0 24px;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.25;
    color: #2563eb;
    text-align: center;
}
:where(.mfp-content) > :first-child { margin-top: 0; }
:where(.mfp-content) > :last-child { margin-bottom: 0; }
:where(.mfp-content) img { max-width: 100%; height: auto; }

:where(.mfp-actions) { text-align: center; }
:where(.mfp-close-btn) {
    display: block;
    margin: 20px auto 0;
    border: 0;
    border-radius: 100px;
    padding: 13px 40px;
    background: #2563eb;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.mfp-x {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 1;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.mfp-x:hover { background: #f1f5f9; color: #0f172a; }

@media (max-width: 600px) {
    :where(.mfp-box) { padding: 32px 18px 22px; border-radius: 14px; }
    :where(.mfp-title) { font-size: 24px; }
}
