/**
 * Front-end popup — brand look (Masluland).
 * Dark #1a1a1a, gold #DDB88B, orange #D85A30, off-white #f4f1eb, Rubik, 12px radius, RTL.
 * One popup shown at a time. Closable ✕ (top-left), overlay, Esc.
 */

.mlpop-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .72);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    direction: rtl;
    font-family: 'Rubik', sans-serif;
    opacity: 0;
    transition: opacity .22s ease;
}
.mlpop-overlay.mlpop-show { opacity: 1; }

/* close button — top-left (RTL), shared by both types */
.mlpop-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(244, 241, 235, .10);
    border: 1px solid rgba(244, 241, 235, .18);
    color: #f4f1eb;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    z-index: 2;
    padding: 0;
}
/* Force-neutralize the parent theme's brand :focus / :active accent (#D85A30)
   that otherwise paints a pink box + pink ✕ after a tap/focus (same family as
   the FAQ button and PWA ✕ fixes). :focus-visible is in the same selector on
   purpose → the muted cream glyph + faint ring hold in every state. */
.mlpop-close,
.mlpop-close:hover,
.mlpop-close:focus,
.mlpop-close:focus-visible,
.mlpop-close:active {
    background: rgba(244, 241, 235, .10) !important;
    border: 1px solid rgba(244, 241, 235, .18) !important;
    color: #f4f1eb !important;   /* cream — beats the pink */
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none;
    appearance: none;
}
.mlpop-close:hover,
.mlpop-close:active { background: rgba(244, 241, 235, .2) !important; }

/* ---- content popup ---- */
.mlpop-content {
    position: relative;
    width: min(360px, 92vw);
    background: #1a1a1a;
    border: 1px solid rgba(221, 184, 139, .28);
    border-radius: 12px;
    padding: 34px 26px 28px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    transform: translateY(10px) scale(.98);
    transition: transform .22s ease;
}
.mlpop-overlay.mlpop-show .mlpop-content { transform: translateY(0) scale(1); }

.mlpop-content .mlpop-title {
    color: #DDB88B;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}
.mlpop-content .mlpop-body {
    color: #f4f1eb;
    opacity: .88;
    font-size: 14.5px;
    line-height: 1.65;
    margin-top: 12px;
}
.mlpop-content .mlpop-cta {
    display: inline-block;
    margin-top: 22px;
    background: #DDB88B;
    color: #1a1a1a;
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    padding: 12px 30px;
    text-decoration: none;
    transition: filter .15s;
}
.mlpop-content .mlpop-cta:hover { filter: brightness(1.06); }

/* ---- image popup (uploaded design) ----
   Cap size only — never force-crop or distort. The <img> is bounded by both
   max-width and max-height with auto sizing, so it scales to fit inside both
   limits while keeping its natural aspect ratio. The wrapper shrinks to the
   image, so its rounded corners always match. */
.mlpop-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    line-height: 0;
    transform: translateY(10px) scale(.98);
    transition: transform .22s ease;
}
.mlpop-overlay.mlpop-show .mlpop-image { transform: translateY(0) scale(1); }

.mlpop-image .mlpop-image-link { display: block; line-height: 0; cursor: pointer; }
.mlpop-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(480px, 90vw);
    max-height: 85vh;
}

/* motion-safety */
@media (prefers-reduced-motion: reduce) {
    .mlpop-overlay,
    .mlpop-content,
    .mlpop-image { transition: none; }
    .mlpop-content,
    .mlpop-image { transform: none; }
}
