/* A neutral "merchant store" look shared by all mock shop pages: it stands for a partner's site, not our brand. */
:root {
    --shop-bg: #f5f6f8;
    --shop-surface: #ffffff;
    --shop-text: #1f2328;
    --shop-muted: #59636e;
    --shop-border: #d1d9e0;
    --shop-accent: #1f2328;
    --shop-focus: #0969da;
    --shop-radius: 10px;
}

body {
    margin: 0;
    background: var(--shop-bg);
    color: var(--shop-text);
    font-family:
        system-ui,
        -apple-system,
        'Segoe UI',
        Roboto,
        Arial,
        sans-serif;
    font-size: 15px;
    line-height: 1.4;
}

.mockshop {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px;
}

.shop-info {
    text-align: center;
}

.shop-title {
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 700;
    color: var(--shop-text);
}

.shop-info-row {
    margin: 4px 0;
    color: var(--shop-muted);
}

.shop-info-row strong {
    color: var(--shop-text);
    font-weight: 600;
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    width: 100%;
    max-width: 400px;
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
    background: var(--shop-surface);
}

.form-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    align-items: center;
}

.form-row label {
    color: var(--shop-muted);
    font-size: 14px;
}

.form-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    background: var(--shop-surface);
    color: var(--shop-text);
    font: inherit;
}

.form-input:focus {
    outline: 2px solid var(--shop-focus);
    outline-offset: -1px;
}

.form-input[readonly] {
    background: var(--shop-bg);
    color: var(--shop-muted);
}

.payment-mode {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 0;
    padding: 12px 16px 14px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
}

.payment-mode legend {
    padding: 0 4px;
    color: var(--shop-muted);
    font-size: 14px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* The SDK button (.pay-btn* from the SDK iframe.css, loaded after this file), as the merchant docs suggest.
   ".pay-btn" in the selectors wins over iframe.css; a border so it shows on white. */
.pay-btn.shop-pay-button {
    align-self: center;
    gap: 10px;
    width: auto;
    height: 44px;
    margin-top: 12px;
    padding: 0 16px;
    /* Light on purpose: every brand logo (Bill My Bnk, Salt, Chargee) is drawn for a light background. */
    border: 1px solid #c9d1d9;
    background: linear-gradient(#ffffff, #eef1f4);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.1);
    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease;
}

/* At the SDK's fixed 202px width the title wraps onto two lines. */
.pay-btn.shop-pay-button .pay-btn-title {
    font-size: 14px;
    white-space: nowrap;
}

.shop-pay-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.14),
        0 8px 18px rgba(0, 0, 0, 0.12);
}

.shop-pay-button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.shop-pay-button:focus-visible {
    outline: 2px solid var(--shop-focus);
    outline-offset: 2px;
}

.shop-pay-button:disabled {
    cursor: default;
    opacity: 0.6;
}

.payment-container {
    margin-top: 24px;
}

.mockshop-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 400px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.mockshop-links a {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
    background: var(--shop-surface);
    color: var(--shop-text);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.mockshop-links a:hover {
    border-color: var(--shop-muted);
}

.mockshop-link-note {
    display: block;
    margin-top: 4px;
    color: var(--shop-muted);
    font-size: 13px;
    font-weight: 400;
}

/* Form and log: stacked on narrow screens, side by side on wide ones with the log kept in view. */
.shop-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

@media (min-width: 1000px) {
    .shop-layout {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 32px;
        max-width: 1080px;
    }

    .shop-layout .payment-form {
        flex: none;
        width: 400px;
    }

    .shop-layout .shop-log-section {
        position: sticky;
        top: 16px;
        display: flex;
        flex: 1;
        flex-direction: column;
        min-width: 0;
        /* Shorter than the window, so the sticky log is not pushed out at the end of the layout. */
        max-height: calc(100vh - 96px);
        margin-top: 24px;
    }

    .shop-layout .shop-log {
        overflow-y: auto;
    }
}

/* On-page log (mockshop-log.js). */
.shop-log-section {
    box-sizing: border-box;
    width: 100%;
    max-width: 760px;
    margin-top: 32px;
}

.shop-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shop-log-header h2 {
    margin: 0;
    font-size: 18px;
}

.shop-log-clear {
    padding: 6px 14px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    background: var(--shop-surface);
    color: var(--shop-text);
    font: inherit;
    cursor: pointer;
}

.shop-log-clear:hover {
    border-color: var(--shop-muted);
}

.shop-log {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.shop-log-item {
    margin-bottom: 8px;
    padding: 8px 12px;
    border: 1px solid var(--shop-border);
    border-left: 4px solid var(--shop-muted);
    border-radius: 6px;
    background: var(--shop-surface);
}

.shop-log-item--ok {
    border-left-color: #1a7f37;
}

.shop-log-item--error {
    border-left-color: #cf222e;
}

.shop-log-item--callback {
    border-left-color: var(--shop-focus);
}

.shop-log-title {
    font-weight: 600;
}

.shop-log-item pre {
    margin: 6px 0 0;
    overflow-x: auto;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
