/* ===== ORDER PAGES: Shared styles ===== */

.order-page {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 100px 32px 60px;
    min-height: 80vh;
}

.order-page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
}

.order-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}
.order-empty svg {
    opacity: .4;
    margin-bottom: 16px;
}
.order-empty h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.order-empty p {
    font-size: 15px;
    max-width: 400px;
    margin: 0 auto;
}


/* ===== CHECKOUT ===== */

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    align-items: start;
}

.checkout-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-item {
    display: grid;
    grid-template-columns: 56px 1fr auto auto;
    gap: 16px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.checkout-item-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
}
.checkout-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.checkout-item-title {
    font-weight: 500;
    font-size: 15px;
}
.checkout-item-variant {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.checkout-item-qty {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.checkout-item-price {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
}

/* Sidebar */
.checkout-sidebar {
    position: sticky;
    top: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.checkout-email-section {
    margin-bottom: 20px;
}
.checkout-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}
.checkout-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    outline: none;
    transition: border-color .2s;
}
.checkout-input:focus {
    border-color: var(--accent);
}
.checkout-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.checkout-info-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(0, 229, 255, .06);
    border: 1px solid rgba(0, 229, 255, .15);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.checkout-info-block svg {
    flex-shrink: 0;
}

.checkout-summary {
    margin-bottom: 20px;
}
.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
}
.checkout-summary-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}
.checkout-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    padding: 6px 0;
}

.btn-checkout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
}
.btn-checkout:hover:not(:disabled) {
    background: #33eaff;
    transform: translateY(-1px);
}
.btn-checkout:disabled {
    opacity: .5;
    cursor: wait;
}

.checkout-disclaimer {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
    line-height: 1.4;
}


/* ===== PAYMENT STATUS ===== */

.status-card {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.status-icon {
    margin-bottom: 20px;
}
.status-icon--success svg {
    color: #4caf50;
}
.status-icon--failed svg {
    color: #f44336;
}

.status-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
}
.status-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

.status-order-summary {
    text-align: left;
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}
.status-order-id {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-family: 'Cascadia Code', monospace;
}
.status-order-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
}
.status-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-item-qty {
    color: var(--text-secondary);
    font-size: 13px;
}
.status-item-price {
    font-weight: 500;
    white-space: nowrap;
}
.status-order-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
}

.status-codes-section {
    text-align: left;
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}
.status-codes-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}
.status-codes-hint {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.status-poll-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .4; transform: scale(.8); }
}

.status-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.btn-accent:hover {
    background: #33eaff;
    transform: translateY(-1px);
}
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ===== ORDERS LIST ===== */

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.order-card:hover {
    border-color: rgba(255, 255, 255, .15);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 0;
}
.order-card-id {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cascadia Code', monospace;
    font-size: 14px;
    color: var(--text-secondary);
}

.order-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge--pending {
    background: rgba(255, 193, 7, .15);
    color: #ffc107;
}
.badge--reserved {
    background: rgba(33, 150, 243, .15);
    color: #42a5f5;
}
.badge--success {
    background: rgba(76, 175, 80, .15);
    color: #66bb6a;
}
.badge--failed {
    background: rgba(244, 67, 54, .15);
    color: #ef5350;
}
.badge--cancelled {
    background: rgba(158, 158, 158, .15);
    color: #9e9e9e;
}

.order-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}
.order-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: var(--text-secondary);
}
.order-card-total {
    font-size: 20px;
    font-weight: 700;
}

.order-card-details {
    padding: 0 20px;
}

.detail-items {
    border-top: 1px solid var(--border);
    padding: 12px 0;
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
}
.detail-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.detail-item-qty {
    color: var(--text-secondary);
    font-size: 13px;
}
.detail-item-price {
    font-weight: 500;
    white-space: nowrap;
}
.detail-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 0 4px;
    border-top: 1px solid var(--border);
}

/* ── Digital codes ── */
.detail-codes {
    margin: 12px 0;
    padding: 14px 16px;
    background: rgba(0, 229, 255, .05);
    border: 1px solid rgba(0, 229, 255, .15);
    border-radius: 10px;
}
.detail-codes-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}
.detail-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.detail-code-row + .detail-code-row {
    border-top: 1px solid rgba(255,255,255,.06);
}
.detail-code-value {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
    background: rgba(255,255,255,.04);
    padding: 6px 10px;
    border-radius: 6px;
}
.detail-code-copy {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-code-copy:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.order-card-footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px 16px;
}

.btn-details {
    padding: 8px 16px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
}
.btn-details:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-cancel-order {
    padding: 8px 16px;
    background: transparent;
    color: #ef5350;
    border: 1px solid rgba(244, 67, 54, .3);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
}
.btn-cancel-order:hover {
    background: rgba(244, 67, 54, .1);
    border-color: #ef5350;
}


/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .order-page {
        padding: 80px 16px 40px;
    }
    .order-page-title {
        font-size: 24px;
    }
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    .checkout-sidebar {
        position: static;
    }
    .checkout-item {
        grid-template-columns: 48px 1fr;
        gap: 10px;
    }
    .checkout-item-qty,
    .checkout-item-price {
        grid-column: 2;
    }
    .status-card {
        padding: 32px 20px;
    }
    .status-title {
        font-size: 22px;
    }
}
