/* ==========================================================================
   order-view.css — تفاصيل الطلب للزبون (view_order.php) وتتبع الطلب (order_tracker.php) — البادئة ov-
   يعتمد على متغيرات header.php: --accent --bg-dark --border-color --text-primary --text-secondary --text-muted
   ========================================================================== */
.ov { --ov-accent: var(--accent, #ffcc00); --ov-surface: rgba(15, 19, 26, 0.62); --ov-border: rgba(255, 255, 255, 0.07); --ov-muted: #94a3b8; --ov-green: #10b981; --ov-red: #ef4444; --ov-blue: #3b82f6; font-family: 'Cairo', sans-serif; color: var(--text-primary, #f8fafc); padding: 28px 0 48px; }
.ov *, .ov *::before, .ov *::after { box-sizing: border-box; }
.ov-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 18px; }
.ov-wrap--narrow { max-width: 560px; }
.ov-card { background: var(--ov-surface); border: 1px solid var(--ov-border); border-radius: 20px; padding: 22px 24px; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32); min-width: 0; }
.ov-card__title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 16px; font-weight: 800; color: #fff; }
.ov-card__title i { color: var(--ov-accent); }

/* الرأس */
.ov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ov-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ov-muted); text-decoration: none; font-size: 13px; font-weight: 700; margin-bottom: 8px; transition: color .2s; }
.ov-back:hover { color: var(--ov-accent); }
.ov-title { margin: 0; font-size: clamp(22px, 3vw, 28px); font-weight: 800; color: #fff; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; line-height: 1.3; }
.ov-sub { margin: 6px 0 0; color: var(--ov-muted); font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ov-sub b { color: #fff; }
.ov-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; border: 1px solid transparent; white-space: nowrap; }
.ov-badge--pending { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.ov-badge--processing { background: rgba(59, 130, 246, 0.14); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.ov-badge--completed { background: rgba(16, 185, 129, 0.14); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.ov-badge--cancelled { background: rgba(239, 68, 68, 0.14); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.ov-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ov-inline-form { margin: 0; display: inline; }
.ov-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: linear-gradient(135deg, var(--ov-accent), #e6b800); color: #0b0f19; font: 800 14px/1 'Cairo', sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: 0 6px 16px rgba(255, 204, 0, 0.18); transition: transform .2s, box-shadow .2s, background .2s, color .2s; }
.ov-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255, 204, 0, 0.28); color: #000; }
.ov-btn--ghost { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary, #cbd5e1); border-color: rgba(255, 255, 255, 0.12); box-shadow: none; }
.ov-btn--ghost:hover { color: #fff; border-color: rgba(255, 204, 0, 0.35); box-shadow: none; }
.ov-btn--wa { background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; box-shadow: 0 6px 16px rgba(37, 211, 102, 0.22); }
.ov-btn--wa:hover { color: #fff; }
.ov-btn--block { width: 100%; }

/* خط سير الطلب */
.ov-timeline { list-style: none; margin: 0; padding: 8px 0 0; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ov-timeline::before, .ov-timeline::after { content: ''; position: absolute; top: 31px; height: 4px; border-radius: 4px; left: 16.66%; right: 16.66%; background: rgba(255, 255, 255, 0.08); }
.ov-timeline::after { background: linear-gradient(90deg, var(--ov-green), var(--ov-accent)); width: calc(var(--ov-progress, 0%) * 0.6666); right: 16.66%; left: auto; transition: width 1s ease; }
.ov-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.ov-step__icon { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #111827; border: 3px solid rgba(255, 255, 255, 0.12); color: var(--ov-muted); font-size: 17px; transition: all .3s; }
.ov-step__label { font-size: 14px; font-weight: 800; color: var(--ov-muted); }
.ov-step__desc { font-size: 12px; color: var(--text-muted, #64748b); line-height: 1.6; max-width: 200px; }
.ov-step.is-done .ov-step__icon { background: var(--ov-green); border-color: var(--ov-green); color: #fff; }
.ov-step.is-done .ov-step__label { color: #a7f3d0; }
.ov-step.is-active .ov-step__icon { background: var(--ov-accent); border-color: var(--ov-accent); color: #000; box-shadow: 0 0 0 6px rgba(255, 204, 0, 0.14), 0 8px 20px rgba(255, 204, 0, 0.25); animation: ov-pulse 2s infinite; }
.ov-step.is-active .ov-step__label { color: #fff; }
@keyframes ov-pulse { 0%, 100% { box-shadow: 0 0 0 6px rgba(255, 204, 0, 0.14); } 50% { box-shadow: 0 0 0 10px rgba(255, 204, 0, 0.06); } }
.ov-cancelled { display: flex; align-items: center; gap: 14px; padding: 6px 4px; color: #fecaca; }
.ov-cancelled > i { font-size: 34px; color: var(--ov-red); }
.ov-cancelled b { display: block; color: #fff; font-size: 16px; }
.ov-cancelled span { font-size: 13px; color: var(--ov-muted); }

/* التخطيط */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ov-main, .ov-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* المواد */
.ov-table-wrap { overflow-x: auto; border: 1px solid var(--ov-border); border-radius: 14px; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ov-table thead th { padding: 11px 14px; text-align: right; font-size: 12px; font-weight: 800; color: var(--ov-muted); background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--ov-border); white-space: nowrap; }
.ov-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--ov-border); vertical-align: middle; }
.ov-table tbody tr:last-child td { border-bottom: 0; }
.ov-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ov-item__img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: #1f2937; border: 1px solid rgba(255, 255, 255, 0.06); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--ov-muted); }
.ov-item__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ov-item__name { font-weight: 800; color: #fff; font-size: 14px; }
.ov-item__meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--ov-muted); }
.ov-item__meta span { background: rgba(255, 255, 255, 0.05); padding: 2px 8px; border-radius: 6px; }
.ov-item__meta i { color: var(--ov-accent); margin-inline-end: 3px; }
.ov-num { white-space: nowrap; font-variant-numeric: tabular-nums; color: #e2e8f0; }
.ov-num small { color: var(--ov-muted); font-size: 11px; }
.ov-num--total { color: var(--ov-accent); font-weight: 800; }
.ov-empty { padding: 26px; text-align: center; color: var(--ov-muted); }
.ov-summary { margin-top: 16px; margin-inline-start: auto; max-width: 340px; display: flex; flex-direction: column; gap: 2px; }
.ov-summary__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 4px; font-size: 14px; color: var(--text-secondary, #cbd5e1); border-bottom: 1px dashed rgba(255, 255, 255, 0.08); }
.ov-summary__row--discount { color: #fca5a5; }
.ov-summary__row--total { border: 0; margin-top: 6px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 204, 0, 0.08); border: 1px solid rgba(255, 204, 0, 0.25); color: #fff; font-size: 16px; font-weight: 800; }
.ov-summary__row--total span:last-child { color: var(--ov-accent); font-size: 19px; }
.ov-summary__row--total small { font-size: 12px; color: var(--ov-muted); }

/* المعلومات الجانبية */
.ov-dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ov-dl > div { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); }
.ov-dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.ov-dl dt { font-size: 11.5px; font-weight: 800; color: var(--ov-muted); }
.ov-dl dd { margin: 0; font-size: 14px; color: #f1f5f9; font-weight: 700; word-break: break-word; }
.ov-dl dd[dir="ltr"] { text-align: right; }
.ov-notes { font-weight: 600 !important; color: #e2e8f0 !important; line-height: 1.7; }
.ov-copy { font-family: monospace, 'Cairo'; letter-spacing: .02em; }
.ov-link { color: var(--ov-accent); text-decoration: none; font-weight: 800; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.ov-link:hover { text-decoration: underline; }
.ov-help { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; background: linear-gradient(160deg, rgba(255, 204, 0, 0.07), rgba(15, 19, 26, 0.7) 60%); }
.ov-help > i { font-size: 22px; color: var(--ov-accent); margin-top: 2px; }
.ov-help > div { flex: 1 1 160px; min-width: 0; }
.ov-help b { display: block; color: #fff; font-size: 14px; }
.ov-help span { font-size: 12.5px; color: var(--ov-muted); line-height: 1.7; }
.ov-help .ov-link { width: 100%; }

/* نموذج التتبع */
.ov-lookup { text-align: center; padding: 34px 30px 28px; }
.ov-lookup__badge { width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: rgba(255, 204, 0, 0.10); border: 1px solid rgba(255, 204, 0, 0.30); color: var(--ov-accent); font-size: 24px; }
.ov-lookup__title { margin: 0 0 6px; font-size: 24px; font-weight: 800; color: #fff; }
.ov-lookup__sub { margin: 0 0 22px; color: var(--ov-muted); font-size: 13.5px; line-height: 1.8; }
.ov-form { text-align: right; display: flex; flex-direction: column; gap: 14px; }
.ov-field label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--ov-muted); font-size: 13px; font-weight: 700; }
.ov-field label i { color: var(--ov-accent); }
.ov-input { width: 100%; min-height: 48px; padding: 12px 15px; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; color: #fff; font: 600 15px/1.5 'Cairo', sans-serif; outline: none; direction: ltr; text-align: left; transition: border-color .2s, box-shadow .2s; -moz-appearance: textfield; }
.ov-input::-webkit-outer-spin-button, .ov-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ov-input::placeholder { color: var(--text-muted, #64748b); font-weight: 500; }
.ov-input:focus { border-color: var(--ov-accent); box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.12); }
.ov-form .ov-btn { margin-top: 4px; }
.ov-alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; font-size: 14px; font-weight: 700; text-align: right; }
.ov-alert--error { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.ov-lookup__links { display: flex; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px dashed rgba(255, 255, 255, 0.12); font-size: 13px; }
.ov-lookup__links a { display: inline-flex; align-items: center; gap: 7px; color: var(--ov-muted); text-decoration: none; font-weight: 700; transition: color .2s; }
.ov-lookup__links a i { color: var(--ov-accent); }
.ov-lookup__links a:hover { color: var(--ov-accent); }

/* غير موجود */
.ov-notfound { text-align: center; padding: 40px 24px; }
.ov-notfound > i { font-size: 44px; color: var(--ov-red); margin-bottom: 14px; }
.ov-notfound h2 { margin: 0 0 6px; color: #fff; font-size: 20px; }
.ov-notfound p { margin: 0 0 18px; color: var(--ov-muted); }
.ov-notfound .ov-actions { justify-content: center; }

@media (max-width: 900px) {
    .ov-grid { grid-template-columns: 1fr; }
    .ov-side { order: -1; }
}
@media (max-width: 640px) {
    .ov { padding-top: 18px; }
    .ov-wrap { padding: 0 14px; gap: 14px; }
    .ov-card { padding: 18px 16px; border-radius: 16px; }
    .ov-head { flex-direction: column; align-items: stretch; }
    .ov-actions .ov-btn, .ov-actions .ov-inline-form { flex: 1 1 auto; }
    .ov-actions .ov-inline-form .ov-btn { width: 100%; }
    .ov-timeline { grid-template-columns: 1fr; gap: 0; padding: 0; }
    .ov-timeline::before, .ov-timeline::after { top: 24px; bottom: 24px; height: auto; width: 4px; left: auto; right: 22px; }
    .ov-timeline::after { height: var(--ov-progress, 0%); bottom: auto; width: 4px; }
    .ov-step { display: grid; grid-template-columns: 48px 1fr; grid-template-areas: 'icon label' 'icon desc'; column-gap: 14px; row-gap: 2px; text-align: right; padding: 10px 0; }
    .ov-step__icon { grid-area: icon; }
    .ov-step__label { grid-area: label; align-self: end; }
    .ov-step__desc { grid-area: desc; align-self: start; max-width: none; }
    .ov-table thead { display: none; }
    .ov-table, .ov-table tbody, .ov-table tr, .ov-table td { display: block; width: 100%; }
    .ov-table tr { padding: 10px 12px; border-bottom: 1px solid var(--ov-border); }
    .ov-table tr:last-child { border-bottom: 0; }
    .ov-table tbody td { padding: 6px 0; border: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .ov-table tbody td.ov-td-head { display: block; padding-bottom: 8px; }
    .ov-table tbody td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--ov-muted); }
    .ov-summary { max-width: none; }
    .ov-lookup { padding: 26px 18px 22px; }
}
