/* Buyer order detail surface. Uses the marketplace's existing design tokens. */
.buyer-order-link { color: var(--navy); font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.buyer-order-link:hover { color: var(--primary); }
.buyer-order-detail { min-width: 0; color: var(--navy); }
.buyer-order-detail h2, .buyer-order-detail h3, .buyer-order-detail h4, .buyer-order-detail p { margin: 0; }
.buyer-order-detail h3 { font-size: 16px; font-weight: 700; }
.buyer-order-detail .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }
.buyer-order-detail .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; white-space: normal; }
.order-detail-toolbar, .order-detail-heading, .order-supplier-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.order-back { display: inline-flex; align-items: center; gap: 6px; color: var(--body); font-size: 13px; font-weight: 600; }
.order-back:hover { color: var(--primary); }
.order-detail-heading { margin: 24px 0; align-items: flex-start; }
.order-detail-heading > div { min-width: 0; }
.order-detail-heading h2 { font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; font-weight: 700; }
.order-detail-heading p, .order-supplier-heading p { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.order-status-summary { display: flex; align-items: center; gap: 14px; padding: 20px; background: var(--primary-soft); border-radius: var(--r-sm); color: var(--primary); }
.order-status-summary > .material-symbols-outlined { font-size: 30px; }
.order-status-summary h3 { color: inherit; font-size: 18px; }
.order-status-summary p { margin-top: 5px; font-size: 13px; line-height: 1.6; }
.order-status-summary.is-delivered { background: #edf5ed; color: #285638; }
.order-status-summary.is-cancelled { background: #faeeec; color: #8c3028; }
.order-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 26px 0; padding: 0; list-style: none; }
.order-progress li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 0 8px; min-width: 0; }
.order-progress li:not(:last-child)::after { content: ''; position: absolute; left: calc(50% + 25px); right: calc(-50% + 25px); top: 20px; height: 1px; background: var(--line); }
.order-progress li.is-done::after { background: var(--primary); }
.order-progress-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg-card); }
.order-progress .is-done, .order-progress .is-current { color: var(--primary); }
.order-progress .is-current .order-progress-icon { background: var(--primary); border-color: var(--primary); color: #fff; }
.order-progress .is-done .order-progress-icon { border-color: var(--primary); }
.order-progress strong { font-size: 12.5px; font-weight: 600; }
.order-progress time { font-size: 10.5px; line-height: 1.5; color: var(--body); }
.order-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 28px; }
.order-delivery-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 28px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.order-delivery-grid h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.order-delivery-address { padding-right: 24px; border-right: 1px solid var(--line); }
.order-delivery-address address { display: flex; flex-direction: column; gap: 6px; font-style: normal; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.order-delivery-address address span { white-space: pre-line; }
.order-delivery-address address strong { font-size: 14px; }
.order-buyer-note { margin-top: 22px; }
.order-buyer-note h4 { font-size: 12.5px; margin-bottom: 6px; }
.order-buyer-note p { font-size: 13px; color: var(--body); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.buyer-order-detail .order-muted { color: var(--muted); font-size: 12px; line-height: 1.65; }
.order-tracking { margin-bottom: 20px; font-size: 13px; }
.order-tracking > div { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.order-tracking-number { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; user-select: all; }
.order-events { list-style: none; padding: 0; margin: 18px 0 0; }
.order-event { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.order-event:not(:last-child)::after { content: ''; position: absolute; left: 4px; width: 1px; top: 13px; bottom: 1px; background: var(--line); }
.order-event-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); margin-top: 5px; flex-shrink: 0; }
.order-event.is-latest .order-event-dot { background: var(--primary); }
.order-event > div { min-width: 0; }
.order-event strong { font-size: 13px; }
.order-event p { color: var(--body); line-height: 1.65; font-size: 12.5px; margin-top: 3px; overflow-wrap: anywhere; }
.order-event time { color: var(--muted); display: block; font-size: 11.5px; margin-top: 4px; }
.order-older-events summary { cursor: pointer; color: var(--primary); font-size: 12.5px; font-weight: 600; padding: 8px 0; }
.order-purchase-section { padding-top: 28px; }
.order-supplier-heading { margin-bottom: 8px; }
.order-supplier-heading h3 { overflow-wrap: anywhere; }
.order-detail-items { margin: 0; padding: 0; list-style: none; }
.order-detail-items > li { display: flex; align-items: center; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.order-item-image { width: 66px; height: 66px; flex-shrink: 0; border-radius: var(--r-xs); overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; color: var(--muted); }
.order-item-image img { width: 100%; height: 100%; object-fit: cover; }
.order-item-description { flex: 1; min-width: 0; font-size: 13px; }
.order-item-description > a, .order-item-description > strong { color: var(--navy); font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.order-item-description > a:hover { text-decoration: underline; }
.order-item-description p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.order-item-description .order-made-to-order { color: var(--primary); }
.order-item-price { flex-shrink: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.order-payment-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-top: 28px; }
.order-payment-info h3 { margin-bottom: 14px; }
.order-payment-info dl { margin: 0; font-size: 12.5px; }
.order-payment-info dt { color: var(--muted); margin-top: 12px; }
.order-payment-info dd { margin: 4px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.order-cost-summary dl { margin: 0; }
.order-cost-summary dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; font-size: 12.5px; }
.order-cost-summary dt { color: var(--body); }
.order-cost-summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.order-cost-summary .order-grand-total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 18px; }
.order-grand-total dt { font-weight: 600; color: var(--navy); }
.order-grand-total dd { font-size: 24px; color: var(--primary); font-weight: 700; }
.order-cost-summary > p { text-align: right; margin-top: 8px; }
.order-detail-footer { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.order-detail-footer a { color: var(--primary); font-weight: 600; }
.order-detail-error { display: grid; place-items: center; text-align: center; gap: 16px; padding: 48px 20px; }
.order-detail-error > .material-symbols-outlined { font-size: 40px; color: var(--muted); }
.order-detail-error h2 { font-size: 20px; }
.order-detail-error p { color: var(--body); font-size: 14px; }
.order-detail-error > div { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.order-detail-loading { padding: 24px 0; }
.order-detail-loading span { display: block; height: 70px; border-radius: var(--r-sm); background: var(--bg-soft); margin-bottom: 18px; }
.order-detail-loading span:nth-child(2) { height: 160px; }
.order-detail-loading p { font-size: 13px; color: var(--muted); }
.buyer-order-detail :focus-visible, .buyer-order-link:focus-visible, .order-detail-error :focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
@media (max-width: 1100px) {
  .order-detail-heading { flex-direction: column; gap: 12px; }
  .order-payment-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 680px) {
  .account-layout.is-order-detail > .account-sidebar { display: none; }
  .account-layout.is-order-detail { margin-top: 16px; }
  .account-content-card.has-order-detail { padding: 20px; }
  .order-detail-heading h2 { font-size: 19px; }
  .order-status-summary { padding: 16px; align-items: flex-start; }
  .order-status-summary h3 { font-size: 16px; }
  .order-progress { grid-template-columns: 1fr; gap: 18px; margin: 22px 0; }
  .order-progress li { display: grid; grid-template-columns: 36px 1fr; text-align: left; align-items: center; gap: 2px 12px; padding: 0; }
  .order-progress-icon { width: 34px; height: 34px; grid-row: span 2; }
  .order-progress li:not(:last-child)::after { left: 16px; top: 36px; bottom: -16px; right: auto; width: 1px; height: auto; }
  .order-progress time { grid-column: 2; }
  .order-detail-actions > .btn { flex: 1 1 44%; }
  .order-delivery-grid { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .order-delivery-address { border-right: 0; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
  .order-supplier-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .order-item-image { width: 48px; height: 48px; }
  .order-detail-items > li { flex-wrap: wrap; gap: 10px; }
  .order-item-description { flex-basis: calc(100% - 64px); }
  .order-item-price { margin-left: 58px; }
  .order-grand-total dd { font-size: 22px; }
}
@media print {
  .order-detail-toolbar, .order-detail-actions, .order-detail-heading > button, .order-tracking button { display: none; }
  .order-older-events { display: block; }
}
