/*
 * Iris Popup — фронтовые стили попапа на витрине.
 * Namespace .iyp- + сброс box-sizing внутри, чтобы не ловить стили Aspro.
 * Desktop = центрированная модалка. Mobile (@media <=640) = bottom-sheet со слайд-ап.
 * Цвета/размеры приходят CSS-переменными на .iyp-card (задаются инлайном из CONTENT.design).
 */

.iyp-overlay,
.iyp-overlay * { box-sizing: border-box; }

.iyp-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(30, 20, 35, 0);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, background .25s ease, visibility 0s .25s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.iyp-overlay.iyp-has-dim { background: rgba(30, 20, 35, .55); }
.iyp-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity .25s ease, background .25s ease;
}

.iyp-card {
    --iyp-accent: #B055C0;
    --iyp-bg: #ffffff;
    --iyp-text: #2b2330;
    --iyp-btn: var(--iyp-accent);
    --iyp-btn-text: #ffffff;
    --iyp-radius: 18px;
    --iyp-width: 460px;

    position: relative;
    width: 100%;
    max-width: var(--iyp-width);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--iyp-bg);
    color: var(--iyp-text);
    border-radius: var(--iyp-radius);
    box-shadow: 0 24px 60px rgba(40, 20, 50, .28);
    transform: translateY(16px) scale(.98);
    opacity: 0;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;
}
.iyp-overlay.is-open .iyp-card { transform: none; opacity: 1; }

.iyp-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .06);
    color: #6b6172;
    font-size: 20px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: background .15s ease;
}
.iyp-close:hover { background: rgba(0, 0, 0, .12); }

.iyp-image { display: block; width: 100%; height: auto; }
.iyp-image--top { border-radius: var(--iyp-radius) var(--iyp-radius) 0 0; }

.iyp-body { padding: 26px 26px 24px; }
.iyp-body--with-pad-top { padding-top: 30px; }

.iyp-title {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--iyp-text);
}
.iyp-subtitle {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--iyp-accent);
    letter-spacing: .01em;
}
.iyp-text {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--iyp-text);
    opacity: .9;
}
.iyp-text:last-child { margin-bottom: 0; }

.iyp-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.iyp-btn {
    display: inline-block;
    padding: 13px 22px;
    border: 0;
    border-radius: 12px;
    background: var(--iyp-btn);
    color: var(--iyp-btn-text);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: filter .15s ease, transform .05s ease;
}
.iyp-btn:hover { filter: brightness(1.06); }
.iyp-btn:active { transform: translateY(1px); }
.iyp-btn--ghost {
    background: transparent;
    color: var(--iyp-text);
    box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .12);
}

.iyp-form { margin: 4px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.iyp-form input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid rgba(0, 0, 0, .12);
    border-radius: 12px;
    font-size: 15px;
    color: var(--iyp-text);
    background: #fff;
}
.iyp-form input:focus { outline: none; border-color: var(--iyp-accent); }

/* ---------- Мобильный bottom-sheet ---------- */
@media (max-width: 640px) {
    .iyp-overlay { padding: 0; align-items: flex-end; }
    .iyp-card {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    .iyp-overlay.is-open .iyp-card { transform: none; }
    .iyp-image--top { border-radius: 20px 20px 0 0; }
    .iyp-body { padding: 24px 20px 22px; }
    .iyp-title { font-size: 20px; }
    .iyp-actions { flex-direction: column; }
    .iyp-btn { width: 100%; }
    /* «ручка» сверху шита */
    .iyp-card::before {
        content: "";
        position: absolute;
        top: 8px; left: 50%;
        width: 40px; height: 4px;
        margin-left: -20px;
        border-radius: 3px;
        background: rgba(0, 0, 0, .15);
        z-index: 2;
    }
}

/* режим встраивания превью (внутри iframe карточки) — оверлей не фиксируем к окну */
.iyp-embed .iyp-overlay { position: absolute; }
