:root {
    --bg: #0b0c0f;
    --panel: rgba(24, 25, 31, 0.95);
    --panel-soft: rgba(255, 255, 255, 0.03);
    --panel-strong: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --ink: #f6f7fb;
    --muted: rgba(246, 247, 251, 0.74);
    --muted-deep: rgba(246, 247, 251, 0.46);
    --accent: #fbbf24;
    --accent-strong: #f59e0b;
    --success: #4ade80;
    --danger: #fb7185;
    --shadow: 0 28px 60px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Inter", "Microsoft YaHei UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.18), transparent 28%),
        radial-gradient(circle at 85% 0%, rgba(59, 130, 246, 0.14), transparent 22%),
        linear-gradient(180deg, #09090b 0%, #131316 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

.checkout-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(14px);
    background: rgba(12, 13, 16, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.checkout-topbar-inner {
    width: min(1440px, calc(100vw - 32px));
    margin: 0 auto;
    min-height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.checkout-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.checkout-brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #0f0b03;
    font-size: 27px;
}

.checkout-brand-text {
    display: grid;
    gap: 4px;
}

.checkout-brand-text strong {
    font-size: 24px;
    line-height: 1;
}

.checkout-brand-text span {
    color: var(--muted-deep);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.checkout-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkout-nav-link,
.checkout-user-link {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    font-weight: 700;
}

.checkout-user-link {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #140d03;
}

.checkout-page-bg {
    padding: 28px 0 60px;
}

.checkout-shell {
    width: min(1440px, calc(100vw - 32px));
    margin: 0 auto;
}

.checkout-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 24px;
}

.checkout-kicker,
.section-kicker {
    margin: 0 0 8px;
    color: var(--muted-deep);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 800;
}

.checkout-hero h1,
.section-head h3 {
    margin: 0;
}

.checkout-hero h1 {
    font-size: clamp(34px, 4vw, 58px);
    line-height: 1;
}

.checkout-hero-text {
    margin: 14px 0 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
}

.checkout-back-link {
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    font-weight: 800;
}

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

.checkout-main,
.checkout-side {
    display: grid;
    gap: 22px;
}

.checkout-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 16px;
}

.section-meta {
    color: var(--muted);
    font-size: 14px;
}

.account-target,
.checkout-cart-list,
.payment-method-grid {
    display: grid;
    gap: 14px;
}

.account-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
}

.account-card.empty,
.selected-product-card.empty,
.checkout-order-card.empty {
    display: block;
    padding: 22px;
    text-align: center;
    color: var(--muted);
    line-height: 1.8;
}

.account-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.account-info h4,
.checkout-cart-item h4,
.selected-product-card h4 {
    margin: 0;
}

.account-info p,
.selected-product-card p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.checkout-cart-item {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.checkout-cart-item:hover,
.checkout-cart-item.is-selected {
    border-color: rgba(251, 191, 36, 0.34);
    background: rgba(251, 191, 36, 0.08);
    transform: translateY(-1px);
}

.checkout-cart-thumb,
.selected-product-thumb {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.96);
    padding: 10px;
}

.checkout-cart-thumb-fallback,
.selected-product-thumb-fallback {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(251, 191, 36, 0.65);
    font-size: 34px;
}

.checkout-cart-body {
    min-width: 0;
}

.checkout-cart-name {
    font-size: 19px;
    font-weight: 900;
    line-height: 1.25;
}

.checkout-cart-meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.checkout-cart-side {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.checkout-cart-price {
    font-size: 24px;
    font-weight: 900;
}

.checkout-cart-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.checkout-pill-button,
.checkout-ghost-button,
.submit-order-button,
.tracker-form button {
    border: 0;
    cursor: pointer;
    font-weight: 800;
}

.checkout-pill-button,
.checkout-ghost-button {
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
}

.checkout-pill-button {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

.checkout-ghost-button {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.payment-method-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.payment-method-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.payment-method-card:hover,
.payment-method-card.is-selected {
    border-color: rgba(251, 191, 36, 0.38);
    background: rgba(251, 191, 36, 0.08);
    transform: translateY(-1px);
}

.payment-method-card p,
.payment-method-card h4 {
    margin: 0;
}

.payment-method-provider {
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.payment-method-card h4 {
    margin-top: 10px;
    font-size: 22px;
    line-height: 1.2;
}

.payment-method-description {
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.7;
}

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

.checkout-field {
    display: grid;
    gap: 8px;
}

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

.checkout-field span {
    color: var(--muted-deep);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.checkout-field input,
.checkout-field textarea,
.tracker-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--ink);
    padding: 14px 16px;
    outline: none;
}

.checkout-field textarea {
    resize: vertical;
    min-height: 110px;
}

.checkout-field input::placeholder,
.checkout-field textarea::placeholder,
.tracker-form input::placeholder {
    color: var(--muted-deep);
}

.tracker-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 16px;
}

.tracker-form button {
    padding: 0 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #120b03;
}

.return-hint {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.12);
    color: #cde2ff;
    line-height: 1.7;
}

.checkout-order-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
    padding: 18px;
}

.order-items-summary {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.order-item-summary-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
}

.order-item-summary-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(251, 191, 36, 0.72);
    font-size: 24px;
}

.order-item-summary-thumb {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: contain;
    background: rgba(255,255,255,0.94);
    padding: 6px;
}

.order-item-summary-name {
    font-size: 18px;
    font-weight: 900;
    line-height: 1.25;
}

.order-item-summary-meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.order-item-summary-price {
    font-size: 22px;
    font-weight: 900;
    white-space: nowrap;
}

.order-state-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
    margin-bottom: 14px;
}

.status-pill {
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-pill.unpaid {
    background: rgba(251, 191, 36, 0.16);
    color: #fcd34d;
}

.status-pill.paid,
.status-pill.delivered {
    background: rgba(74, 222, 128, 0.16);
    color: #86efac;
}

.status-pill.retry,
.status-pill.expired,
.status-pill.cancelled {
    background: rgba(251, 113, 133, 0.16);
    color: #fda4af;
}

.status-pill.pending,
.status-pill.processing,
.status-pill.waiting_online,
.status-pill.created {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.order-row {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.order-label {
    color: var(--muted-deep);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.order-value {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.checkout-summary-card {
    position: sticky;
    top: 94px;
}

.selected-product-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.summary-grid {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.summary-item {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.summary-item span {
    display: block;
    color: var(--muted-deep);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.summary-item strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.submit-order-button {
    width: 100%;
    margin-top: 18px;
    border-radius: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    color: #110c03;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 20px 34px rgba(249, 115, 22, 0.22);
}

.submit-order-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.summary-link {
    display: inline-flex;
    margin-top: 14px;
    color: var(--muted);
    font-weight: 700;
}

.support-text {
    color: var(--muted);
    line-height: 1.8;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    display: grid;
    gap: 10px;
}

.toast {
    min-width: 240px;
    max-width: min(420px, calc(100vw - 36px));
    padding: 14px 16px;
    border-radius: 14px;
    color: #fff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.toast.info {
    background: rgba(59, 130, 246, 0.95);
}

.toast.success {
    background: rgba(34, 197, 94, 0.95);
}

.toast.error {
    background: rgba(239, 68, 68, 0.95);
}

@media (max-width: 1180px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-summary-card {
        position: static;
    }
}

@media (max-width: 860px) {
    .checkout-topbar-inner,
    .checkout-shell {
        width: min(100vw - 20px, 100%);
    }

    .checkout-topbar-inner,
    .checkout-topbar-actions,
    .checkout-hero,
    .section-head {
        flex-direction: column;
        align-items: start;
    }

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

    .checkout-cart-item,
    .selected-product-card,
    .account-card,
    .order-item-summary-card {
        grid-template-columns: 1fr;
    }

    .checkout-cart-side,
    .checkout-cart-actions {
        justify-items: start;
        justify-content: flex-start;
    }

    .payment-method-grid {
        grid-template-columns: 1fr;
    }

    .tracker-form {
        grid-template-columns: 1fr;
    }
}
