/* مكونات سوق السمك واللحوم — تعتمد على متغيرات tokens.css. RTL، بلا أيقونات بجانب النص. */
:root { --role: var(--brand); --role-tint: var(--brand-tint); }
.role-customer { --role: var(--role-customer); --role-tint: var(--role-customer-tint); }
.role-store { --role: var(--role-store); --role-tint: var(--role-store-tint); }
.role-marketer { --role: var(--role-marketer); --role-tint: var(--role-marketer-tint); }
.role-admin { --role: var(--role-admin); --role-tint: var(--role-admin-tint); }

.ui { font-family: var(--font-sans); color: var(--ink); background: var(--surface); direction: rtl; text-align: right;
  font-size: 15px; line-height: 24px; }
.ui *, .ui *::before, .ui *::after { box-sizing: border-box; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }

/* الأزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px;
  padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid transparent; font: inherit;
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-wash); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-soft); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 var(--space-3); font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { background: var(--surface-soft); color: var(--ink-muted); border-color: var(--line); cursor: not-allowed; }

/* الشارات */
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge-new { background: var(--info-tint); color: var(--info); }
.badge-accepted { background: var(--brand-tint); color: var(--brand); }
.badge-preparing { background: var(--warning-tint); color: var(--warning); }
.badge-ready { background: var(--role-customer-tint); color: var(--role-customer); }
.badge-delivered { background: var(--success-tint); color: var(--success); }
.badge-cancelled { background: var(--danger-tint); color: var(--danger); }
.badge-role { background: var(--role-tint); color: var(--role); }

/* الحقول */
.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field .req { color: var(--danger); }
.input { width: 100%; min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--control-border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; text-align: right; }
.input:focus { outline: 3px solid var(--brand-tint); border-color: var(--brand); }
.input.ltr { direction: ltr; text-align: left; }
.field .hint { font-size: 13px; color: var(--ink-muted); }
.field .error { font-size: 13px; color: var(--danger); }
.field.has-error .input { border-color: var(--danger); }

/* البطاقات */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
.product-card { display: grid; gap: var(--space-3); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: var(--space-3); }
.product-card .photo { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); background: var(--surface-soft);
  display: grid; place-items: center; color: var(--ink-muted); font-size: 13px; overflow: hidden; }
.product-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.product-card h3 { margin: 0; font-size: 17px; line-height: 26px; font-weight: 600; }
.product-card .price { font-weight: 700; color: var(--brand); }
.product-card .row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }

/* عدّاد الكمية */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--control-border); border-radius: var(--radius-md);
  overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--surface); color: var(--brand); font: inherit;
  font-size: 20px; font-weight: 700; cursor: pointer; }
.qty button[disabled] { color: var(--control-border); cursor: not-allowed; }
.qty output { min-width: 56px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* الإعلان */
.banner { display: block; aspect-ratio: 16 / 5; width: 100%; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--brand); color: var(--on-brand); }
.banner-inner { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: var(--space-2);
  padding: var(--space-6); }
.banner.bg-surface { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.banner.bg-cream { background: var(--banner-cream); color: var(--ink); }
.banner.bg-navy { background: var(--banner-navy); }
.banner.bg-teal { background: var(--banner-teal); }
.banner.bg-charcoal { background: var(--banner-charcoal); }

/* النافذة المنبثقة: X فقط، أصغر من الشاشة، بلا تمرير */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center;
  padding: var(--space-6) var(--space-4); }
.popup { position: relative; width: min(480px, 100%); max-height: calc(100% - 48px); overflow: hidden;
  border-radius: var(--radius-lg); background: var(--surface); padding: var(--space-6); box-shadow: var(--shadow-overlay);
  display: grid; gap: var(--space-3); }
.popup .close { position: absolute; top: var(--space-2); left: var(--space-2); width: 40px; height: 40px; border: 0;
  background: transparent; color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; border-radius: var(--radius-sm); }
.popup .close:focus-visible { outline: 3px solid var(--brand); }

/* الجداول (لوحات الإدارة والمتجر) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; font-size: 13px; font-weight: 600; color: var(--ink-muted); background: var(--surface-soft);
  padding: 10px var(--space-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px var(--space-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .serial { color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* اللوحات: الشريط الجانبي بلون الدور */
.nav { display: grid; gap: 2px; }
.nav a { display: block; padding: 10px var(--space-3); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none;
  font-weight: 500; }
.nav a:hover { background: var(--surface); }
.nav a[aria-current="page"] { background: var(--role-tint); color: var(--role); font-weight: 700; }

/* العدّاد التنازلي لمهلة رد المتجر */
.timer { display: inline-flex; align-items: baseline; gap: var(--space-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.is-urgent { color: var(--danger); }
