/* =========================================
   CUSTOMER ORDER HISTORY — My Orders (customer-orders.js)
   ========================================= */

/* ——— Customer order history ——— */
.mo-shop-btn { display: inline-flex; align-items: center; gap: 6px; }
.mo-stat-link:hover { border-color: var(--primary); }
.mo-stat-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.mo-list { display: flex; flex-direction: column; gap: 14px; }
.mo-card {
  --status: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px 18px; transition: var(--transition);
}
.mo-card:hover { box-shadow: var(--shadow); }
.mo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.mo-no { border: none; background: none; padding: 0; font: inherit; font-size: 1rem; font-weight: 800; color: var(--primary); cursor: pointer; letter-spacing: 0.2px; }
.mo-no:hover { text-decoration: underline; }
.mo-date { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

.mo-track { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 14px; padding: 0; }
.mo-track li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.mo-track li:not(:first-child)::before {
  content: ''; position: absolute; top: 10px; right: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0;
}
.mo-track li.done:not(:first-child)::before, .mo-track li.current:not(:first-child)::before { background: var(--primary); }
.mo-dot {
  position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.mo-track li.done .mo-dot { background: var(--primary); border-color: var(--primary); }
.mo-track li.current .mo-dot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.mo-track li.current .mo-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.mo-step { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.mo-track li.done .mo-step { color: var(--text-secondary); }
.mo-track li.current .mo-step { color: var(--primary); font-weight: 700; }
.mo-halted {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 8px 12px; border-radius: var(--radius);
  background: var(--danger-light); color: #b91c1c; font-size: 0.8rem; font-weight: 600;
}

.mo-items { margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mo-items-head, .mo-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(110px, auto) 100px; align-items: center; gap: 12px; padding: 8px 14px; }
.mo-items-head { background: var(--bg); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-secondary); }
.mo-items-head span:first-child { grid-column: 1 / 3; }
.mo-items-head span:nth-child(2), .mo-row-qty { text-align: right; }
.mo-items-head span:last-child, .mo-row-sub { text-align: right; }
.mo-items-body { max-height: 320px; overflow-y: auto; }
.mo-row { border-top: 1px solid var(--border); }
.mo-row:first-child { border-top: none; }
.mo-thumb { width: 36px; height: 36px; }
.mo-thumb .pd-placeholder svg { width: 16px; height: 16px; }
.mo-row-name { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-row-qty { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mo-row-sub { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mo-more {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px;
  border: none; border-top: 1px solid var(--border); background: var(--surface-2);
  font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--primary); cursor: pointer; transition: var(--transition);
}
.mo-more:hover { background: var(--primary-lighter); }
.mo-more svg { transition: transform 0.2s ease; }
.mo-items.expanded .mo-more svg { transform: rotate(180deg); }

.mo-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--border); }
.mo-pay { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-secondary); }
.mo-total { margin-left: auto; text-align: right; }
.mo-total span { display: block; font-size: 0.72rem; color: var(--text-muted); }
.mo-total strong { font-size: 1.2rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.mo-actions { display: flex; gap: 8px; }
.mo-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 640px) {
  .page-header-row .mo-shop-btn { width: 100%; justify-content: center; margin-top: 10px; }
  .mo-card { padding: 14px; }
  .mo-step { font-size: 0.64rem; }
  .mo-items-head { display: none; }
  .mo-row { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-rows: auto auto; row-gap: 2px; padding: 8px 12px; }
  .mo-row .mo-thumb { grid-row: 1 / 3; }
  .mo-row-name { grid-column: 2; }
  .mo-row-qty { grid-column: 2; grid-row: 2; text-align: left; font-size: 0.74rem; }
  .mo-row-sub { grid-column: 3; grid-row: 1 / 3; }
  .mo-foot { gap: 10px; }
  .mo-actions { width: 100%; }
  .mo-actions .btn { flex: 1; justify-content: center; padding-inline: 6px; }
}
