.mkp-bgp,
.mkp-bgp * {
    box-sizing: border-box;
}

.mkp-bgp {
    --mkp-bgp-red: #ef3340;
    --mkp-bgp-red-dark: #d92532;
    --mkp-bgp-ink: #111827;
    --mkp-bgp-muted: #687384;
    --mkp-bgp-line: #e2e6eb;
    display: grid;
    grid-template-columns: minmax(320px, 39%) minmax(0, 61%);
    width: min(1320px, calc(100% - 32px));
    min-height: 430px;
    margin: 40px auto;
    overflow: hidden;
    direction: rtl;
    border: 1px solid #121476;
    border-radius: 24px;
    color: var(--mkp-bgp-ink);
    background: #fff9f9;
    box-shadow: 0 18px 55px rgba(36, 43, 54, .08);
    font-family: inherit;
}

.mkp-bgp button,
.mkp-bgp input {
    font: inherit;
}

.mkp-bgp__intro {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(32px, 4.3vw, 68px);
    color: #fff;
    background: radial-gradient(circle at 12% 14%, rgba(255, 255, 255, .13), transparent 27%), linear-gradient(145deg, #15178f 0%, #101164 100%);
}

.mkp-bgp__intro-eyebrow,
.mkp-bgp__wizard-eyebrow,
.mkp-bgp__dialog-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -.1px;
}

.mkp-bgp__intro-eyebrow {
    margin-bottom: 15px;
    color: rgba(255,255,255,.8);
}

.mkp-bgp__intro-title {
    max-width: 420px;
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(26px, 2.6vw, 39px) !important;
    font-weight: 900 !important;
    line-height: 1.55 !important;
    letter-spacing: -1.2px;
}

.mkp-bgp__intro-description {
    max-width: 410px;
    margin: 20px 0 0 !important;
    color: rgba(255,255,255,.88) !important;
    font-size: 14px;
    line-height: 2;
}

.mkp-bgp__intro-list {
    display: grid;
    gap: 11px;
    margin: 26px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.mkp-bgp__intro-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    color: #fff;
    font-size: 13px;
}

.mkp-bgp__intro-list li::before {
    content: none !important;
}

.mkp-bgp__intro-list li span {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    color: #101166;
    background: #fff;
    font-size: 11px;
    font-weight: 900;
}

.mkp-bgp__wizard {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    flex-direction: column;
    padding: clamp(28px, 4vw, 54px);
    background: #fff;
}

.mkp-bgp__progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mkp-bgp__wizard-eyebrow {
    color: #788291;
}

.mkp-bgp__step-count {
    color: var(--mkp-bgp-red);
    font-size: 12px;
}

.mkp-bgp__progress {
    height: 5px;
    margin-top: 13px;
    overflow: hidden;
    border-radius: 99px;
    background: #e9ecf0;
}

.mkp-bgp__progress span {
    display: block;
    width: 33.333%;
    height: 100%;
    margin-right: 0;
    border-radius: inherit;
    background: var(--mkp-bgp-red);
    transition: width .36s cubic-bezier(.2,.75,.25,1);
}

.mkp-bgp__stage {
    flex: 1;
    padding-top: 27px;
    animation: mkpBgStageIn .3s ease both;
}

.mkp-bgp__question {
    display: block;
    margin: 0 0 20px !important;
    color: var(--mkp-bgp-ink) !important;
    font-size: clamp(21px, 2.1vw, 29px) !important;
    font-weight: 900 !important;
    line-height: 1.55 !important;
    letter-spacing: -.6px;
}

.mkp-bgp__choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mkp-bgp .mkp-bgp__choice {
    position: relative;
    display: flex !important;
    min-width: 0;
    min-height: 74px;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 12px !important;
    overflow: hidden;
    border: 1px solid var(--mkp-bgp-line) !important;
    border-radius: 14px !important;
    color: var(--mkp-bgp-ink) !important;
    background: #fff !important;
    box-shadow: 0 4px 14px rgba(17, 24, 39, .025) !important;
    text-align: right;
    line-height: 1.5 !important;
    cursor: pointer;
    appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.mkp-bgp .mkp-bgp__choice:hover {
    z-index: 1;
    border-color: #f3a5aa !important;
    background: #fffdfd !important;
    box-shadow: 0 10px 25px rgba(99, 34, 39, .08) !important;
    transform: translateY(-2px);
}

.mkp-bgp .mkp-bgp__choice:focus-visible {
    outline: 3px solid rgba(239, 51, 64, .22) !important;
    outline-offset: 2px;
}

.mkp-bgp .mkp-bgp__choice.is-selected {
    border-color: var(--mkp-bgp-red) !important;
    background: #fff5f6 !important;
    box-shadow: 0 0 0 2px rgba(239, 51, 64, .1) !important;
}

.mkp-bgp__choice-icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 13px;
    background: #f3f6f9;
    font-size: 23px;
    transition: transform .2s ease, background .2s ease;
}

.mkp-bgp__choice:hover .mkp-bgp__choice-icon,
.mkp-bgp__choice.is-selected .mkp-bgp__choice-icon {
    background: #ffe8ea;
    transform: scale(1.04);
}

.mkp-bgp__choice-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.mkp-bgp__choice-copy strong {
    overflow: hidden;
    color: #171b23;
    font-size: 14px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mkp-bgp__choice-copy small {
    overflow: hidden;
    color: #7a8492;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mkp-bgp__choice--budget .mkp-bgp__choice-copy strong {white-space:normal;overflow:visible;text-overflow:clip;line-height:1.8;}

.mkp-bgp__choice-check {
    display: inline-grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    border: 1px solid #d5dbe2;
    border-radius: 50%;
    color: transparent;
    background: #fff;
    font-size: 11px;
    font-weight: 900;
}

.mkp-bgp__choice.is-selected .mkp-bgp__choice-check {
    border-color: var(--mkp-bgp-red);
    color: #fff;
    background: var(--mkp-bgp-red);
}

.mkp-bgp__route-error {
    margin: 8px 0 0 !important;
    padding: 10px 12px;
    border-radius: 9px;
    color: #a52630;
    background: #fff0f1;
    font-size: 12px;
}

.mkp-bgp__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin-top: 21px;
}

.mkp-bgp .mkp-bgp__button {
    display: inline-flex !important;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0 !important;
    padding: 9px 19px !important;
    border: 0 !important;
    border-radius: 11px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.mkp-bgp .mkp-bgp__button--next {
    margin-inline-start: auto !important;
    color: #fff !important;
    background: var(--mkp-bgp-red) !important;
    box-shadow: 0 8px 20px rgba(239, 51, 64, .2) !important;
}

.mkp-bgp .mkp-bgp__button--next:hover:not(:disabled) {
    background: var(--mkp-bgp-red-dark) !important;
    transform: translateY(-1px);
}

.mkp-bgp .mkp-bgp__button--results {
    min-width: 150px;
}

.mkp-bgp .mkp-bgp__button--back {
    border: 1px solid #dfe4e9 !important;
    color: #46505e !important;
    background: #fff !important;
}

.mkp-bgp .mkp-bgp__button:disabled {
    color: #a1a7af !important;
    background: #e8ebef !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: .9;
}

.mkp-bgp .mkp-bgp__button[hidden],
.mkp-bgp [hidden] {
    display: none !important;
}

.mkp-bgp__modal {
    position: fixed;
    z-index: 1000000;
    inset: 0;
    display: grid;
    padding: 24px;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}

.mkp-bgp__modal.is-open {
    opacity: 1;
    visibility: visible;
}

.mkp-bgp__modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .62);
    backdrop-filter: blur(5px);
}

.mkp-bgp__dialog {
    position: relative;
    display: flex;
    width: min(1280px, 100%);
    max-height: min(88vh, 900px);
    min-height: 320px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(0,0,0,.26);
    transform: translateY(16px) scale(.985);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
}


.mkp-bgp__modal.is-open .mkp-bgp__dialog {
    transform: none;
}

.mkp-bgp__dialog-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid #e8ebef;
    background: #fff;
}

.mkp-bgp__dialog-head h3 {
    margin: 3px 0 0 !important;
    color: #151a22 !important;
    font-size: 21px !important;
    font-weight: 900 !important;
    line-height: 1.5 !important;
}

.mkp-bgp__dialog-eyebrow {
    color: var(--mkp-bgp-red);
}

.mkp-bgp .mkp-bgp__close {
    display: inline-grid !important;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center;
    border: 1px solid #e2e6eb !important;
    border-radius: 50% !important;
    color: #303846 !important;
    background: #f7f8fa !important;
    font-size: 27px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    cursor: pointer;
}

.mkp-bgp .mkp-bgp__close:hover {
    border-color: #f2b4b8 !important;
    color: var(--mkp-bgp-red) !important;
    background: #fff4f5 !important;
}

.mkp-bgp__dialog-body {
    flex: 1;
    min-height: 0;
    padding: clamp(16px, 3vw, 32px);
    overflow: auto;
    overscroll-behavior: contain;
    background: #f7f8fa;
}

.mkp-bgp__loading,
.mkp-bgp__empty {
    display: flex;
    min-height: 250px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    padding: 30px;
    color: #354050;
    text-align: center;
}

.mkp-bgp__loading small,
.mkp-bgp__empty p {
    margin: 0 !important;
    color: #7a8492;
}

.mkp-bgp__shortcode-debug {
    margin-top: 18px;
    padding: 10px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
}

.mkp-bgp__shortcode-debug summary {
    cursor: pointer;
    font-weight: 700;
}

.mkp-bgp__shortcode-debug code {
    display: block;
    margin-top: 10px;
    padding: 10px;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
}

.mkp-bgp__spinner {
    width: 42px;
    height: 42px;
    margin-bottom: 5px;
    border: 4px solid #f5c8cb;
    border-top-color: var(--mkp-bgp-red);
    border-radius: 50%;
    animation: mkpBgSpin .8s linear infinite;
}

.mkp-bgp__empty--error strong {
    color: #b4232d;
}

.mkp-bgp-modal-open {
    overflow: hidden !important;
}

.mkp-bgp-notice {
    width: min(1100px, calc(100% - 32px));
    margin: 24px auto;
    padding: 12px 14px;
    border-right: 4px solid var(--mkp-bgp-red, #ef3340);
    border-radius: 8px;
    background: #fff1f2;
}

/* سازگاری خروجی‌های مختلف Procode داخل پاپ‌آپ */
.mkp-bgp__dialog-body .procode-card-wrap,
.mkp-bgp__dialog-body .procode-full-wrap,
.mkp-bgp__dialog-body .procode-table-wrap {
    max-width: 100%;
    margin: 0 auto;
}

.mkp-bgp__dialog-body .procode-table-wrap {
    background: #fff;
}

.mkp-bgp__dialog-body .procode-card-grid .pc-body {height: 100px;}

/* Card body height above is intentionally preserved at 100px. */
.mkp-bgp__dialog-body .procode-card-grid {
    grid-template-columns: repeat(var(--mkp-bgp-columns, 4), minmax(0, 1fr)) !important;
}
.mkp-bgp .mkp-bgp__choice > .mkp-bgp__native-input {
    position: static !important;
    display: inline-block !important;
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    accent-color: #ef3340;
    cursor: inherit;
}
.mkp-bgp .mkp-bgp__native-input::before,.mkp-bgp .mkp-bgp__native-input::after {display:none!important;content:none!important;}
.mkp-bgp .mkp-bgp__button--previous[hidden] {display:none!important;}
.mkp-bgp__loading-motion {display:flex;min-height:180px;flex-direction:column;align-items:center;justify-content:center;gap:18px;color:#687384;}
.mkp-bgp__loader-ring {display:block;width:38px;height:38px;border:3px solid #e9eaf0;border-top-color:#ef3340;border-inline-end-color:#282284;border-radius:50%;animation:mkpBgSpin .85s linear infinite;}
.mkp-bgp__dialog-actions {display:flex;justify-content:flex-end;gap:10px;flex-shrink:0;padding:12px 24px;border-bottom:1px solid #e5e9ee;background:#fff;}
.mkp-bgp__result-summary {min-height:40px;display:flex;align-items:center;}
.mkp-bgp__contacts {margin-top:24px;padding:18px;background:white;border-radius:12px;}
.mkp-bgp__dialog-body .procode-card {position:relative;}
.mkp-bgp__product-badges {position:absolute;top:12px;right:12px;left:12px;display:flex;gap:6px;flex-wrap:wrap;pointer-events:none;z-index:2;}
.mkp-bgp__product-badge {padding:4px 9px;border-radius:7px;background:#e5f6eb;color:#146437;font-size:12px;font-weight:700;line-height:1.7;box-shadow:0 1px 5px #0001;}
.mkp-bgp__product-badge--best {background:#fff1cf;color:#765000;}
.mkp-bgp__choice:has(.mkp-bgp__native-input:focus-visible) {
    outline: 3px solid rgba(239, 51, 64, .4);
    outline-offset: 3px;
}
.mkp-bgp__choice--checkbox .mkp-bgp__choice-check { border-radius: 5px; }
.mkp-bgp .mkp-bgp__choice.is-unavailable,
.mkp-bgp .mkp-bgp__choice.is-checking {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.mkp-bgp .mkp-bgp__choice.is-unavailable:hover,
.mkp-bgp .mkp-bgp__choice.is-checking:hover {
    border-color: var(--mkp-bgp-border, #e8eaf0);
    background: #fff;
}
.mkp-bgp .mkp-bgp__choice.is-unavailable .mkp-bgp__choice-icon,
.mkp-bgp .mkp-bgp__choice.is-checking .mkp-bgp__choice-icon {
    transform: none !important;
}
.mkp-bgp__availability-error { color: #9b2831; }
.mkp-bgp__selection-hint { margin: -8px 0 14px; color: #687384; font-size: 12px; }
.mkp-bgp__group + .mkp-bgp__group { margin-top: 26px; }
.mkp-bgp__result-summary { padding: 14px 16px; margin-bottom: 18px; border-radius: 12px; background: #fff; }
.mkp-bgp__result-summary p { margin: 8px 0 0; color: #687384; font-size: 13px; }
.mkp-bgp__consult { display: inline-block; margin-top: 12px; padding: 11px 18px; border-radius: 10px; color: #fff !important; background: #ef3340; }
@media (max-width: 900px) {
    .mkp-bgp__dialog-body .procode-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 480px) {
    .mkp-bgp__dialog-body .procode-card-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

@keyframes mkpBgStageIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
}

@keyframes mkpBgSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    .mkp-bgp {
        grid-template-columns: 1fr;
        width: min(720px, calc(100% - 24px));
        border-radius: 20px;
    }

    .mkp-bgp__intro,
    .mkp-bgp__wizard {
        grid-column: 1;
    }

    .mkp-bgp__intro {
        grid-row: 1;
        padding: 32px;
    }

    .mkp-bgp__wizard {
        grid-row: 2;
        min-height: 430px;
        padding: 30px;
    }

    .mkp-bgp__intro-title {
        max-width: 600px;
        font-size: 28px !important;
    }

    .mkp-bgp__intro-description {
        max-width: 620px;
        display:none;
    }

    .mkp-bgp__intro-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        display:none;
    }
}

@media (max-width: 580px) {
    .mkp-bgp {
        width: calc(100% - 18px);
        margin: 24px auto;
        border-radius: 17px;
        margin-block:0 20px !important;
    }

    .mkp-bgp__intro,
    .mkp-bgp__wizard {
        padding: 24px 18px;
    }

    .mkp-bgp__intro-title {
        font-size: 24px !important;
        line-height: 1.65 !important;
    }

    .mkp-bgp__intro-list {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 20px !important;
    }

    .mkp-bgp__wizard {
        min-height: 470px;
    }

    .mkp-bgp__question {
    display: block;
        font-size: 21px !important;
    }

    .mkp-bgp__choices {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .mkp-bgp .mkp-bgp__choice {
        min-height: 68px;
        border-radius: 12px !important;
    }

    .mkp-bgp__choice-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .mkp-bgp__actions {
        align-items: stretch;
    }

    .mkp-bgp .mkp-bgp__button {
        flex: 1;
        padding-inline: 12px !important;
    }

    .mkp-bgp__modal {
        padding: 0;
        place-items: stretch;
    }

    .mkp-bgp__dialog {
        width: 100%;
        max-height: none;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .mkp-bgp__dialog-head {
        padding: 14px 15px;
    }

    .mkp-bgp__dialog-head h3 {
        font-size: 17px !important;
    }

    .mkp-bgp__dialog-body {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mkp-bgp *,
    .mkp-bgp *::before,
    .mkp-bgp *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
