/* ============================================
   MZ Promo Popup — всплывающее окно с акцией + форма callback
   ============================================ */

.mz-promo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 45, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: mzPromoFadeIn 0.35s ease-out;
}

.mz-promo-overlay.is-visible {
    display: flex;
}

@keyframes mzPromoFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mz-promo-popup {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    animation: mzPromoSlideUp 0.45s cubic-bezier(0.2, 0.7, 0.25, 1);
}

@keyframes mzPromoSlideUp {
    from { transform: translateY(28px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1);       opacity: 1; }
}

.mz-promo-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 0.18s, background 0.18s;
    color: #233;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.mz-promo-close:hover { transform: rotate(90deg); background: #fff; }
.mz-promo-close::before,
.mz-promo-close::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 2px;
    background: #233;
    border-radius: 2px;
}
.mz-promo-close::before { transform: rotate(45deg); }
.mz-promo-close::after  { transform: rotate(-45deg); }

.mz-promo-image {
    position: relative;
    min-height: 360px;
    background: linear-gradient(135deg, #eef5f1 0%, #d8e8e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.mz-promo-image .mz-promo-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}
.mz-promo-image .mz-promo-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #ff5757;
    color: #fff;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 6px 16px rgba(255, 87, 87, 0.4);
}

.mz-promo-dates {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff5e6;
    color: #b55c00;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 14px;
    align-self: flex-start;
    line-height: 1;
}
.mz-promo-dates::before {
    content: "⏱";
    font-size: 13px;
    line-height: 1;
}

.mz-promo-body {
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
}

.mz-promo-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: #1a2a36;
    margin: 0 0 10px;
}

.mz-promo-subtitle {
    font-size: 14px;
    color: #4f6473;
    margin: 0 0 18px;
    line-height: 1.45;
}

.mz-promo-form { display: flex; flex-direction: column; gap: 10px; }

.mz-promo-form .mz-promo-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d9e1e7;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1a2a36;
    background: #f7fafb;
    transition: border-color 0.18s, background 0.18s;
    box-sizing: border-box;
}
.mz-promo-form .mz-promo-input::placeholder { color: #9aa9b2; }
.mz-promo-form .mz-promo-input:focus {
    outline: none;
    border-color: #20a181;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(32, 161, 129, 0.12);
}
.mz-promo-form .mz-promo-input.has-error {
    border-color: #e35858;
    background: #fff5f5;
}

.mz-promo-form .mz-promo-agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #647581;
    line-height: 1.4;
    margin-top: 4px;
}
.mz-promo-form .mz-promo-agreement input { margin-top: 3px; flex-shrink: 0; }
.mz-promo-form .mz-promo-agreement a { color: #20a181; text-decoration: underline; }

.mz-promo-form .mz-promo-submit {
    margin-top: 6px;
    background: linear-gradient(135deg, #20a181 0%, #178a6c 100%);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.18s;
    box-shadow: 0 6px 20px rgba(32, 161, 129, 0.28);
    font-family: inherit;
}
.mz-promo-form .mz-promo-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(32, 161, 129, 0.36); }
.mz-promo-form .mz-promo-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }

.mz-promo-detail-link {
    margin-top: 12px;
    color: #20a181;
    font-size: 13px;
    text-decoration: underline;
    align-self: flex-start;
}

.mz-promo-error {
    display: none;
    color: #e35858;
    font-size: 13px;
    margin-top: 4px;
}
.mz-promo-error.is-shown { display: block; }

/* Состояние "Спасибо" */
.mz-promo-success {
    display: none;
    text-align: center;
    padding: 40px 28px;
    grid-column: 1 / -1;
}
.mz-promo-popup.is-success .mz-promo-image,
.mz-promo-popup.is-success .mz-promo-body { display: none; }
.mz-promo-popup.is-success { grid-template-columns: 1fr; }
.mz-promo-popup.is-success .mz-promo-success { display: block; }

.mz-promo-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #e7f7f1;
    color: #20a181;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 38px;
    line-height: 1;
}
.mz-promo-success-title { font-size: 22px; font-weight: 700; color: #1a2a36; margin: 0 0 10px; }
.mz-promo-success-text  { color: #4f6473; font-size: 14px; line-height: 1.5; max-width: 400px; margin: 0 auto; }

/* Mobile */
@media (max-width: 720px) {
    .mz-promo-popup {
        grid-template-columns: 1fr;
        max-width: 480px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    .mz-promo-image {
        min-height: 320px;
        max-height: 420px;
    }
    .mz-promo-body { padding: 22px 20px 20px; }
    .mz-promo-title { font-size: 18px; }
}

/* iPhone SE и совсем мелкие — вертикальный скролл и крупные тапы */
@media (max-height: 640px) {
    .mz-promo-overlay { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
    .mz-promo-image { min-height: 220px; max-height: 280px; }
}
