@charset "UTF-8";

.checkout-page {
    background: #f8fafc;
}

.checkout-page .main {
    overflow: visible;
}

.checkout-hero {
    position: relative;
    padding: 56px 0 48px;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 20%, rgba(221, 50, 9, 0.11), transparent 30%),
        radial-gradient(circle at 88% 70%, rgba(15, 23, 42, 0.08), transparent 34%),
        linear-gradient(135deg, #fff 0%, #f8fafc 52%, #fff7ed 100%);
    border-bottom: 1px solid #e5e7eb;
}

.checkout-hero::after {
    position: absolute;
    right: -88px;
    bottom: -130px;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(221, 50, 9, 0.14);
    border-radius: 50%;
    content: "";
}

.checkout-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
}

.checkout-kicker,
.checkout-card-heading p,
.summary-heading p {
    margin: 0 0 7px;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.checkout-hero h1 {
    margin: 0 0 12px;
    color: #111827;
    font-size: clamp(36px, 5vw, 54px);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.checkout-lead {
    max-width: 620px;
    margin: 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.75;
}

.checkout-progress {
    display: flex;
    align-items: flex-start;
    min-width: 390px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checkout-progress li {
    position: relative;
    display: grid;
    flex: 1;
    justify-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 12px;
}

.checkout-progress li:not(:last-child)::after {
    position: absolute;
    top: 18px;
    left: calc(50% + 23px);
    width: calc(100% - 46px);
    height: 1px;
    background: #cbd5e1;
    content: "";
}

.checkout-progress li.is-complete:not(:last-child)::after {
    background: var(--accent-color);
}

.checkout-progress li > span {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.checkout-progress li.is-active,
.checkout-progress li.is-complete {
    color: #111827;
}

.checkout-progress li.is-active > span {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 5px rgba(221, 50, 9, 0.1);
    color: var(--accent-color);
}

.checkout-progress li.is-complete > span {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #fff;
}

.checkout-content {
    padding: 48px 0 88px;
}

.checkout-alert {
    margin-bottom: 22px;
    padding: 15px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
}

.checkout-alert.is-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.checkout-alert.is-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.checkout-alert.is-info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 28px;
    align-items: start;
}

.checkout-main {
    display: grid;
    gap: 24px;
}

.checkout-card,
.checkout-summary-card {
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
}

.checkout-card {
    padding: 30px;
}

.checkout-card-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid #eef2f7;
}

.checkout-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(221, 50, 9, 0.09);
    color: var(--accent-color);
    font-size: 21px;
    flex-shrink: 0;
}

.checkout-card-heading h2,
.summary-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.checkout-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.checkout-field {
    min-width: 0;
}

.checkout-field-wide {
    grid-column: 1 / -1;
}

.checkout-field label {
    display: block;
    margin-bottom: 9px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 700;
}

.checkout-field label span {
    color: var(--accent-color);
}

.checkout-field input,
.checkout-field select,
.checkout-field textarea {
    display: block;
    width: 100%;
    max-width: none;
    border: 1px solid #dbe2ea;
    border-radius: 13px;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.checkout-field input,
.checkout-field select {
    height: 52px;
    padding: 0 15px;
}

.checkout-field textarea {
    min-height: 112px;
    padding: 14px 15px;
    resize: vertical;
}

.checkout-field input::placeholder,
.checkout-field textarea::placeholder {
    color: #a1aab8;
}

.checkout-field input:hover,
.checkout-field select:hover,
.checkout-field textarea:hover {
    border-color: #b8c2cf;
}

.checkout-field input:focus,
.checkout-field select:focus,
.checkout-field textarea:focus {
    border-color: var(--accent-color);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(221, 50, 9, 0.1);
}

.checkout-field small {
    display: block;
    margin-top: 7px;
    color: #7c8798;
    font-size: 12px;
}

.checkout-select {
    position: relative;
}

.checkout-select select {
    padding-right: 42px;
    appearance: none;
}

.checkout-select i {
    position: absolute;
    top: 50%;
    right: 16px;
    color: #64748b;
    pointer-events: none;
    transform: translateY(-50%);
}

.payment-options {
    display: grid;
    gap: 12px;
}

.payment-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    margin: 0;
    padding: 16px 18px;
    border: 1px solid #dbe2ea;
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.payment-option:hover {
    border-color: #b8c2cf;
    background: #fbfcfe;
}

.payment-option.is-selected {
    border-color: var(--accent-color);
    background: rgba(221, 50, 9, 0.035);
    box-shadow: 0 0 0 3px rgba(221, 50, 9, 0.08);
}

.payment-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.payment-radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    flex-shrink: 0;
}

.payment-option input:checked + .payment-radio {
    border-color: var(--accent-color);
}

.payment-option input:checked + .payment-radio::after {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
    content: "";
}

.payment-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.payment-copy strong {
    color: #111827;
    font-size: 15px;
}

.payment-copy small {
    color: #748094;
    font-size: 13px;
    line-height: 1.5;
}

.payment-copy small:empty::before {
    content: "訂單成立後將前往安全付款頁面。";
}

.payment-secure-icon {
    margin-left: auto;
    color: #94a3b8;
    font-size: 20px;
}

.payment-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 15px;
    background: #f8fafc;
}

.payment-empty > i {
    color: #94a3b8;
    font-size: 28px;
}

.payment-empty strong {
    color: #334155;
}

.payment-empty p {
    margin: 3px 0 0;
    color: #7c8798;
    font-size: 13px;
}

.payment-gateway-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}

.payment-gateway-note i {
    margin-top: 2px;
    color: var(--accent-color);
}

.payment-gateway-note strong {
    color: #334155;
}

.checkout-sidebar {
    position: sticky;
    top: 158px;
}

.checkout-summary-card {
    padding: 26px;
}

.summary-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eef2f7;
}

.summary-heading a {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.summary-heading a:hover {
    color: var(--accent-color);
}

.checkout-items {
    max-height: 306px;
    overflow-y: auto;
}

.checkout-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 16px 2px;
    border-bottom: 1px solid #eef2f7;
}

.checkout-item-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(145deg, #edf1f5, #fff);
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.checkout-item-image img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.checkout-item-image strong {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 11px;
    background: #334155;
    color: #fff;
    font-size: 11px;
}

.checkout-item-copy {
    min-width: 0;
}

.checkout-item-copy h3 {
    margin: 0 0 4px;
    overflow: hidden;
    color: #1f2937;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-item-copy p {
    margin: 0;
    overflow: hidden;
    color: #8a94a3;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-item-price {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.checkout-empty {
    padding: 28px 12px;
    text-align: center;
}

.checkout-empty i {
    color: #94a3b8;
    font-size: 32px;
}

.checkout-empty p {
    margin: 8px 0;
    color: #64748b;
}

.checkout-empty a {
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 700;
}

.checkout-totals {
    padding: 14px 0 4px;
}

.checkout-totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    color: #64748b;
    font-size: 14px;
}

.checkout-totals strong {
    color: #334155;
    font-size: 15px;
}

.checkout-totals .checkout-total {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid #dfe5ec;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
}

.checkout-totals .checkout-total strong {
    color: #111827;
    font-size: 25px;
    letter-spacing: -0.03em;
}

.checkout-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.checkout-terms input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--accent-color);
    flex-shrink: 0;
}

.checkout-terms a {
    color: #334155;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.checkout-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 14px;
    background: #111827;
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.18);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.checkout-submit:not(:disabled):hover {
    background: var(--accent-color);
    box-shadow: 0 14px 28px rgba(221, 50, 9, 0.22);
    transform: translateY(-1px);
}

.checkout-submit:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}

.checkout-submit .bi-arrow-right {
    font-size: 18px;
}

.checkout-submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.checkout-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 13px;
    color: #8a94a3;
    font-size: 11px;
}

.checkout-security i {
    color: #16a34a;
}

.checkout-result {
    min-height: calc(100vh - 110px);
    padding: 120px 0 88px;
    background:
        radial-gradient(circle at 15% 20%, rgba(221, 50, 9, 0.08), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.checkout-result-card {
    max-width: 680px;
    margin: 0 auto;
    padding: 54px 48px 42px;
    border: 1px solid #e6eaf0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
    text-align: center;
}

.checkout-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 22px;
    border-radius: 50%;
    background: #fff7ed;
    color: #ea580c;
    font-size: 34px;
}

.checkout-result-card.is-success .checkout-result-icon {
    background: #ecfdf5;
    color: #16a34a;
}

.checkout-result-card h1 {
    margin: 7px 0 14px;
    color: #111827;
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 800;
}

.checkout-result-message {
    max-width: 520px;
    margin: 0 auto;
    color: #667085;
    font-size: 15px;
    line-height: 1.8;
}

.checkout-result-details {
    display: grid;
    gap: 0;
    margin: 32px 0 0;
    padding: 8px 24px;
    border-radius: 16px;
    background: #f8fafc;
    text-align: left;
}

.checkout-result-details > div {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.checkout-result-details > div:last-child {
    border-bottom: 0;
}

.checkout-result-details dt {
    color: #7c8798;
    font-weight: 500;
}

.checkout-result-details dd {
    margin: 0;
    color: #1f2937;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-align: right;
}

.checkout-result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

.checkout-result-primary,
.checkout-result-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.checkout-result-primary {
    background: #111827;
    color: #fff;
}

.checkout-result-primary:hover {
    background: var(--accent-color);
    color: #fff;
}

.checkout-result-secondary {
    border: 1px solid #d8dee8;
    color: #334155;
}

.checkout-result-secondary:hover {
    border-color: #9aa5b4;
    color: #111827;
}

.checkout-result-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 26px 0 0;
    color: #94a3b8;
    font-size: 12px;
}

@media (max-width: 1199px) {
    .checkout-layout {
        grid-template-columns: minmax(0, 1fr) 350px;
    }

    .checkout-hero-content {
        align-items: flex-start;
    }

    .checkout-progress {
        min-width: 340px;
        margin-top: 15px;
    }
}

@media (max-width: 991px) {
    .checkout-hero {
        padding: 44px 0 38px;
    }

    .checkout-hero-content {
        display: block;
    }

    .checkout-progress {
        max-width: 480px;
        min-width: 0;
        margin-top: 30px;
    }

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

    .checkout-sidebar {
        position: static;
    }

    .checkout-summary-card {
        max-width: none;
    }
}

@media (max-width: 767px) {
    .checkout-content {
        padding: 28px 0 56px;
    }

    .checkout-hero {
        padding: 36px 0 32px;
    }

    .checkout-hero h1 {
        font-size: 36px;
    }

    .checkout-lead {
        font-size: 14px;
    }

    .checkout-progress li strong {
        font-size: 11px;
    }

    .checkout-card,
    .checkout-summary-card {
        border-radius: 18px;
    }

    .checkout-card {
        padding: 22px 18px;
    }

    .checkout-card-heading {
        margin-bottom: 22px;
        padding-bottom: 18px;
    }

    .checkout-card-heading h2,
    .summary-heading h2 {
        font-size: 21px;
    }

    .checkout-fields {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .checkout-field-wide {
        grid-column: auto;
    }

    .checkout-summary-card {
        padding: 22px 18px;
    }

    .checkout-result {
        padding: 88px 0 56px;
    }

    .checkout-result-card {
        padding: 38px 20px 30px;
        border-radius: 18px;
    }

    .checkout-result-details {
        padding: 6px 16px;
    }

    .checkout-result-actions {
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .checkout-progress li:not(:last-child)::after {
        left: calc(50% + 18px);
        width: calc(100% - 36px);
    }

    .checkout-progress li > span {
        width: 32px;
        height: 32px;
    }

    .checkout-progress li:not(:last-child)::after {
        top: 16px;
    }

    .checkout-item {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .checkout-item-image {
        width: 46px;
        height: 46px;
    }

    .checkout-item-price {
        grid-column: 2;
    }
}
