/* ============================================================
   MOBILEDZ — Global Design System
   Colors, typography, spacing, and reusable components
   ============================================================ */

:root {
  /* Brand palette (from logo) */
  --brand-cyan: #00A8E8;
  --brand-cyan-dark: #0086BA;
  --brand-cyan-light: #E6F7FE;
  --brand-navy: #0A1A2F;
  --brand-navy-soft: #112540;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --line: #E2E8F0;
  --line-2: #EEF2F7;
  --bg: #FFFFFF;
  --bg-alt: #F5F8FB;
  --bg-soft: #F1F6FA;
  --success: #16A34A;
  --success-soft: #E9F8EF;
  --danger: #DC2626;
  --warning: #D97706;

  /* Typography */
  --font-sans: "Inter", "Segoe UI", "Helvetica Neue", "Noto Sans Arabic", system-ui, -apple-system, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;
  --fs-hero: clamp(2.1rem, 5vw, 3.4rem);

  /* Spacing & radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(10, 26, 47, 0.06), 0 1px 3px rgba(10, 26, 47, 0.04);
  --shadow-md: 0 4px 14px rgba(10, 26, 47, 0.08);
  --shadow-lg: 0 14px 40px rgba(10, 26, 47, 0.12);
  --shadow-cyan: 0 10px 30px rgba(0, 168, 232, 0.28);

  /* Layout */
  --container: 1240px;
  --header-h: 56px;
  --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  padding-top: var(--header-h);
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0; }

:focus-visible {
  outline: 3px solid rgba(0, 168, 232, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.section { padding-block: clamp(48px, 7vw, 88px); }
.section--alt { background: var(--bg-alt); }
.section--navy { background: var(--brand-navy); color: #DCE7F3; }
.section--navy h1, .section--navy h2, .section--navy h3 { color: #fff; }

.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.center { text-align: center; }
.mt-auto { margin-top: auto; }
.hide-sm { display: none; }
.show-sm { display: block; }
@media (min-width: 880px) {
  .hide-sm { display: revert; }
  .show-sm { display: none; }
}

/* ---------- Eyebrow / section heading ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-cyan);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px; background: var(--brand-cyan); border-radius: 2px;
}
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  margin-top: 10px;
}
.section-sub {
  color: var(--muted);
  margin-top: 10px;
  max-width: 60ch;
  font-size: var(--fs-md);
}
.section-head { margin-bottom: 36px; }
.section-head.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.section-head.center .section-sub { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: var(--fs-base);
  padding: 12px 22px;
  border-radius: var(--r-md);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--brand-cyan);
  color: #fff;
  box-shadow: var(--shadow-cyan);
}
.btn--primary:hover { background: var(--brand-cyan-dark); }
.btn--navy { background: var(--brand-navy); color: #fff; }
.btn--navy:hover { background: var(--brand-navy-soft); }
.btn--ghost { background: transparent; color: var(--brand-navy); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand-cyan); color: var(--brand-cyan); }
.btn--light { background: #fff; color: var(--brand-navy); }
.btn--light:hover { background: var(--brand-cyan-light); }
.btn--block { width: 100%; }
.btn--lg { padding: 16px 30px; font-size: var(--fs-md); }
.btn--sm { padding: 9px 16px; font-size: var(--fs-sm); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.badge--ok { background: var(--success-soft); color: var(--success); }
.badge--out { background: #FEE2E2; color: var(--danger); }
.badge--new { background: var(--brand-cyan-light); color: var(--brand-cyan-dark); }
.badge--navy { background: rgba(255,255,255,0.12); color: #BFE3F5; }

/* ---------- Product card ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card__media img { transform: scale(1.05); }
.card__fav {
  position: absolute;
  top: 12px; inset-inline-end: 12px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  transition: color var(--transition), transform var(--transition);
  z-index: 2;
}
.card__fav:hover { transform: scale(1.08); }
.card__fav.is-active { color: var(--danger); }
.card__fav svg { width: 20px; height: 20px; fill: currentColor; }
.card__tag {
  position: absolute; top: 12px; inset-inline-start: 12px;
}
.card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.card__cat { font-size: var(--fs-xs); color: var(--brand-cyan); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.card__name { font-size: 1.02rem; font-weight: 700; color: var(--ink); line-height: 1.35; }
.card__brand { font-size: var(--fs-sm); color: var(--muted); }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; }
.card__price { font-size: 1.15rem; font-weight: 800; color: var(--brand-navy); }
.card__price small { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.card__view {
  font-size: var(--fs-sm); font-weight: 700; color: var(--brand-cyan);
  display: inline-flex; align-items: center; gap: 4px;
}
.card__view:hover { gap: 8px; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 20px; }
.grid--products { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .grid--products { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid--products { grid-template-columns: repeat(4, 1fr); } }

.grid--cats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .grid--cats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid--cats { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Category chip (home) ---------- */
.catchip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px 10px;
  border-radius: var(--r-lg);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  text-decoration: none;
}
.catchip:hover {
  transform: translateY(-4px);
  border-color: var(--brand-cyan);
  box-shadow: var(--shadow-md);
}
.catchip__icon {
  width: 100%;
  height: 76px;
  background: transparent !important; /* No background color */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.catchip__icon img {
  width: auto;
  height: 100%;
  max-width: 84px;
  max-height: 76px;
  object-fit: contain;
  display: block;
  filter: none !important; /* No shadow */
  transition: transform 0.25s ease;
}
.catchip:hover .catchip__icon img {
  transform: scale(1.08);
}
.catchip__icon svg {
  width: 50px;
  height: 50px;
  stroke: var(--brand-cyan);
  fill: none;
  stroke-width: 1.8;
  transition: transform 0.25s ease;
}
.catchip:hover .catchip__icon svg {
  transform: scale(1.08);
}
.catchip__name {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--ink);
  line-height: 1.3;
  transition: color 0.2s ease;
}
.catchip:hover .catchip__name {
  color: var(--brand-cyan);
}
.catchip__count {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(0,168,232,0.14);
  outline: none;
}

/* ---------- Filter sidebar ---------- */
.filter-group { border-bottom: 1px solid var(--line); padding-block: 16px; }
.filter-group:first-child { padding-top: 0; }
.filter-group__title { font-weight: 700; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--brand-cyan); cursor: pointer; }
.check .count { margin-inline-start: auto; color: var(--muted-2); font-size: var(--fs-xs); }

.chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600;
  color: var(--ink-2); cursor: pointer; transition: all var(--transition);
}
.chip:hover { border-color: var(--brand-cyan); color: var(--brand-cyan); }
.chip.is-active { background: var(--brand-cyan); color: #fff; border-color: var(--brand-cyan); }

.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; transition: transform var(--transition); }
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--brand-cyan); }

/* ---------- Availability dot ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--success); }
.dot--out { background: var(--danger); }

/* ---------- Skip link (a11y) ---------- */
.skip {
  position: absolute;
  top: -9999px;
  inset-inline-start: 16px;
  z-index: 9999;
  background: var(--brand-navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  transition: top 0.2s ease;
}
.skip:focus {
  top: 16px;
}

/* ---------- RTL ---------- */
[dir="rtl"] .eyebrow::before { order: 2; }
html[dir="rtl"] { text-align: right; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp 0.5s ease both; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Utility Classes ---------- */
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

