﻿/* 僅套用於 checkout，避免影響共用樣式的其他遊戲頁。 */
.page-store-content.creator-checkout {
    box-sizing: border-box;
    padding: 30px 15px;
    background: #f4f4f4;
}

.page-store-content.creator-checkout .sc-scope.scope-type2 {
    width: 1100px;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: repeat(4, auto);
    grid-template-areas: "product summary" "recipient summary" "payment summary" "notice summary";
    gap: 15px;
    align-items: start;
}

.page-store-content.creator-checkout .sc-scope.scope-type2 > .wrap {
    box-sizing: border-box;
    min-width: 0;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    overflow-wrap: anywhere;
}

.page-store-content.creator-checkout .sc-scope.scope-type2 > .sc-section { grid-area: product; }
.page-store-content.creator-checkout .sc-scope.scope-type2 > .uid-box,
.page-store-content.creator-checkout .sc-scope.scope-type2 > .char-box { grid-area: recipient; }
.page-store-content.creator-checkout .sc-scope.scope-type2 > .pay-method { grid-area: payment; }
.page-store-content.creator-checkout .sc-scope.scope-type2 > .notice-scope { grid-area: notice; }
.page-store-content.creator-checkout .sc-scope.scope-type2 > .sc-aside {
    grid-area: summary;
    position: sticky;
    top: 100px;
    align-self: start;
}

.page-store-content.creator-checkout .sc-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
    color: #666;
}

.page-store-content.creator-checkout .sc-section .product-info {
    grid-template-columns: 130px minmax(0, 1fr);
}

.page-store-content.creator-checkout .product-info .p-title > .CM-flex {
    flex-wrap: wrap;
    gap: 8px 15px;
}

.page-store-content.creator-checkout .product-info .p-caption > .CM-flex {
    flex-wrap: wrap;
    gap: 10px 15px;
}

.page-store-content.creator-checkout .product-info .num-row {
    max-width: 100%;
    flex-shrink: 0;
}

.page-store-content.creator-checkout .sc-scope.scope-type2 .uid-box .CM-input {
    width: 400px;
    max-width: 100%;
}

.page-store-content.creator-checkout .char-fields {
    display: grid;
    grid-template-columns: minmax(0, 400px) 120px;
    grid-template-areas: "server query" "name .";
    gap: 15px 10px;
    align-items: end;
}

.page-store-content.creator-checkout .char-server-field { grid-area: server; min-width: 0; }
.page-store-content.creator-checkout .char-name-field { grid-area: name; min-width: 0; }
.page-store-content.creator-checkout .char-query-button { grid-area: query; }
.page-store-content.creator-checkout .char-fields label {
    display: block;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
}

.page-store-content.creator-checkout .char-fields .CM-select,
.page-store-content.creator-checkout .char-fields .CM-select select,
.page-store-content.creator-checkout .char-fields .CM-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.page-store-content.creator-checkout .char-fields .CM-btn {
    height: 42px;
    line-height: 1.4;
    padding: 0 12px;
    font: inherit;
    cursor: pointer;
}

.page-store-content.creator-checkout .char-fields .CM-btn:disabled {
    background: #d9d9d9;
    border-color: #d9d9d9;
    color: #666;
    cursor: not-allowed;
    filter: none;
}

.page-store-content.creator-checkout .char-query-result {
    margin: 0;
    padding: 15px;
    background: #f4f4f4;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #1e1e1e;
    overflow-wrap: anywhere;
}

.page-store-content.creator-checkout .char-query-result[data-state="error"] { color: #c43822; background: #fff2ee; }
.page-store-content.creator-checkout .char-query-result[data-state="success"] { color: #26723d; }
.page-store-content.creator-checkout .char-query-help { margin: 0; line-height: 1.6; }

.page-store-content.creator-checkout .sc-scope .pay-method .pay-btn-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.page-store-content.creator-checkout .sc-scope .pay-method .pay-btn-list button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 12px 16px;
    gap: 8px;
    line-height: 1.4;
    align-items: center;
}

.page-store-content.creator-checkout .pay-btn-list button span { min-width: 0; overflow-wrap: anywhere; }
.page-store-content.creator-checkout .sc-scope .pay-method .pay-btn-list button img {
    width: auto;
    max-width: 32px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.page-store-content.creator-checkout button:focus-visible,
.page-store-content.creator-checkout a:focus-visible {
    outline: 2px solid #0071b8;
    outline-offset: 3px;
}

.page-store-content.creator-checkout .sc-aside .CM-flex { gap: 10px; flex-wrap: wrap; }
.page-store-content.creator-checkout .notice-scope .CM-notice { line-height: 1.6; }
.page-store-content.creator-checkout .creator-checkout-summary-spacer { height: 0; }
.page-store-content.creator-checkout .sc-scope.scope-type2.creator-store-empty { display: block; }

@media screen and (max-width: 1000px) {
    .page-store-content.creator-checkout { padding: 15px; }
    .page-store-content.creator-checkout .sc-scope.scope-type2 {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        grid-template-areas: "product" "recipient" "payment" "summary" "notice";
    }
    .page-store-content.creator-checkout .sc-scope.scope-type2 > .sc-aside {
        position: static;
        width: auto;
        top: auto;
        bottom: auto;
    }
}

@media screen and (max-width: 768px) {
    .page-store-content.creator-checkout { padding: 10px; }
    .page-store-content.creator-checkout .sc-scope.scope-type2 { gap: 10px; }
    .page-store-content.creator-checkout .sc-scope.scope-type2 > .wrap { padding: 20px; }
    .page-store-content.creator-checkout .sc-section .product-info { grid-template-columns: 100px minmax(0, 1fr); }
    .page-store-content.creator-checkout .sc-scope.scope-type2 .uid-box .CM-input { width: 100%; }
    .page-store-content.creator-checkout .sc-scope .pay-method .pay-btn-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-store-content.creator-checkout .sc-scope .pay-method .pay-btn-list button { padding: 12px 8px; gap: 5px; }
}

/* 腳本可預留實際高度後才啟用底部結帳欄。
   較矮的橫向畫面維持一般排列，避免遮住輸入區。 */
@media screen and (max-width: 768px) and (min-height: 601px) {
    .page-store-content.creator-checkout.has-fixed-summary .sc-scope.scope-type2 {
        grid-template-areas: "product" "recipient" "payment" "notice";
    }
    .page-store-content.creator-checkout.has-fixed-summary .sc-scope.scope-type2 > .sc-aside {
        grid-area: auto;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 50;
        padding: 15px 20px calc(15px + env(safe-area-inset-bottom, 0px));
        border-radius: 8px 8px 0 0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, .15);
        max-height: 50vh;
        overflow-y: auto;
    }
    .page-store-content.creator-checkout.has-fixed-summary .sc-aside .amount-row { margin: 15px 0; }
    .page-store-content.creator-checkout.has-fixed-summary .creator-checkout-summary-spacer {
        height: var(--checkout-summary-height, 320px);
    }
}

@media screen and (max-width: 576px) {
    .page-store-content.creator-checkout .char-fields {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "server" "name" "query";
    }
    .page-store-content.creator-checkout .char-query-button { width: 100%; }
}
