* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #172033;
    background: #f4f7fb;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

button {
    font: inherit;
}

.checkout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) 420px;
    gap: 24px;
    width: min(1120px, 100%);
}

.catalog,
.pay-panel {
    background: #ffffff;
    border: 1px solid #dde5f2;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

.catalog {
    padding: 32px;
}

.pay-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 560px;
    padding: 28px;
}

.section-title {
    margin-bottom: 28px;
}

.section-title p,
.summary span {
    margin: 0 0 8px;
    color: #5f6f89;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-title h1,
.summary h2 {
    margin: 0;
    color: #101827;
    letter-spacing: 0;
}

.section-title h1 {
    font-size: 34px;
    line-height: 1.15;
}

.product-grid {
    display: grid;
    gap: 16px;
}

.product-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    background: #fbfdff;
}

.product-card.is-selected {
    border-color: #246bfe;
    background: #f5f8ff;
    box-shadow: inset 4px 0 0 #246bfe;
}

.product-card h2 {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.35;
}

.product-card p {
    margin: 0;
    color: #66758c;
    font-size: 14px;
    line-height: 1.5;
}

.product-card strong,
.summary strong {
    color: #0f5bff;
    font-weight: 800;
}

.product-card strong {
    min-width: 72px;
    font-size: 20px;
    text-align: right;
}

.select-btn,
.primary-btn {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.select-btn {
    min-width: 72px;
    padding: 9px 14px;
    color: #1557d8;
    background: #eaf1ff;
}

.product-card.is-selected .select-btn {
    color: #ffffff;
    background: #246bfe;
}

.summary {
    padding-bottom: 18px;
    border-bottom: 1px solid #e7edf6;
}

.summary h2 {
    font-size: 24px;
}

.summary strong {
    display: block;
    margin-top: 10px;
    font-size: 36px;
}

.primary-btn {
    width: 100%;
    padding: 14px 18px;
    color: #ffffff;
    background: #246bfe;
    font-weight: 800;
}

.primary-btn:disabled {
    cursor: not-allowed;
    background: #9db7f2;
}

.qr-shell {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 22px;
    border: 1px dashed #bdc9dc;
    border-radius: 8px;
    background: #f8fbff;
}

.qrcode {
    display: grid;
    place-items: center;
    width: 272px;
    height: 272px;
    padding: 12px;
    border: 1px solid #e0e7f2;
    border-radius: 8px;
    background: #ffffff;
}

.qrcode canvas,
.qrcode img {
    display: block;
    width: 248px;
    height: 248px;
}

.qr-meta {
    width: 100%;
}

.qr-meta p,
.status-line {
    margin: 0;
    color: #5f6f89;
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
    word-break: break-all;
}

.status-line {
    margin-top: auto;
    padding: 13px 14px;
    border-radius: 6px;
    background: #eef4ff;
    color: #1d4fa3;
}

.status-line[data-mode="success"] {
    background: #eaf8ef;
    color: #14733d;
}

.status-line[data-mode="warning"] {
    background: #fff7e8;
    color: #9a5a00;
}

.status-line[data-mode="error"] {
    background: #ffeded;
    color: #b42318;
}

@media (max-width: 900px) {
    body {
        align-items: flex-start;
        padding: 20px 14px;
    }

    .checkout {
        grid-template-columns: 1fr;
    }

    .catalog,
    .pay-panel {
        padding: 22px;
    }

    .pay-panel {
        min-height: 0;
    }
}

@media (max-width: 560px) {
    .section-title h1 {
        font-size: 28px;
    }

    .product-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .product-card strong {
        text-align: left;
    }

    .select-btn {
        width: 100%;
    }

    .qrcode {
        width: 236px;
        height: 236px;
    }

    .qrcode canvas,
    .qrcode img {
        width: 212px;
        height: 212px;
    }
}
