/* Direct purchases: checkout.html, orders.html, order.html (and its printable invoice). */

.po-main { max-width: 1240px; }
.po-main [hidden] { display: none !important; }
.po-eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.po-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.po-header h1 { margin: 0; font-size: 26px; }
.po-header p { margin: 4px 0 0; }

/* Status badges */
.badge-compliance_review, .badge-awaiting_seller, .badge-payment_submitted { background: rgba(2,132,199,0.12); color: var(--info); }
.badge-awaiting_payment { background: rgba(180,83,9,0.12); color: var(--warning); }
.badge-paid, .badge-shipped, .badge-delivered { background: rgba(124,58,237,0.12); color: #6d28d9; }
.badge-completed { background: rgba(22,163,74,0.12); color: var(--success); }
.badge-declined, .badge-cancelled, .badge-rejected { background: rgba(91,100,120,0.14); color: var(--text-muted); }

/* ---------- Checkout ---------- */
.co-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.co-card h2 { margin: 0 0 4px; font-size: 18px; }
.co-section + .co-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.co-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.co-fields label { margin: 0 0 7px; }
.co-fields input, .co-fields select, .co-fields textarea { padding: 11px 13px; }
.co-span2 { grid-column: 1 / -1; }
.co-qty { display: flex; align-items: center; gap: 10px; }
.co-qty input { max-width: 180px; }
.co-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); }
.co-hint.is-warn { color: var(--danger); font-weight: 600; }

.co-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.co-method { position: relative; display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 16px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 400; color: var(--text); }
.co-method:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(241,90,44,0.12); }
.co-method:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.co-method input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.co-method span { display: flex; flex-direction: column; gap: 3px; }
.co-method strong { font-size: 14.5px; }
.co-method small { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.co-method em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--success); }

.co-summary { position: sticky; top: 24px; }
.co-product { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.co-thumb { flex-shrink: 0; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--bg); display: grid; place-items: center; color: var(--text-faint); }
.co-thumb img { width: 100%; height: 100%; object-fit: cover; }
.co-product strong { display: block; font-size: 15px; }
.co-product small { color: var(--text-muted); font-size: 13px; }
.co-lines { margin: 14px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14px; }
.co-lines dt { color: var(--text-muted); }
.co-lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.co-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.co-total strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.co-place { width: 100%; margin-top: 18px; padding: 14px; font-size: 15px; }
.co-steps { margin: 18px 0 0; padding: 14px 16px 14px 34px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.co-steps strong { color: var(--text); }

/* ---------- Orders list ---------- */
.po-table td { vertical-align: middle; }
.po-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.po-empty { text-align: center; padding: 40px 16px; }

/* ---------- Order detail ---------- */
.od-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.od-stepper { display: flex; gap: 0; margin: 4px 0 22px; list-style: none; padding: 0; }
.od-stepper li { flex: 1; position: relative; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-faint); padding-top: 30px; }
.od-stepper li::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--border); z-index: 1; }
.od-stepper li::after { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.od-stepper li:first-child::after { display: none; }
.od-stepper li.done { color: var(--text); }
.od-stepper li.done::before, .od-stepper li.done::after { background: var(--success); }
.od-stepper li.current { color: var(--accent); }
.od-stepper li.current::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(241,90,44,0.18); }

.od-action { border-left: 4px solid var(--accent); }
.od-action h2 { margin: 0 0 6px; font-size: 17px; }
.od-action p { margin: 0 0 14px; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.od-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.od-pay { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.od-pay-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 14px; font-size: 14px; }
.od-pay-row + .od-pay-row { border-top: 1px solid var(--border); }
.od-pay-row span { color: var(--text-muted); }
.od-pay-row strong { word-break: break-word; }
.od-pay-head { background: var(--bg); font-weight: 700; padding: 10px 14px; font-size: 13px; }

.od-timeline { list-style: none; margin: 0; padding: 0; }
.od-timeline li { position: relative; padding: 0 0 16px 22px; font-size: 13.5px; }
.od-timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.od-timeline li::after { content: ''; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.od-timeline li:last-child::after { display: none; }
.od-timeline strong { display: block; }
.od-timeline small { color: var(--text-muted); }

/* ---------- Invoice (screen + print) ---------- */
.inv { background: #fff; color: #12233d; border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.inv-title { margin: 0; font-size: 28px; letter-spacing: 0.02em; color: #12233d; text-transform: none; }
.inv-meta { display: grid; grid-template-columns: auto auto; gap: 4px 16px; font-size: 13.5px; }
.inv-meta dt { color: #5b6478; }
.inv-meta dd { margin: 0; font-weight: 600; text-align: right; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; font-size: 13.5px; line-height: 1.55; }
.inv-parties h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #5b6478; }
.inv table { width: 100%; font-size: 14px; }
.inv th { text-align: left; }
.inv .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-totals { margin: 16px 0 0 auto; width: min(340px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 14px; }
.inv-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.inv-totals .grand { font-size: 18px; font-weight: 800; padding-top: 8px; border-top: 2px solid #12233d; }
.inv-note { margin-top: 20px; font-size: 12.5px; color: #5b6478; line-height: 1.55; }

@media (max-width: 960px) {
  .co-grid, .od-grid { grid-template-columns: 1fr; }
  .co-summary { position: static; }
}
@media (max-width: 640px) {
  .co-fields, .co-methods, .inv-parties { grid-template-columns: 1fr; }
  .od-pay-row { grid-template-columns: 1fr; gap: 2px; }
  .od-stepper li { font-size: 10.5px; }
  .inv { padding: 20px; }
}

@media print {
  body * { visibility: hidden !important; }
  #invoice, #invoice * { visibility: visible !important; }
  #invoice { position: absolute; left: 0; top: 0; width: 100%; border: none; padding: 0; }
  .no-print { display: none !important; }
}
