/* iEgypt popup system (ixp-) */
.ixp-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}
.ixp-overlay.ixp-dim { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.ixp-overlay.ixp-show { opacity: 1; visibility: visible; }

.ixp-card {
    position: relative;
    width: 100%;
    background: var(--ixp-bg, #fff);
    color: var(--ixp-text, #1C2D45);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    padding: 38px 32px 32px;
    text-align: center;
    font-family: 'Lexend', system-ui, sans-serif;
    transform: translateY(18px) scale(.98);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.ixp-overlay.ixp-show .ixp-card { transform: translateY(0) scale(1); }

.ixp-sm { max-width: 380px; }
.ixp-md { max-width: 480px; }
.ixp-lg { max-width: 620px; }

.ixp-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: 0;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s ease, transform .15s ease;
}
.ixp-close:hover { opacity: 1; transform: scale(1.08); }

.ixp-heading { font-size: 1.5rem; font-weight: 700; margin: 0 0 10px; line-height: 1.2; }
.ixp-body { font-size: 1rem; line-height: 1.55; opacity: .85; margin: 0 0 18px; }

.ixp-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 4px; }
.ixp-btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
    font-size: .98rem;
}
.ixp-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.ixp-btn--accent { background: var(--ixp-accent, #B0531F); color: #fff; border: 0; }

/* Image template */
.ixp-tmpl-image { padding: 0; overflow: hidden; }
.ixp-tmpl-image .ixp-heading { margin-top: 22px; padding: 0 24px; }
.ixp-tmpl-image .ixp-actions { padding: 16px 24px 26px; }

/* Framed image — any upload is fitted to a consistent shape so it always looks good. */
.ixp-image-wrap {
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .05);
    border-radius: 18px 18px 0 0;
}
.ixp-image-wrap .ixp-image {
    display: block;
    width: 100%;
    height: 100%;
}
.ixp-image-wrap .ixp-fit-cover   { object-fit: cover; }
.ixp-image-wrap .ixp-fit-contain { object-fit: contain; }

/* "Original" shape: keep the upload's own ratio but cap the height so tall
   portraits can't blow the card up; letterbox anything taller than the cap. */
.ixp-image-wrap--auto { aspect-ratio: auto; }
.ixp-image-wrap--auto .ixp-image {
    height: auto;
    max-height: 62vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.ixp-tmpl-image .ixp-close {
    background: rgba(255, 255, 255, .85);
    border-radius: 50%;
    width: 34px;
    height: 34px;
}

/* Newsletter template */
.ixp-form { display: flex; gap: 10px; margin-top: 8px; }
.ixp-email {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid rgba(28, 45, 69, .18);
    border-radius: 100px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}
.ixp-email:focus { border-color: var(--ixp-accent, #B0531F); }
.ixp-form .ixp-btn { white-space: nowrap; }
.ixp-success { margin: 16px 0 0; font-weight: 600; color: #15803d; }

/* Promo template */
.ixp-code {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 6px;
    padding: 12px 18px;
    border: 2px dashed var(--ixp-accent, #B0531F);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    font-family: 'Courier New', monospace;
}
.ixp-code__value { font-size: 1.35rem; font-weight: 700; letter-spacing: 2px; color: var(--ixp-accent, #B0531F); }
.ixp-code__hint { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; opacity: .6; font-family: 'Lexend', sans-serif; }
.ixp-code.ixp-copied .ixp-code__hint::after { content: 'ied!'; }
.ixp-code__label { font-size: .85rem; opacity: .7; margin: 4px 0 16px; }

@media (max-width: 540px) {
    .ixp-card { padding: 34px 22px 26px; border-radius: 16px; }
    .ixp-heading { font-size: 1.3rem; }
    .ixp-form { flex-direction: column; }
    .ixp-form .ixp-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .ixp-overlay, .ixp-card { transition: opacity .01ms; }
    .ixp-overlay.ixp-show .ixp-card { transform: none; }
}
