/* MrRobotDz — black & white theme, mobile first. Shared by the site and the admin panel. */
:root {
  --bg: #ffffff;
  --bg2: #f4f4f5;
  --card: #ffffff;
  --fg: #0a0a0a;
  --muted: #5c5c66;
  --line: #e4e4e7;
  --line2: #d4d4d8;
  --inv: #0a0a0a;
  --inv-fg: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 20px rgba(0, 0, 0, .06);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --header-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --bg2: #151517; --card: #111113; --fg: #f4f4f5; --muted: #a1a1aa;
    --line: #27272a; --line2: #3f3f46; --inv: #f4f4f5; --inv-fg: #0a0a0a; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --bg2: #151517; --card: #111113; --fg: #f4f4f5; --muted: #a1a1aa;
  --line: #27272a; --line2: #3f3f46; --inv: #f4f4f5; --inv-fg: #0a0a0a; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
html[dir="rtl"] body { font-family: "Noto Sans Arabic", var(--font); }
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.pre { white-space: pre-line; }
.lead { margin: -4px 0 18px; max-width: 640px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.ph { width: 40%; height: 40%; opacity: .25; }
.ic.fill { fill: currentColor; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--fg);
  background: transparent; color: var(--fg); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, transform .05s;
}
.btn:hover { background: var(--bg2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--inv); color: var(--inv-fg); border-color: var(--inv); }
.btn-primary:hover { background: var(--inv); opacity: .88; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { border-color: var(--fg); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; flex: none;
}
.icon-btn:hover { border-color: var(--fg); }
.icon-btn.on { background: var(--inv); color: var(--inv-fg); border-color: var(--inv); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; text-decoration: underline; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--inv); color: var(--inv-fg); font: 700 14px var(--mono);
}
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { padding: 8px 12px; border-radius: 999px; font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--fg); }
.nav a.active { color: var(--inv-fg); background: var(--inv); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang button { border: 0; background: none; padding: 6px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.lang button.active { background: var(--inv); color: var(--inv-fg); }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .header-tools { margin-inline-start: auto; }
  .nav {
    position: absolute; top: var(--header-h); inset-inline: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 16px; }
}
@media (max-width: 480px) {
  .header-row { gap: 6px; }
  .header-tools { gap: 6px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .lang button { padding: 6px 7px; }
  .icon-btn { width: 36px; height: 36px; }
}
@media (max-width: 340px) { .brand-name { display: none; } }

.notice { background: var(--inv); color: var(--inv-fg); text-align: center; padding: 10px 16px; font-weight: 600; }

/* ---------- hero ---------- */
.hero {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--fg) 14%, transparent) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
}
.hero-in { padding: 56px 16px 48px; }
.hero-kicker { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.hero-title { margin: 0; font-size: clamp(36px, 8vw, 68px); line-height: 1.02; letter-spacing: -.035em; font-weight: 800; }
.hero-sub { margin: 14px 0 24px; font-size: clamp(16px, 2.4vw, 20px); color: var(--muted); max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- headings / sections ---------- */
.h1 { font-size: clamp(26px, 5vw, 36px); margin: 0; letter-spacing: -.02em; }
.h2 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.h3 { font-size: 15px; margin: 18px 0 6px; }
.page { padding-bottom: 40px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 28px 0 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 14px; }
#page-home .container > .h2:first-child { margin: 32px 0 14px; }
.link-more { font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.loading { padding: 24px 0; }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat {
  display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); font-weight: 600; min-height: 60px;
  transition: border-color .15s, transform .15s;
}
.cat:hover { border-color: var(--fg); transform: translateY(-1px); }
.cat-ic { font-size: 22px; filter: grayscale(1); }
.cat-name { line-height: 1.25; font-size: 14px; }

/* ---------- chips & toolbar ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--fg); }
.chip.active { background: var(--inv); color: var(--inv-fg); border-color: var(--inv); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 18px; }
.search { flex: 1 1 240px; position: relative; display: flex; align-items: center; }
.search-ic { position: absolute; inset-inline-start: 14px; display: grid; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding-inline-start: 40px !important; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"],
input:not([type]), select, textarea {
  min-height: 44px; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 12px;
  background: var(--card); outline: none; width: 100%;
}
select { width: auto; cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--fg); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { width: 18px; height: 18px; accent-color: var(--fg); }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.item { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s, transform .15s; }
.item:hover { border-color: var(--fg); transform: translateY(-2px); }
.thumb { aspect-ratio: 1; background: var(--bg2); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item.is-out .thumb img { filter: grayscale(1); opacity: .55; }
.item-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.item-name { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-foot { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.price { font-weight: 800; letter-spacing: -.01em; }
.price.big { font-size: 24px; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; border: 1px solid var(--fg); }
.badge.ok { background: var(--inv); color: var(--inv-fg); border-color: var(--inv); }
.badge.low { background: transparent; }
.badge.out { border-color: var(--line2); color: var(--muted); text-decoration: line-through; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; font-family: var(--mono); }

/* ---------- services ---------- */
.svc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .svc-grid { grid-template-columns: repeat(3, 1fr); } }
.svc { display: flex; gap: 14px; padding: 16px; }
.svc-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--bg2); font-size: 22px; filter: grayscale(1); }
.svc-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.svc h3 { margin: 0; font-size: 16px; }
.svc p { margin: 0; }
.svc-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.svc-meta .ic { vertical-align: -3px; }
.svc .btn-row { margin-top: 6px; }

/* ---------- games ---------- */
.games { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.game { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.game:last-child { border-bottom: 0; }
.game.is-out .game-title { color: var(--muted); }
.game-main { flex: 1; min-width: 0; }
.game-title { font-weight: 600; }
.game-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.game-side { display: flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 520px) {
  .game { flex-wrap: wrap; }
  .game-side { width: 100%; justify-content: flex-end; }
}

/* ---------- contact ---------- */
.contact { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1.2fr; } }
.contact-compact { margin-top: 36px; }
.contact-card { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.info-row { display: flex; gap: 12px; align-items: flex-start; }
.info-row > .ic { margin-top: 3px; }
.info-row b { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.info-row a { text-decoration: underline; text-underline-offset: 3px; }
.map-card { overflow: hidden; display: flex; flex-direction: column; }
.map-card iframe { width: 100%; flex: 1; min-height: 320px; border: 0; filter: grayscale(1); }
:root[data-theme="dark"] .map-card iframe { filter: grayscale(1) invert(.92) contrast(.9); }
.map-card .btn { border-radius: 0; border-width: 1px 0 0; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 24px; padding: 32px 0 16px; background: var(--bg2); }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer .brand { margin-bottom: 8px; }
.f-title { font-weight: 700; margin: 0 0 4px; }
.f-list { display: flex; flex-direction: column; gap: 10px; }
.f-list a { display: flex; gap: 10px; align-items: flex-start; }
.f-list .ic { margin-top: 3px; }
.footer-bottom { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }

/* ---------- mobile quick bar ---------- */
.quickbar { display: none; }
@media (max-width: 760px) {
  .quickbar {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: var(--bg); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .quickbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; font-size: 11px; font-weight: 600; border-radius: 10px; }
  .quickbar a:first-child { background: var(--inv); color: var(--inv-fg); }
  .quickbar .ic { width: 20px; height: 20px; }
  body:has(.quickbar) .footer { padding-bottom: 84px; }
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.modal-panel {
  position: relative; width: 100%; max-width: 960px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 20px;
}
.modal-x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; }
@media (max-width: 640px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal-panel { max-height: 94vh; border-radius: 18px 18px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
}
.detail { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .detail { grid-template-columns: 1fr 1fr; } }
.gallery-main { aspect-ratio: 1; background: var(--bg2); border-radius: 14px; overflow: hidden; display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery-thumbs button { width: 64px; height: 64px; flex: none; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bg2); }
.gallery-thumbs button.active { border-color: var(--fg); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { margin: 0 40px 4px 0; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
html[dir="rtl"] .detail-title { margin: 0 0 4px 40px; }
.detail-price { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.specs { background: var(--bg2); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0; }
.order-note { border: 1px dashed var(--line2); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 16px 0 12px; }
.ref-row { display: flex; gap: 14px; align-items: center; margin-top: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--inv); color: var(--inv-fg); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 99;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   ADMIN PANEL
   ===================================================================== */
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.adm-login form { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.adm-login h1 { margin: 6px 0 0; font-size: 22px; }
.error { color: var(--fg); font-weight: 600; border-inline-start: 3px solid var(--fg); padding-inline-start: 8px; margin: 0; }
.error:empty { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { font-weight: 400; font-size: 15px; }
.field.wide { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--fg); }

.adm-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-main { padding: 18px 16px 60px; }
.adm-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.adm-bar .search { flex: 1 1 220px; }
.adm-bar select { min-width: 140px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; }
.stat b { display: block; font-size: 28px; letter-spacing: -.02em; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px;
}
.row.no-thumb { grid-template-columns: 1fr auto; }
.row .r-thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--bg2); overflow: hidden; display: grid; place-items: center; font-size: 22px; }
.row .r-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .r-main { min-width: 0; }
.row .r-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.row.is-hidden { opacity: .55; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 999px; }
.stepper button { width: 34px; height: 34px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 999px; }
.stepper button:hover { background: var(--bg2); }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .row { grid-template-columns: 48px 1fr; }
  .row .r-thumb { width: 48px; height: 48px; }
  .row .r-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .row.no-thumb { grid-template-columns: 1fr; }
}
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; position: sticky; bottom: -20px; background: var(--bg); padding: 12px 0 4px; }
.img-editor { display: flex; flex-wrap: wrap; gap: 10px; }
.img-slot { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); }
.img-slot img { width: 100%; height: 100%; object-fit: cover; }
.img-slot .img-tools { position: absolute; inset: auto 4px 4px; display: flex; gap: 4px; justify-content: space-between; }
.img-slot .img-tools button { width: 28px; height: 28px; border-radius: 999px; border: 0; background: var(--inv); color: var(--inv-fg); display: grid; place-items: center; cursor: pointer; }
.img-slot .main-tag { position: absolute; top: 4px; inset-inline-start: 4px; background: var(--inv); color: var(--inv-fg); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.img-add { width: 96px; height: 96px; border-radius: 12px; border: 1.5px dashed var(--line2); display: grid; place-items: center; cursor: pointer; color: var(--muted); text-align: center; font-size: 12px; }
.img-add input { display: none; }
.adm-section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 26px 0 12px; }
.adm-section-title:first-child { margin-top: 0; }
