/* MobiArabia — one stylesheet for both languages. Logical properties (inline-start/end) keep RTL and LTR in sync. */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --text: #0e1726;
  --text-2: #3b4658;
  --muted: #6b7686;
  --line: #e4e8ee;
  --accent: #0d9488;
  --accent-2: #0e7490;
  --accent-soft: #e6f6f4;
  --ink: #0b1220;
  --good: #15803d;
  --bad: #c2410c;
  --warn-bg: #fff4d6;
  --warn-text: #6b4e00;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .05);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "IBM Plex Sans Arabic", system-ui, sans-serif;
}
.lang-en { --font: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f18; --surface: #111827; --surface-2: #172031; --text: #eef2f7; --text-2: #c3ccd8; --muted: #8b96a6;
    --line: #223047; --accent: #2dd4bf; --accent-2: #22d3ee; --accent-soft: #0f2f2e; --good: #4ade80; --bad: #fb923c;
    --warn-bg: #3a300f; --warn-text: #ffd98a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 12px 30px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f18; --surface: #111827; --surface-2: #172031; --text: #eef2f7; --text-2: #c3ccd8; --muted: #8b96a6;
  --line: #223047; --accent: #2dd4bf; --accent-2: #22d3ee; --accent-soft: #0f2f2e; --good: #4ade80; --bad: #fb923c;
  --warn-bg: #3a300f; --warn-text: #ffd98a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 12px 30px -12px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.65; font-size: 16px; overflow-x: hidden; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir="rtl"] .ic-flip, [dir="rtl"] .more .ic, [dir="rtl"] .btn .ic { transform: scaleX(-1); }

/* ── header ─────────────────────────────────────────── */
.demo-bar { background: var(--warn-bg); color: var(--warn-text); text-align: center; padding: 6px 16px; font-size: .85rem; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; white-space: nowrap; }
.logo-mark { width: 34px; height: 34px; }
.logo:hover { color: inherit; }
.nav { display: flex; gap: 22px; font-weight: 500; color: var(--text-2); }
.search { position: relative; flex: 1; max-width: 420px; margin-inline-start: auto; }
.search input { width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: .95rem; padding-inline: 42px 16px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.search input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.search-ic { position: absolute; inset-inline-start: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 8px); inset-inline: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; z-index: 30; max-height: 420px; overflow-y: auto; }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover, .sr-item.on { background: var(--surface-2); color: inherit; }
.sr-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; flex: none; }
.sr-name { font-weight: 600; line-height: 1.3; }
.sr-meta { font-size: .8rem; color: var(--muted); }
.sr-empty { padding: 14px; color: var(--muted); }
.lang-switch { font-weight: 600; font-size: .9rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.lang-switch:hover { border-color: var(--accent); }

/* ── hero ───────────────────────────────────────────── */
.hero { position: relative; color: #fff; overflow: hidden;
  background: radial-gradient(900px 400px at 85% -10%, rgba(45, 212, 191, .35), transparent 60%),
              radial-gradient(700px 380px at 5% 110%, rgba(14, 116, 144, .45), transparent 60%),
              linear-gradient(160deg, #0b1220 0%, #0d1b2a 55%, #0b2a2b 100%); }
.hero-in { padding: 64px 16px 56px; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 4.4vw, 3rem); line-height: 1.25; margin: 0 auto 14px; max-width: 820px; letter-spacing: -.02em; }
.hero p { color: #b9c6d6; margin: 0 auto 28px; max-width: 640px; font-size: clamp(.98rem, 1.8vw, 1.1rem); }
.search-hero { max-width: 620px; margin: 0 auto; }
.search-hero input { height: 56px; font-size: 1.05rem; background: #fff; color: #0e1726; border-color: transparent; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); }
.search-hero input:focus { background: #fff; }
.search-hero .search-ic { stroke: #6b7686; width: 20px; height: 20px; }
.search-hero .search-results { text-align: start; color: var(--text); }
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 28px; margin-top: 26px; color: #9fb0c3; font-size: .92rem; }
.hero-stats b { color: #fff; font-size: 1.05rem; }

/* ── sections & cards ───────────────────────────────── */
.sec { margin: 44px 0 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.5rem); letter-spacing: -.01em; }
.more { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: .95rem; }
.more .ic { width: 18px; height: 18px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .88rem; margin: 22px 0 10px; }
.crumbs span { opacity: .5; }
.page-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: 4px 0 18px; letter-spacing: -.01em; }
.page-title small { font-size: .9rem; color: var(--muted); font-weight: 500; margin-inline-start: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.grid-item[hidden] { display: none; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; height: 100%; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: inherit; }
.card-img { aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 18px; color: var(--muted);
  background: linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%); }
.card-img img, .card-img svg { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-brand { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card-name { font-weight: 600; line-height: 1.35; flex: 1; }
.card-price { margin-top: 8px; font-weight: 700; color: var(--accent); font-size: .98rem; }
.card-price span { font-weight: 500; color: var(--muted); font-size: .8rem; }
.card-price.muted { color: var(--muted); font-weight: 500; font-size: .88rem; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 210px); gap: 16px; overflow-x: auto;
  padding-bottom: 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.brand-tile { display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.brand-tile:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-count { color: var(--muted); font-size: .85rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 14px; font-size: .9rem; cursor: default; }
.filter { margin-bottom: 18px; }
.filter .chip { cursor: pointer; transition: all .15s; }
.filter .chip:hover { border-color: var(--accent); }
.filter .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; font-weight: 600;
  border-radius: 999px; padding: 10px 20px; border: 0; transition: background .15s, transform .15s; }
.btn:hover { color: #fff; background: var(--accent-2); transform: translateY(-1px); }
.btn .ic { width: 18px; height: 18px; }

/* ── phone page ─────────────────────────────────────── */
.ph-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 36px; align-items: start; margin-top: 6px; }
.ph-gallery { position: sticky; top: 90px; }
.ph-stage { background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%); border: 1px solid var(--line); border-radius: 24px;
  aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 28px; color: var(--muted); box-shadow: var(--shadow-sm); }
.ph-main { width: 100%; height: 100%; object-fit: contain; transition: opacity .2s; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; justify-content: center; }
.thumb { width: 64px; height: 64px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.on, .thumb:hover { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.ph-brand { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.ph-info h1 { margin: 10px 0 2px; font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.2; letter-spacing: -.02em; }
.ph-alt { color: var(--muted); font-size: .95rem; }
.summary { color: var(--text-2); margin: 14px 0 20px; font-size: 1.02rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: grid;
  grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.tile-ic { grid-row: span 2; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tile-ic .ic { width: 22px; height: 22px; }
.tile-l { font-size: .78rem; color: var(--muted); }
.tile-v { font-weight: 700; line-height: 1.3; font-size: .98rem; overflow-wrap: anywhere; }
.best { margin-top: 18px; border-radius: var(--radius); padding: 18px; color: #fff;
  background: linear-gradient(135deg, #0b1220 0%, #0f2a32 100%); display: grid; gap: 12px; box-shadow: var(--shadow); }
.best-label { display: flex; align-items: center; gap: 8px; color: #7ee3d3; font-weight: 600; font-size: .9rem; }
.best-rows { display: grid; gap: 6px; }
.best-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.best-row span { color: #9fb0c3; min-width: 92px; font-size: .9rem; }
.best-row b { font-size: 1.25rem; }
.best-row small { color: #9fb0c3; }
.best .btn { justify-self: start; background: #2dd4bf; color: #06231f; }
.best .btn:hover { background: #5eead4; color: #06231f; }

.tabs { position: sticky; top: 68px; z-index: 10; display: flex; gap: 6px; margin: 30px 0 0; padding: 8px 0; overflow-x: auto;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tabs a { padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem; color: var(--text-2); white-space: nowrap; }
.tabs a:hover { background: var(--surface); color: var(--accent); }

.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 20px; box-shadow: var(--shadow-sm); }
.block.slim { padding: 18px 24px; }
.block h2 { margin: 0 0 16px; font-size: 1.25rem; letter-spacing: -.01em; }
.price-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.price-col h3 { margin: 0 0 10px; font-size: .95rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.price-list { list-style: none; margin: 0; padding: 0; }
.price-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.price-list li:last-child { border-bottom: 0; }
.price-list .store { flex: 1 1 60%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 500; }
.price-list .store a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.price-list .store small { color: var(--muted); font-size: .8rem; }
.price-list .amt { font-weight: 700; white-space: nowrap; }
.price-list .amt small { font-weight: 500; color: var(--muted); }
.price-list li.best-li .amt { color: var(--accent); }
.badge { background: var(--accent); color: #fff; font-size: .72rem; font-weight: 600; border-radius: 6px; padding: 1px 8px; }
.tag { font-style: normal; font-size: .72rem; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; color: var(--muted); }
.tag.sample { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }

.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.pros, .cons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pros li, .cons li { display: flex; gap: 10px; align-items: flex-start; }
.pros .ic, .cons .ic { width: 22px; height: 22px; padding: 3px; border-radius: 50%; margin-top: 2px; stroke-width: 2.4; }
.pros .ic { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.cons .ic { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.note { display: flex; gap: 16px; align-items: flex-start; background: var(--accent-soft); border-color: transparent; }
.note h2 { margin-bottom: 6px; font-size: 1.1rem; }
.note p { margin: 0; color: var(--text-2); }
.note-ic { color: var(--accent); }
.note-ic .ic { width: 30px; height: 30px; }

.spec-groups { display: grid; gap: 0; }
.spec-group { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.spec-group:first-child { border-top: 0; padding-top: 0; }
.spec-group h3 { margin: 0; font-size: .95rem; color: var(--accent); }
.spec-group dl { margin: 0; display: grid; gap: 8px; }
.spec-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 12px; }
.spec-row dt { color: var(--muted); font-size: .92rem; }
.spec-row dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.ph-video { display: block; width: 100%; max-width: 360px; aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 16px; background: #000; }

/* ── pages ──────────────────────────────────────────── */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); margin-top: 6px; }
.prose h1 { margin-top: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.prose h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-2); }
.prose a { color: var(--accent); text-decoration: underline; }
.big-link { font-size: 1.3rem; font-weight: 700; }
.empty-state { text-align: center; padding: 80px 16px; }
.empty-state .big { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }

/* ── ads (reserve space so nothing jumps) ───────────── */
.ad { margin: 24px 0; min-height: 120px; display: flex; justify-content: center; }
.ad-infeed { grid-column: 1 / -1; min-height: 100px; }

/* ── footer ─────────────────────────────────────────── */
.foot { margin-top: 64px; background: var(--ink); color: #b6c2d1; }
.foot-in { display: flex; justify-content: space-between; gap: 32px; padding-top: 40px; padding-bottom: 24px; flex-wrap: wrap; }
.foot .logo { color: #fff; }
.foot-brand { max-width: 520px; }
.foot-brand p { font-size: .9rem; margin: 10px 0 0; color: #93a2b5; }
.foot-links { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 32px; align-content: start; }
.foot-links a { color: #d6dee8; font-size: .92rem; }
.foot-links a:hover { color: #5eead4; }
.foot-note { display: flex; flex-wrap: wrap; gap: 6px 22px; padding-top: 16px; padding-bottom: 28px; border-top: 1px solid #1c2940; font-size: .8rem; color: #7f8ea3; }

/* ── responsive ─────────────────────────────────────── */
@media (max-width: 980px) {
  .ph-hero { grid-template-columns: 1fr; gap: 22px; }
  .ph-gallery { position: static; max-width: 460px; margin: 0 auto; width: 100%; }
  .price-cols { grid-template-columns: 1fr; gap: 6px; }
  .price-col + .price-col { border-top: 1px solid var(--line); padding-top: 14px; }
}
@media (max-width: 760px) {
  .top-in { height: auto; flex-wrap: wrap; gap: 10px 14px; padding-top: 10px; padding-bottom: 10px; }
  .nav { display: none; }
  .logo-text { font-size: 1.05rem; }
  .lang-switch { margin-inline-start: auto; }
  .top .search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .top .search input { height: 40px; }
  .tabs { top: 112px; }
  html { scroll-padding-top: 170px; }
  .hero-in { padding: 40px 16px 36px; }
  .search-hero input { height: 50px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-img { padding: 12px; }
  .card-body { padding: 10px 12px 14px; }
  .card-name { font-size: .92rem; }
  .rail { grid-auto-columns: 46%; }
  .block { padding: 18px; border-radius: 16px; }
  .pc { grid-template-columns: 1fr; gap: 20px; }
  .spec-group { grid-template-columns: 1fr; gap: 8px; }
  .spec-row { grid-template-columns: 42% 1fr; }
  .foot-links { grid-template-columns: repeat(2, 1fr); width: 100%; }
}
@media (max-width: 380px) {
  .tiles { grid-template-columns: 1fr; }
  .tile-v { font-size: .92rem; }
}
/* On a phone the page itself is the scroller; hide the page-level search on the home page (hero has one). */
@media (max-width: 760px) { .has-hero .top .search { display: none; } .has-hero .tabs { top: 60px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
