* { box-sizing: border-box; }
body.orders-page { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: "Cairo", Tahoma, Arial, sans-serif; }
.orders-shell { width: min(1040px, calc(100% - 36px)); margin-inline: auto; }
.orders-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.88); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.orders-header .orders-shell { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.orders-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; font-size: 1.15rem; font-weight: 800; }
.orders-brand .brand-logo { width: 34px; height: 34px; border-radius: 11px; }
.orders-nav { display: flex; align-items: center; gap: 8px; }
.orders-nav a { border-radius: 10px; padding: 8px 12px; color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 700; }
.orders-nav a:hover, .orders-nav a.active { color: var(--accent); background: var(--accent-soft); }
.orders-main { padding: 36px 0 80px; }
.orders-hero, .track-card, .order-card, .order-detail, .orders-empty { border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.orders-hero { padding: 28px; margin-bottom: 18px; background: radial-gradient(circle at 12% 18%, rgba(244,114,182,.16), transparent 28%), linear-gradient(135deg, #fff, #fff4f8); }
.orders-hero span { color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .04em; }
.orders-hero h1 { margin: 6px 0 8px; color: var(--brand-2); font-size: clamp(1.6rem, 3vw, 2.2rem); }
.orders-hero p { margin: 0; max-width: 640px; color: var(--muted); font-size: .9rem; line-height: 1.8; }
.track-card { padding: 20px; margin-bottom: 22px; }
.track-card h2 { margin: 0 0 6px; color: var(--brand); font-size: 1.05rem; }
.track-card p { margin: 0 0 14px; color: var(--muted); font-size: .8rem; }
.track-form { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 10px; }
.track-form input, .track-form button { min-height: 46px; border-radius: 12px; font: inherit; }
.track-form input { border: 1px solid var(--border); padding: 0 12px; background: #fffafd; }
.track-form input:focus { outline: 0; border-color: var(--accent); box-shadow: var(--ring); }
.track-form button { border: 0; padding: 0 18px; color: #fff; background: var(--accent); font-weight: 800; cursor: pointer; }
.track-form button:hover { background: var(--accent-hover); }
.track-message { display: none; margin-top: 12px; border-radius: 10px; padding: 10px 12px; font-size: .78rem; font-weight: 700; }
.track-message.error { display: block; color: #9b2136; background: #fff1f3; border: 1px solid #f1bdc5; }
.orders-section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.orders-section-head h2 { margin: 0; color: var(--brand); font-size: 1.2rem; }
.orders-section-head p { margin: 0; color: var(--muted); font-size: .8rem; }
.orders-list { display: grid; gap: 12px; }
.order-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 18px; text-decoration: none; color: inherit; transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease); }
.order-card:hover { transform: translateY(-3px); border-color: #ec9ec1; box-shadow: 0 16px 32px rgba(131,24,67,.1); }
.order-card strong { color: var(--brand); font-size: 1rem; }
.order-card small, .order-meta { color: var(--muted); font-size: .76rem; }
.order-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 5px 10px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.status-pill.received, .status-pill.new { color: #9a6a00; background: #fff8df; }
.status-pill.preparing, .status-pill.paid { color: #2456c8; background: #eef3ff; }
.status-pill.shipped { color: #7e22ce; background: #f3e8ff; }
.status-pill.delivered { color: #15803d; background: #ecfdf3; }
.status-pill.cancelled { color: #b42318; background: #fff1f2; }
.order-detail { padding: 24px; }
.detail-top { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 22px; }
.detail-top h2 { margin: 4px 0; color: var(--brand); font-size: 1.35rem; }
.timeline { display: grid; gap: 0; margin: 8px 0 26px; }
.timeline-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 18px; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-dot { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-size: .72rem; font-weight: 800; z-index: 1; }
.timeline-step::before { content: ""; position: absolute; top: 28px; right: 13px; width: 2px; bottom: 0; background: #f3d5e2; }
.timeline-step:last-child::before { display: none; }
.timeline-step.done .timeline-dot { color: #fff; background: #16a34a; }
.timeline-step.current .timeline-dot { color: #fff; background: var(--accent); box-shadow: 0 0 0 5px rgba(225,29,106,.14); }
.timeline-step.upcoming .timeline-dot { color: var(--muted); background: #fff; border: 1px solid var(--border); }
.timeline-step.cancelled .timeline-dot { color: #fff; background: #b42318; }
.timeline-copy b { display: block; color: var(--brand); font-size: .9rem; }
.timeline-copy span { color: var(--muted); font-size: .76rem; line-height: 1.6; }
.order-items { display: grid; gap: 10px; margin: 16px 0; }
.order-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid #fae7ef; border-radius: 14px; background: #fffafd; }
.order-item img, .order-item .noimg { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: #fff; }
.order-item .noimg { display: grid; place-items: center; color: var(--accent); }
.order-item strong { display: block; color: #38232d; font-size: .86rem; }
.order-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.order-facts div { border: 1px solid #f1dce5; border-radius: 12px; padding: 12px; background: #fff9fc; }
.order-facts span { color: var(--muted); font-size: .72rem; }
.order-facts strong { display: block; margin-top: 4px; color: var(--brand); font-size: .86rem; }
.orders-empty { display: grid; place-items: center; text-align: center; min-height: 220px; padding: 28px; }
.orders-empty h2 { margin: 0 0 6px; color: var(--brand); }
.orders-empty p { margin: 0 0 16px; color: var(--muted); }
.orders-empty a, .detail-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 11px; padding: 0 16px; color: #fff; background: var(--accent); text-decoration: none; font-size: .8rem; font-weight: 800; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.detail-actions a.ghost { color: var(--brand); background: #fff; border: 1px solid var(--border); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-width: 720px) {
  .track-form, .order-card, .detail-top, .order-facts { grid-template-columns: 1fr; }
  .orders-header .orders-shell { flex-wrap: wrap; padding-block: 10px; }
  .order-item { grid-template-columns: 54px minmax(0, 1fr); }
  .order-item strong + span { grid-column: 1 / -1; }
}
