/* =========================================================
   Scroll Lock
========================================================= */

.mj-lock {
    overflow: hidden;
}


/* =========================================================
   Modal Wrapper
========================================================= */

.mj-modal {
    font-size: 12px;
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none; /* disabled until active */
}

/* When modal is active */
.mj-modal.is-active {
    pointer-events: auto;
}


/* =========================================================
   Overlay (fade in)
========================================================= */

.mj-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mj-modal.is-active .mj-overlay {
    opacity: 1;
}


/* =========================================================
   Sliding Container
========================================================= */

.mj-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    height: 100%;
    max-height: 100%;
    background: #ffffff;

    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(.22,.8,.22,1);

    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    /* Adds a tiny separation on desktop when overlay is dark */
    box-shadow: 0 -10px 30px rgba(0,0,0,0.25);
}

/* Slide up when active */
.mj-modal.is-active .mj-container {
    transform: translateY(0);
}

/* =========================================================
   Desktop Behaviour – Top Drop-in Panel (not fullscreen)
========================================================= */

@media (min-width: 720px) {
    .mj-modal:not(.mj-modal--phone) .mj-container {
        position: absolute;
        top: 24px;
        left: 50%;
        right: auto;
        bottom: auto;

        width: 640px;
        max-width: calc(100% - 40px);
        height: auto;
        max-height: 90vh;

        border-radius: 16px;
        overflow: hidden;

        transform: translate(-50%, -30px);
        opacity: 0;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .mj-modal:not(.mj-modal--phone).is-active .mj-container {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}


/* =========================================================
   Close Button
========================================================= */

.mj-close {
    position: absolute;
    top: 16px;
    right: 16px;

    border: none;
    background: transparent;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 30;
    padding: 6px 10px;
    border-radius: 10px;
}

.mj-close:hover {
    background: rgba(0,0,0,0.06);
}

.mj-close.is-disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

/* =========================================================
   Replace Zone
========================================================= */

.mj-replace {
    padding: 70px 20px 40px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}


/* =========================================================
   Loading Overlay (for short actions only)
========================================================= */

.mj-loading {
    position: absolute;
    inset: 0;
    background: #fff;

    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;

    z-index: 40;
}

.mj-loading-text {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    opacity: 0.9;
    text-align: center;
    max-width: 320px;
}


/* =========================================================
   Spinner
========================================================= */

.mj-spinner {
    width: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    line-height: 1;
    color: #111;
}

.mj-loading .mj-spinner {
    font-size: 36px;
}

.mj-wait__retry--hidden {
    display: none;
}

/* =========================================================
   Content typography / layout helpers
========================================================= */

.mj-content {
    display: block;
}

.mj-header {
    margin-bottom: 14px;
}

.mj-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.mj-body p {
    margin: 0 0 10px;
}

.mj-error {
    width: 100%;
    background: #fff2f2;
    color: #8a1f1f;
    border: 1px solid rgba(138,31,31,0.25);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.mj-total {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 3px;
    text-align: center;
    background: linear-gradient(to bottom, #fafafa, #f3f3f3);
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}

.mj-total__label {
    font-size: 14px;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 6px;
}

.mj-total__value {
    font-size: 24px;
    line-height: 1.1;
    font-weight: 700;
    color: #111;
}

.mj-total__value .js-mj-total {
    font-variant-numeric: tabular-nums;
}

.mj-price {
    font-size: 14px;
    margin: 12px 0 24px 0 !important;
    color: #555;
}

.mj-price__label {
    margin-right: 6px;
}

.mj-price__value {
    font-weight: 600;
    font-size: 16px;
    color: #111;
    background: #f2f2f2;
    padding: 2px 6px;
    border-radius: 4px;
}

/* =========================================================
   Waiting Panel (in-content)
========================================================= */

.mj-wait__row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.mj-wait__subtitle {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
}

.mj-wait__hint {
    margin: 8px 0 0;
    opacity: 0.85;
    font-size: 14px;
}

.mj-wait__muted {
    margin: 6px 0 0;
    opacity: 0.7;
    font-size: 13px;
}

.mj-wait__ref {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 14px;
    background: rgba(0,0,0,0.02);
}

.mj-wait__ref-label {
    font-size: 12px;
    opacity: 0.75;
    margin-bottom: 6px;
}

.mj-wait__ref-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 16px;
    font-weight: 600;
    word-break: break-word;
}

.mj-wait__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================================================
   Buttons (used by waiting panel)
========================================================= */

.mj-btn {
    width: 100%;
    margin-top: 30px;
    margin-bottom: 20px;
}

.mj-retry-state {
    margin-bottom: 20px;
}

.mj-retry-state__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.mj-retry-state__subtitle {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(0,0,0,0.7);
}