/* =========================================================
   VALUE — ثيم تقني داكن (نيون بنفسجي + فضي معدني)
   ملاحظة: كل أسماء الكلاسات مرتبطة بـ app.js و admin.js، لا تُغيّرها.
   ========================================================= */

:root {
  --bg: #05040b;
  --bg-2: #0b0918;
  --surface: rgba(16, 13, 32, 0.62);
  --violet: #9b5cff;
  --violet-2: #c084fc;
  --violet-deep: #6d28d9;
  --cyan: #5ee7ff;
  --silver: #d7dbe6;
  --silver-2: #f5f6fa;
  --muted: #8b8fa6;
  --ok: #34d399;
  --bad: #f87171;
  --glass: rgba(255, 255, 255, 0.045);
  --line: rgba(155, 92, 255, 0.18);
  --line-strong: rgba(155, 92, 255, 0.45);
  --glow: 0 0 0 1px rgba(155, 92, 255, 0.25), 0 12px 40px -8px rgba(155, 92, 255, 0.35);
  --radius: 16px;
  --font-ui: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--silver);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(155, 92, 255, 0.45); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
pre { white-space: pre-wrap; margin: 0; font-family: inherit; }
h1, h2, h3 { color: var(--silver-2); margin: 0 0 10px; line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 10px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.error { color: var(--bad); min-height: 1.4em; font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; }
.success { color: var(--ok); font-weight: 600; }
.ok { color: var(--ok); }
.no { color: var(--bad); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* ---------- الخلفية: شبكة تقنية + توهّجات متحركة ---------- */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(1200px 700px at 50% -20%, rgba(155, 92, 255, 0.12), transparent 70%), var(--bg);
}
.bg-glow::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(155, 92, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 92, 255, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
.bg-glow::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  top: -25vmax; inset-inline-end: -20vmax;
  background: radial-gradient(circle, rgba(155, 92, 255, 0.22), transparent 60%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-6vw, 8vh, 0) scale(1.08); }
}

.container { max-width: 1200px; margin: 0 auto; padding: 28px 18px 140px; }
.page-title {
  margin-bottom: 22px; display: flex; align-items: center; gap: 12px;
}
.page-title::before {
  content: ""; width: 4px; height: 26px; border-radius: 4px;
  background: linear-gradient(180deg, var(--violet-2), var(--violet-deep));
  box-shadow: 0 0 14px rgba(155, 92, 255, 0.7);
}

/* ---------- البطاقات الزجاجية ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.panel { padding: 24px; margin-bottom: 18px; }

/* ---------- الشريط العلوي ---------- */
.topbar {
  position: sticky; top: 12px; z-index: 10;
  width: calc(100% - 24px); max-width: 1200px; margin: 12px auto 0;
  display: flex; align-items: center; gap: 16px; padding: 10px 18px; flex-wrap: wrap;
  background: rgba(10, 8, 22, 0.7);
}
.topbar::after {
  content: ""; position: absolute; inset-inline: 18px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet), var(--cyan), transparent);
  opacity: 0.55;
}
.brand { display: inline-flex; align-items: center; transition: filter 0.2s; }
.brand:hover { filter: drop-shadow(0 0 10px rgba(155, 92, 255, 0.6)); }
.logo { height: 44px; width: auto; border-radius: 50%; }
.logo.small { height: 56px; margin: 0 auto 10px; }
.nav { display: flex; gap: 6px; margin-inline-start: auto; flex-wrap: wrap; align-items: center; }
.nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 10px; position: relative;
  font-weight: 500; transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: #fff; background: rgba(155, 92, 255, 0.08); }
.nav a.on { color: #fff; background: rgba(155, 92, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(155, 92, 255, 0.35); }
.nav a.on::after {
  content: ""; position: absolute; inset-inline: 30%; bottom: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--violet-2), transparent);
  box-shadow: 0 0 10px var(--violet-2);
}
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 6px; background: var(--violet); color: #fff; font-family: var(--font-mono);
  font-size: 12px; margin-inline-start: 6px; box-shadow: 0 0 12px rgba(155, 92, 255, 0.6);
}

/* ---------- الأزرار ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 22px;
  background: linear-gradient(135deg, #a878ff 0%, var(--violet) 40%, var(--violet-deep) 100%);
  color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 28px -8px rgba(155, 92, 255, 0.7);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.6s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 16px 36px -8px rgba(155, 92, 255, 0.9); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled::after { display: none; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line-strong); color: var(--silver-2);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(155, 92, 255, 0.12); box-shadow: 0 0 20px -4px rgba(155, 92, 255, 0.6); }
.btn.danger {
  background: rgba(248, 113, 113, 0.08); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.4); box-shadow: none;
}
.btn.danger:hover { background: rgba(248, 113, 113, 0.18); box-shadow: 0 0 18px -4px rgba(248, 113, 113, 0.6); }
.btn.wa {
  background: linear-gradient(135deg, #34e27a, #128c4a); box-shadow: 0 10px 28px -8px rgba(37, 211, 102, 0.6);
}
.btn.sm { padding: 7px 14px; font-size: 14px; border-radius: 10px; }
.btn.full { width: 100%; }

.input {
  width: 100%; background: rgba(3, 2, 10, 0.7); border: 1px solid rgba(155, 92, 255, 0.2); color: #fff;
  border-radius: 12px; padding: 11px 14px; font: inherit;
  font-size: 16px; /* iOS يكبّر الصفحة إذا كان حجم الحقل أصغر من 16px */
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder { color: #5d6078; }
.input:hover { border-color: rgba(155, 92, 255, 0.4); }
.input:focus { outline: none; border-color: var(--violet); background: rgba(8, 6, 20, 0.9); box-shadow: 0 0 0 3px rgba(155, 92, 255, 0.22), 0 0 24px -6px rgba(155, 92, 255, 0.6); }
textarea.input { resize: vertical; }
label { display: grid; gap: 7px; font-size: 14px; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.form { display: grid; gap: 4px; }
.form .check { display: flex; align-items: center; gap: 8px; color: var(--silver); }

/* ---------- الهيرو ---------- */
.hero {
  position: relative; overflow: hidden; padding: 0; margin-bottom: 26px; text-align: center;
  border-color: rgba(155, 92, 255, 0.3);
  box-shadow: var(--glow), 0 30px 80px -30px rgba(155, 92, 255, 0.5);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, transparent 55%, rgba(5, 4, 11, 0.85)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
}
.hero img.banner { width: 100%; height: auto; display: block; }
.hero-actions {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 24px;
}
.kicker {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px;
  color: var(--cyan); letter-spacing: 0.04em; margin-bottom: 14px;
}
.kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan); animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- خطوات الطلب ---------- */
.steps {
  display: flex; flex-wrap: nowrap; align-items: stretch; gap: 10px; margin: 0 0 28px; padding: 0; list-style: none;
}
.step {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; position: relative; overflow: hidden; transition: border-color 0.2s, transform 0.2s;
}
.step:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.step-no { font-family: var(--font-mono); font-size: 12px; color: var(--violet-2); flex: none; }
.step h3 { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step p { display: none; }
.step::after {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet), transparent); opacity: 0.7;
}

/* ---------- الشبكات وبطاقات المنتجات ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.block { margin-bottom: 44px; }
.block h2 { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.block h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 3px; background: var(--violet-2);
  box-shadow: 0 0 10px var(--violet-2);
}
.product {
  padding: 12px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.product:hover {
  transform: translateY(-4px); border-color: var(--line-strong);
  box-shadow: 0 22px 50px -18px rgba(155, 92, 255, 0.55);
}
.product .body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 6px 4px 2px; }
.product .body small { color: var(--cyan); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.03em; }
.product .body h3 a { transition: color 0.2s; }
.product .body h3 a:hover { color: var(--violet-2); }
.thumb {
  position: relative; display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3;
  background: #0a0816; border: 1px solid rgba(155, 92, 255, 0.12);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product:hover .thumb img { transform: scale(1.06); }
.thumb.big { aspect-ratio: 1 / 1; }
.thumb.sm { width: 64px; aspect-ratio: 1 / 1; flex: 0 0 64px; }
.ph {
  width: 100%; height: 100%; display: grid; place-items: center; position: relative;
  background:
    linear-gradient(rgba(155, 92, 255, 0.08) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(155, 92, 255, 0.08) 1px, transparent 1px) 0 0 / 22px 22px,
    radial-gradient(circle at 30% 20%, rgba(155, 92, 255, 0.45), transparent 60%),
    linear-gradient(135deg, #15102a, #05040b);
  font-size: 56px; font-weight: 700; color: rgba(255, 255, 255, 0.2); font-family: var(--font-mono);
}
.tags { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 6px;
  background: rgba(5, 4, 11, 0.7); color: #fff; border: 1px solid var(--line); backdrop-filter: blur(6px);
}
.tag.new { border-color: rgba(52, 211, 153, 0.6); color: #a7f3d0; }
.tag.best { border-color: rgba(192, 132, 252, 0.7); color: var(--violet-2); }
.tag.sale { border-color: rgba(248, 113, 113, 0.6); color: #fecaca; }
/* الأسعار والأرقام تُعرض من اليسار إلى اليمين حتى لا ينقلب ترتيب "JOD" داخل النص العربي */
.price, .line, .sum-row b, .stat b, .kv b { direction: ltr; unicode-bidi: isolate; }
.price { font-size: 18px; color: #fff; font-family: var(--font-mono); }
.price s { color: var(--muted); font-size: 13px; margin-inline-end: 8px; }
.price b { font-weight: 700; color: #fff; text-shadow: 0 0 18px rgba(155, 92, 255, 0.5); }
.avail { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.avail::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.avail.ok { color: var(--ok); }
.avail.no { color: var(--bad); }
.product .actions { margin-top: auto; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- شريط الأدوات والفلاتر ---------- */
.toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 24px; }
.toolbar .input { max-width: 320px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted);
  font-size: 14px; transition: all 0.2s; background: rgba(255, 255, 255, 0.02);
}
.chip:hover { color: #fff; border-color: var(--line-strong); }
.chip.on {
  background: linear-gradient(135deg, rgba(155, 92, 255, 0.3), rgba(109, 40, 217, 0.2));
  border-color: var(--violet); color: #fff; box-shadow: 0 0 18px -4px rgba(155, 92, 255, 0.7);
}

/* ---------- صفحة المنتج ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.detail .panel h1 { margin-bottom: 10px; font-size: 32px; }
.detail .desc { margin: 16px 0; color: var(--silver); line-height: 1.9; }
.detail .price { font-size: 28px; margin-top: 10px; }
.detail .thumb.big { border-radius: var(--radius); }

/* ---------- السلة والدفع ---------- */
.cart-wrap, .checkout { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.cart-list { display: grid; gap: 14px; }
.row-item { display: flex; align-items: center; gap: 14px; padding: 14px; flex-wrap: wrap; transition: border-color 0.2s; }
.row-item:hover { border-color: var(--line-strong); }
.row-item .info { flex: 1; min-width: 160px; }
.row-item .info h3 { margin-bottom: 2px; }
.qty {
  display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(3, 2, 10, 0.5);
}
.qty .btn.sm { padding: 4px 11px; border-radius: 8px; }
.qty span { min-width: 28px; text-align: center; font-family: var(--font-mono); font-weight: 500; color: #fff; }
.line { min-width: 100px; text-align: end; font-family: var(--font-mono); font-weight: 500; color: #fff; }
.summary { position: sticky; top: 110px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(155, 92, 255, 0.2); }
.sum-row:last-of-type { border-bottom: 0; }
.sum-row.small { font-size: 14px; color: var(--muted); }
.sum-row b { color: #fff; font-family: var(--font-mono); }
.summary .btn { margin-top: 16px; }
.checkout .form { display: grid; }
.method {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1px solid var(--violet); border-radius: 12px; background: rgba(155, 92, 255, 0.1);
  color: #fff; margin-bottom: 14px; box-shadow: 0 0 22px -8px rgba(155, 92, 255, 0.7);
}
.method input { accent-color: var(--violet); width: 18px; height: 18px; }
.cliq {
  position: relative; border: 1px solid rgba(94, 231, 255, 0.28); border-radius: 14px; padding: 18px; margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(94, 231, 255, 0.05), rgba(155, 92, 255, 0.05)), rgba(3, 2, 10, 0.6);
}
.cliq::before {
  content: "CLIQ // TRANSFER"; position: absolute; top: -10px; inset-inline-start: 14px; padding: 0 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--cyan); background: var(--bg-2); letter-spacing: 0.08em;
}
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; flex-wrap: wrap; }
.kv span { color: var(--muted); }
.kv b { color: #fff; }
.cliq-text { color: var(--silver); margin: 10px 0 6px; font-size: 15px; }
.cliq .big {
  font-size: 22px; color: var(--cyan); text-align: center; margin: 10px 0; padding: 12px;
  background: rgba(94, 231, 255, 0.06); border: 1px dashed rgba(94, 231, 255, 0.35); border-radius: 12px;
  text-shadow: 0 0 16px rgba(94, 231, 255, 0.4);
}
.wa-btn { margin-top: 12px; }
.delivery-note { color: var(--muted); }

/* ---------- حالة الطلب ---------- */
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 22px; margin-bottom: 18px; }
.order-head h1 { font-size: 22px; margin: 0; }
.status-pill {
  padding: 7px 16px; border-radius: 99px; font-weight: 600; font-size: 14px;
  background: rgba(94, 231, 255, 0.1); border: 1px solid rgba(94, 231, 255, 0.5); color: var(--cyan);
  box-shadow: 0 0 18px -4px rgba(94, 231, 255, 0.5);
}
.timeline {
  list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 22px;
}
.timeline li {
  position: relative; padding: 30px 8px 12px; text-align: center; font-size: 14px; border-radius: 12px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, 0.02);
}
.timeline li::before {
  content: ""; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%; background: #2a2640; border: 2px solid #3a3556;
}
.timeline li.done { color: #fff; border-color: rgba(155, 92, 255, 0.5); }
.timeline li.done::before { background: var(--violet-2); border-color: var(--violet-2); box-shadow: 0 0 10px var(--violet-2); }
.timeline li.current {
  background: linear-gradient(135deg, rgba(155, 92, 255, 0.35), rgba(109, 40, 217, 0.2));
  border-color: var(--violet); color: #fff; font-weight: 600; box-shadow: 0 0 24px -6px rgba(155, 92, 255, 0.7);
}
.order-link {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 6px;
  border-bottom: 1px solid var(--line); transition: color 0.2s, padding 0.2s;
}
.order-link::after { content: "→"; color: var(--violet-2); }
.order-link:hover { color: var(--violet-2); padding-inline-start: 12px; }
.delivery {
  background: rgba(3, 2, 10, 0.6); padding: 16px; border-radius: 12px; border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 14px;
}
.auth-panel { max-width: 480px; margin-inline: auto; }
.auth-panel .tabs { margin-bottom: 18px; }

/* ---------- التنبيهات والواتساب والتذييل ---------- */
.toast {
  position: fixed; bottom: 96px; left: 50%; right: auto; transform: translate(-50%, 20px);
  width: max-content; max-width: min(380px, calc(100% - 32px)); text-align: center; line-height: 1.5;
  background: rgba(14, 11, 30, 0.92); backdrop-filter: blur(10px);
  border: 1px solid var(--violet); color: #fff; padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 0 30px -6px rgba(155, 92, 255, 0.7);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.wa-float {
  position: fixed; bottom: 22px; right: 22px; left: auto; z-index: 40;
  background: linear-gradient(135deg, #34e27a, #128c4a); color: #fff; font-weight: 700;
  width: 58px; height: 58px; padding: 0; border-radius: 50%; box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45);
  display: flex; align-items: center; justify-content: center; transition: transform 0.2s;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float .wa-icon { width: 30px; height: 30px; }
.wa-float .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.footer {
  margin: 0 18px 40px; padding: 28px; text-align: center; color: var(--muted); font-size: 14px;
  background: rgba(10, 8, 22, 0.6);
}
.footer p { margin: 0; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; direction: ltr; }

/* ---------- تسجيل الدخول (الإدارة) ---------- */
.login { max-width: 420px; margin: 12vh auto 0; padding: 34px; text-align: center; }
.login .logo { margin: 0 auto 14px; height: 72px; box-shadow: 0 0 40px -8px rgba(155, 92, 255, 0.8); }
.tabs {
  display: inline-flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-radius: 12px;
  background: rgba(3, 2, 10, 0.5); border: 1px solid var(--line);
}
.tab {
  background: transparent; border: 1px solid transparent; color: var(--muted); padding: 8px 16px;
  border-radius: 9px; font: inherit; cursor: pointer; transition: all 0.2s;
}
.tab:hover { color: #fff; }
.tab.on {
  color: #fff; background: linear-gradient(135deg, rgba(155, 92, 255, 0.35), rgba(109, 40, 217, 0.25));
  border-color: var(--line-strong); box-shadow: 0 0 16px -4px rgba(155, 92, 255, 0.7);
}

/* ---------- لوحة التحكم ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 20px; display: grid; gap: 6px; position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet-2), transparent);
}
.stat span { color: var(--muted); font-size: 14px; }
.stat b { font-size: 26px; color: #fff; font-family: var(--font-mono); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 10px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th {
  color: var(--cyan); font-weight: 500; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.04em; background: rgba(155, 92, 255, 0.05);
}
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: rgba(155, 92, 255, 0.1); }
.row-actions { display: flex; gap: 6px; }
.toolbar-admin { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-admin select.input { max-width: 260px; }
.img-preview { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #0a0816; }
.admin-body .container { max-width: 1280px; }

/* ---------- الشاشات المتوسطة ---------- */
@media (max-width: 960px) {
  .steps { flex-wrap: wrap; }
  .step { flex: 1 1 100%; }
}
@media (max-width: 860px) {
  .detail, .cart-wrap, .checkout, .grid-2 { grid-template-columns: 1fr; }
  .summary { position: static; }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .nav { gap: 4px; }
  .logo { height: 38px; }
  .wa-float span { display: none; }
  .wa-float { padding: 14px; }
}

/* ---------- الهواتف ---------- */
@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .container { padding: 16px 12px 130px; }
  .topbar { width: calc(100% - 16px); top: 8px; margin-top: 8px; padding: 10px 12px; gap: 10px; }
  .topbar > .btn { margin-inline-start: auto; }
  .topbar .nav {
    order: 3; width: 100%; margin-inline-start: 0; justify-content: space-between; gap: 2px;
    border-top: 1px solid var(--line); padding-top: 8px;
  }
  .nav a { font-size: 14px; white-space: nowrap; padding: 6px 8px; }
  .nav a.on::after { display: none; }
  .toolbar .input { max-width: none; }
  .panel { padding: 16px; }
  .order-head { padding: 16px; }
  .row-item { padding: 12px; }
  .line { min-width: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product { padding: 8px; }
  .product .body h3 { font-size: 15px; }
  .price { font-size: 15px; }
  .actions .btn { flex: 1 1 auto; }
  .hero-actions { position: static; background: rgba(5, 4, 11, 0.9); }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero::before { display: none; }
  .block { margin-bottom: 30px; }
  .toast { bottom: 88px; max-width: calc(100% - 24px); white-space: normal; text-align: center; }
  .wa-float { width: 52px; height: 52px; right: 14px; bottom: 14px; }
  .footer { margin: 0 12px 30px; padding: 20px; }
  .login { margin-top: 6vh; }
}

/* ---------- مساعد المتجر (bot.js) ---------- */
/* Sits directly above the WhatsApp button (bottom 22px + 58px + 14px gap), in the brand's violet glass style. */
.bot-float {
  position: fixed; bottom: 94px; right: 22px; z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 5px 18px 5px 5px;
  border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, rgba(155, 92, 255, 0.95), rgba(109, 40, 217, 0.95));
  color: #fff; font: inherit; font-weight: 600; font-size: 14px; box-shadow: var(--glow);
  transition: transform 0.2s;
}
.bot-float:hover { transform: translateY(-2px); }
.bot-float .bot-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto;
  background: #05040b; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.bot-float .bot-avatar img { width: 32px; height: 32px; object-fit: contain; }
.bot-float .bot-avatar { position: relative; }
.bot-ai-badge {
  position: absolute; bottom: -4px; left: -4px; padding: 1px 5px; border-radius: 999px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.4;
  background: #05040b; color: #d8b4fe; border: 1px solid rgba(216, 180, 254, 0.5);
}
.bot-ai-note { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--muted); }

.bot-panel {
  position: fixed; bottom: 164px; right: 22px; z-index: 41;
  width: min(360px, calc(100vw - 44px)); height: min(520px, 70vh);
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.bot-panel[hidden] { display: none; }
.bot-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bot-close { background: none; border: 0; color: var(--silver); font-size: 24px; line-height: 1; cursor: pointer; }
.bot-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bot-msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); font-size: 14px; line-height: 1.6; }
.bot-msg.user { align-self: flex-end; background: rgba(155, 92, 255, 0.2); }
.bot-msg.bot { align-self: flex-start; }
.bot-msg p { margin: 0 0 6px; }
.bot-msg ul { margin: 4px 0 0; padding-inline-start: 18px; }
.bot-link { color: var(--cyan); word-break: break-word; }
.bot-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); }
.bot-chip {
  background: transparent; border: 1px solid var(--line-strong); color: var(--silver);
  border-radius: 999px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.bot-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bot-picks .bot-chip { font-size: 13px; }
.bot-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.bot-form input {
  flex: 1; min-width: 0; padding: 10px; font: inherit; color: var(--silver-2);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 10px;
}
@media (max-width: 560px) {
  .bot-float { bottom: 80px; right: 14px; width: 52px; height: 52px; padding: 4px; justify-content: center; }
  .bot-float .bot-avatar { width: 44px; height: 44px; }
  .bot-float .bot-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body { padding-bottom: 130px; }
  .bot-panel { bottom: 142px; right: 12px; width: calc(100vw - 24px); }
}

/* ---------- احترام تفضيل تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* تقييمات الزبائن */
.reviews { margin-top: 16px; }
.review { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.review p { margin: 6px 0 0; }
.review-form { display: grid; gap: 10px; margin-top: 12px; }
.stars {
  color: #ffd400;
  letter-spacing: 3px;
  font-size: 1.2em;
  text-shadow: 0 0 4px #fff3a0, 0 0 10px #ffd400, 0 0 22px #ffc300, 0 0 36px rgba(255, 195, 0, 0.8);
}
.review-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.review-card p { margin: 8px 0; }

.plan-ask { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.plan-ask h3 { margin: 0; font-size: 1rem; }

.about { margin: 0 18px 24px; padding: 24px 28px; text-align: right; }
.about h2 { margin: 0 0 10px; font-size: 1.1rem; }
.about p { margin: 0; line-height: 1.9; color: var(--muted); }

.about-location { margin-top: 12px !important; color: var(--text, inherit) !important; }

/* ---------- الصفحات الثابتة (من نحن، السياسات، وسائل الدفع) ---------- */
.policy { max-width: 860px; margin: 0 auto 40px; padding: 32px; line-height: 2; text-align: right; }
.policy h1 { margin-top: 0; font-size: 1.6rem; }
.policy h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.policy p, .policy li { color: var(--muted); }
.policy ol, .policy ul { padding-right: 22px; }
.policy .back { display: inline-block; margin-bottom: 16px; }
.policy strong { color: var(--text, #f5f3ff); }

/* ---------- الفوتر ---------- */
.site-footer {
  margin: 0 18px 40px; padding: 32px 28px 20px; color: var(--muted); font-size: 14px;
  background: rgba(10, 8, 22, 0.6); text-align: right; line-height: 1.9;
}
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.footer-col h3 { margin: 0 0 10px; font-size: 1rem; color: var(--text, #f5f3ff); }
.footer-col p { margin: 0 0 8px; }
.footer-desc { font-size: 13px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a, .footer-phone a { color: var(--violet-2, #c084fc); text-decoration: none; }
.footer-links a:hover, .footer-phone a:hover { text-decoration: underline; }
.footer-tag { margin: 24px 0 4px; text-align: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; direction: ltr; }
.copyright { margin: 0; text-align: center; font-size: 12px; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .site-footer { margin: 0 12px 30px; padding: 22px 18px 16px; }
  .policy { padding: 22px 18px; margin: 0 12px 30px; }
  .policy h1 { font-size: 1.3rem; }
}
