/* orders.css: everything about one order: progress steps, status pills, timeline,
   items, payment. Used by the client page, My orders and the manager page. */

.order-title { font-size: 1.45rem; }
.pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem; white-space: nowrap; }
.pill-new { background: #fdebc8; color: #7a4b00; }
.pill-active { background: #dfeaf7; color: #17457a; }
.pill-done { background: var(--ok-bg); color: var(--ok); }
.pill-stopped { background: #ecebe8; color: #5f5c56; }

/* ---------- Progress steps ---------- */
.tracker { list-style: none; margin: 0; padding: 8px 0 0; display: grid; grid-template-columns: repeat(var(--steps, 4), 1fr); }
.tstep { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 0 6px; }
/* connector coming in from the previous step */
.tstep::before { content: ""; position: absolute; top: 22px; right: 50%; width: 100%; height: 3px; background: var(--line); border-radius: 2px; }
.tstep:first-child::before { display: none; }
.tstep.is-done::before, .tstep.is-active::before { background: var(--ink); }

.tdot { position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #d9d6cf; color: #a29e96; }
.is-done .tdot { background: var(--ink); border-color: var(--ink); color: #fff; }
.is-active .tdot { background: var(--accent); border-color: var(--accent); color: var(--ink); animation: pulse 2.4s ease-out infinite; }
.is-stopped .tdot { background: #ecebe8; border-color: #cfccc5; color: #77736c; }

.tbody { display: flex; flex-direction: column; gap: 2px; align-items: inherit; }
.tlabel { font-weight: 700; font-size: .96rem; color: var(--head); }
.is-todo .tlabel { color: var(--muted); font-weight: 600; }
.tstate { font-size: .8rem; color: var(--muted); }
.is-active .tstate { color: #8a4b00; font-weight: 600; }
.ttext { margin-top: 4px; font-size: .84rem; max-width: 24ch; }

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(242, 154, 31, .5); }
    70%  { box-shadow: 0 0 0 11px rgba(242, 154, 31, 0); }
    100% { box-shadow: 0 0 0 0 rgba(242, 154, 31, 0); }
}
@media (prefers-reduced-motion: reduce) { .is-active .tdot { animation: none; box-shadow: 0 0 0 5px rgba(242, 154, 31, .25); } }

@media (max-width: 640px) {
    .tracker { grid-template-columns: 1fr; }
    .tstep { flex-direction: row; align-items: flex-start; text-align: left; gap: 14px; padding: 0 0 22px; }
    .tstep:last-child { padding-bottom: 0; }
    .tstep::before, .tstep:first-child::before { display: block; right: auto; left: 21px; top: 46px; bottom: 2px; width: 3px; height: auto; background: var(--line); }
    .tstep:last-child::before { display: none; }
    .tstep.is-done::before { background: var(--ink); }
    .tstep.is-active::before { background: var(--line); }
    .tbody { align-items: flex-start; padding-top: 4px; }
    .ttext { max-width: none; }
}

/* ---------- Client page ---------- */
.track .page-head { align-items: flex-start; }
.welcome { margin-bottom: 20px; border-color: #f2d9a8; background: #fffaf0; }
.welcome h1 { margin-bottom: 6px; }
.welcome p { margin: 0; }
.tracker-card { margin-bottom: 20px; padding: 26px 22px 22px; }
.now-text { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.two-col { display: grid; gap: 20px; margin: 20px 0; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.panel > h2 { margin-bottom: 14px; }

.order-lines { list-style: none; margin: 0 0 12px; padding: 0; }
.order-lines li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.order-lines li:first-child { padding-top: 0; }
.order-lines img { width: 52px; height: 52px; object-fit: contain; background: #faf9f7; border-radius: 6px; flex: none; }
.ol-body { flex: 1; min-width: 0; }
.ol-top { display: flex; justify-content: space-between; gap: 12px; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-row strong { color: var(--head); }
.ledger { list-style: none; margin: 14px 0 0; padding: 0; font-size: .9rem; border-top: 1px solid var(--line); }
.ledger li { display: flex; justify-content: space-between; padding: 7px 0; }

.pay-now { margin-bottom: 20px; border-color: var(--accent); }
.pay-request + .pay-request { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pay-amount { font-size: 1.3rem; font-weight: 700; color: var(--head); }
.pay-methods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pay-info { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; }
.pay-info summary { cursor: pointer; font-weight: 600; }
.pay-info p { margin: 8px 0 0; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent-dark); }
.timeline time { font-size: .8rem; color: var(--muted); }
.timeline p { margin: 2px 0 0; }
.track-foot { margin-top: 26px; }

/* ---------- My orders ---------- */
.my-orders { display: grid; gap: 14px; margin-bottom: 24px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.my-orders:empty { display: none; }
.my-order .mo-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.my-order h2 { font-size: 1rem; letter-spacing: .02em; }
.mini-steps { display: flex; gap: 6px; margin: 16px 0 10px; }
.mini-steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.mini-steps i.is-done { background: var(--ink); }
.mini-steps i.is-active { background: var(--accent); }
.mo-meta { margin: 0 0 6px; }
.mo-actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.find-order { max-width: 520px; }
.find-order h2 { margin-bottom: 4px; }
.find-form { margin-top: 14px; }
.order-lines .spec-fabric img { width: 18px; height: 18px; border-radius: 50%; background: none; object-fit: cover; }   /* the small swatch in a chip, not a product picture */
