@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
:root {
  --bg: #010812;
  --bg2: #020b16;
  --panel: #061321;
  --panel2: #081725;
  --line: #142638;
  --line2: #1c3045;
  --text: #e8ebf0;
  --muted: #8996a5;
  --purple: #741bd5;
  --purple2: #983fff;
  --cyan: #26d9ff;
  --green: #42d36f;
  --yellow: #ffd532;
}

:root {
  --bg: #060a16;
  --bg-alt: hsl(225, 56%, 7%);
  --surface: #0d1428;
  --surface-2: #111a33;
  --border: #1b2440;
  --border-soft: #161f38;
  --purple: #6f03ad;
  --purple-2: #9941fd;
  --purple-deep: #6f029b98;
  --cyan: #06c2db;
  --text: #f3f5fb;
  --text-dim: #a6adc4;
  --text-mute: #6b738f;
  --green: #02fa72;
  --font: "Cairo", "Tajawal", sans-serif;
  --neon-green: #00ff88;
  --neon-glow: rgba(0, 255, 136, 0.25);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(circle at 65% 0, #0b1930 0, #010812 35%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden !important;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}
a {
  text-decoration: none;
  color: inherit;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}
ul {
  list-style: none;
}

.hero__text {
  width: 100%;
  margin: 0 auto;
  padding: 20px 32px;
}

.hero__inner {
  height: 400px;
}

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 30px;
}

.container-fluid {
  width: 100%;
  padding: 0 30px;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
  white-space: nowrap;
}
.btn svg {
  flex-shrink: 0;
}
.btn--primary {
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-deep) 100%
  );
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(124, 92, 255, 0.65);
  display: inline-flex;
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -6px rgba(124, 92, 255, 0.8);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  border-color: var(--purple-2);
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--purple-2);
  background: rgba(124, 92, 255, 0.06);
}
.btn--lg {
  padding: 14px 26px;
  font-size: 15.5px;
}
.btn--block {
  width: 100%;
  margin-top: 18px;
}

/* ===================== HEADER ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 10, 22, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
  padding: 20px 30px;
  direction: ltr !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  width: 200px;
}
.brand__logo {
  width: 48px;
  height: 48px;
  border: 2px solid #8d2bdf;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  display: grid;
  place-items: center;
  color: #f8f7f8;
  font-weight: 800;
  font-size: 17px;
  background: rgb(104, 3, 236);
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  flex: 1;
  justify-content: center;
  direction: rtl !important;
}
.nav__link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.15s ease;
  position: relative;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}
.nav__link:hover {
  color: var(--text);
}
.nav__link--active {
  color: var(--text);
}
.nav__link--active::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: -27px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}
.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 4px;
}
.lang-switch .chev {
  opacity: 0.6;
}
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 6px;
  flex-shrink: 0;
}
.burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s ease;
}
.burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger.is-open span:nth-child(2) {
  opacity: 0;
}
.burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons duplicated inside the mobile hamburger menu.
   Hidden everywhere by default; only revealed on small screens
   when the mobile nav is open (see the 860px media query). */
.nav__mobile-actions {
  display: none;
}
.nav__mobile-btn-wrap {
  display: block;
  width: 100%;
}

/* ---- جميع الصفحات mega menu ---- */
.nav__pages {
  position: relative;
}
.nav__pages-trigger {
  cursor: pointer;
}
.nav__pages-trigger .chev {
  transition: transform 0.2s ease;
}
.nav__pages.is-open .nav__pages-trigger .chev {
  transform: rotate(180deg);
}
.nav__pages.is-open .nav__pages-trigger {
  color: var(--text);
}
.mega {
  position: absolute;
  top: calc(100% + 22px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
  z-index: 60;
}
.nav__pages.is-open .mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mega__col {
  display: flex;
  flex-direction: column;
}
.mega__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-2);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.mega__col a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 7px 0;
  transition: color 0.15s ease;
}
.mega__col a:hover {
  color: var(--cyan);
}
.primary {
  background: linear-gradient(135deg, #6818d0, #8529eb) !important;
  border-color: #8730ee !important;
  color: #fff;
  box-shadow: 0 0 22px #7524dd30;
}
.app-shell {
  display: flex;
}
.sidebar {
  width: 173px;
  min-height: calc(100vh - 69px);
  border-right: 1px solid #132333;
  background: #020b16;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: none;
}
.side-nav {
  padding-top: 21px;
}
.side-nav a {
  height: 55px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 19px;
  color: #c9ced6;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.side-nav a i {
  font-size: 17px;
}
.side-nav a.selected {
  background: linear-gradient(90deg, #5f19b421, transparent);
  color: #a64dff;
  border-left-color: #7b2be7;
}
.upgrade {
  margin: 0 15px 19px;
  padding: 13px 9px;
  border: 1px solid #1a3043;
  border-radius: 6px;
  background: #061321;
}
.upgrade h5 {
  font-size: 10px;
  color: #d4d8df;
  margin: 0 0 13px;
}
.upgrade p {
  font-size: 9px;
  color: #8794a4;
  line-height: 1.55;
}
.upgrade button {
  height: 31px;
  font-size: 9px;
}
.content {
  width: calc(100% - 173px);
  padding: 17px 21px 25px;
  overflow: hidden;
}
.crumb {
  font-size: 9px;
  color: #8a95a2;
  margin: 0 0 14px 11px;
}
.crumb span {
  padding: 0 7px;
  color: #455365;
}

.crumb a {
  text-decoration: none;
  color: var(--muted);
}

.top-grid {
  display: grid;
  grid-template-columns: 1fr 1.18fr;
  gap: 23px;
  align-items: stretch;
}
.intro {
  padding: 8px 5px;
}
.intro h1 {
  font-size: 28px;
  letter-spacing: -0.7px;
  margin: 8px 0 10px;
}
.intro h1 span {
  color: #8b32ec;
}
.intro h1 em {
  font-size: 11px;
  font-style: normal;
  color: #b35aff;
  border: 1px solid #7436ad;
  border-radius: 50%;
  padding: 8px 7px;
  vertical-align: middle;
  margin-left: 6px;
}
.intro p {
  color: #c0c6cf;
  line-height: 1.55;
  font-size: 12px;
  margin-bottom: 15px;
}
.discover-row {
  height: 49px;
  border: 1px solid #1c3045;
  border-radius: 6px;
  background: #071321;
  display: flex;
  padding: 4px;
}
.discover-row input {
  background: transparent;
  border: 0;
  outline: 0;
  color: white;
  padding: 0 13px;
  flex: 1;
  font-size: 11px;
}
.discover-row button {
  width: 107px;
}
.popular {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  white-space: nowrap;
}
.popular b {
  font-size: 10px;
  color: #dce0e6;
}
.popular button {
  border: 1px solid #1a2b3d;
  background: #07121f;
  color: #c5ccd5;
  border-radius: 4px;
  padding: 7px 8px;
  font-size: 9px;
}
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #071522, #04101c);
  border-radius: 7px;
  box-shadow: 0 8px 25px #0004;
}
.summary {
  padding: 15px 16px;
}
.summary h3 {
  font-size: 12px;
  margin: 0 0 12px;
}
.summary-grid {
  display: grid;
  grid-template-columns: 3fr repeat(3, 2fr);
  grid-template-rows: 1fr 1fr;
  min-height: 160px;
}
.ai-orb {
  grid-row: 1/3;
  display: grid;
  place-items: center;
}
.ai-orb div {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 31px;
  font-weight: 700;
  color: #fff;
  border: 1px solid #8741ff;
  background: radial-gradient(circle, #6d29d8 0, #24105b 42%, #071321 70%);
  box-shadow:
    0 0 18px #8c38ff,
    0 0 45px #3e2aff55;
}
.metric {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-left: 1px solid #132536;
  gap: 6px;
}
.metric:nth-child(n + 5) {
  border-top: 1px solid #132536;
}
.metric b {
  font-size: 18px;
  color: #963dff;
}
.metric span {
  font-size: 8px;
  color: #d0d4dc;
  text-align: center;
}
.summary-foot {
  border-top: 1px solid #15283a;
  padding-top: 9px;
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  color: #8997a6;
  font-size: 9px;
}
.summary-foot span:first-child {
  color: #8ca899;
}
.tabs {
  height: 49px;
  margin-top: 21px;
  display: flex;
  align-items: stretch;
  padding: 0 8px;
}
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #e2e4e9;
  padding: 0 21px;
  font-size: 11px;
}
.tab.active {
  color: #ae51ff;
  border-bottom-color: #8c2cff;
  background: #731ed30d;
}
.tab-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 11px;
}
.tab-actions button {
  height: 35px;
  background: #06111e;
  border: 1px solid #1d3246;
  color: #e0e4e9;
  border-radius: 5px;
  padding: 0 14px;
  font-size: 10px;
}
.tab-actions .filter {
  border-color: #8834db;
  color: #c27aff;
}
.matches-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  margin-top: 17px;
}
.criteria {
  padding: 14px 15px;
}
.criteria-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}
.criteria-head a {
  color: #a74dff;
}
.criterion {
  display: flex;
  gap: 10px;
  margin: 11px 0;
}
.criterion i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #a953ff;
  background: #221044;
  border: 1px solid #502082;
  font-style: normal;
}
.criterion span {
  font-size: 9px;
  color: #9ba6b4;
  line-height: 1.3;
}
.criterion small {
  display: block;
  color: #dce0e5;
  font-size: 10px;
  margin-top: 2px;
}
.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3px 0 14px;
}
.result-head h2 {
  font-size: 16px;
  margin: 0;
}
.result-head h2 span {
  color: #b04cff;
}
.result-head p {
  margin: 5px 0 0;
  color: #8794a2;
  font-size: 10px;
}
.result-head > a {
  color: #b55aff;
  font-size: 10px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.match-card {
  background: #071523;
  border: 1px solid #1b3145;
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}
.cover {
  height: 134px;
  position: relative;
  background-size: cover;
  background-position: center;
}
.cover:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, #06111ee8);
}
.cover label {
  position: absolute;
  z-index: 2;
  left: 9px;
  top: 10px;
  background: #16b9ce;
  color: white;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 9px;
}
.heart {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  border: 0;
  background: #06101c99;
  color: white;
  font-size: 24px;
}
.realestate {
  background: linear-gradient(145deg, #193754, #46606c 45%, #172a38);
}
.realestate:before {
  content: "";
  position: absolute;
  inset: 50% 5% 0;
  background: linear-gradient(
    135deg,
    #1c2f40 0 30%,
    #334b59 31% 55%,
    #182b3b 56%
  );
  clip-path: polygon(0 30%, 30% 10%, 62% 28%, 100% 0, 100% 100%, 0 100%);
}
.solar {
  background: linear-gradient(
    155deg,
    #795d40,
    #c6a675 40%,
    #202b2f 41%,
    #111d24
  );
}
.solar:before {
  content: "";
  position: absolute;
  width: 90%;
  height: 65%;
  left: 5%;
  bottom: -5%;
  background: repeating-linear-gradient(0deg, #243e4b 0 8px, #101f2a 9px 10px);
  transform: skewY(8deg);
  box-shadow: 0 0 20px #f4be7c33;
}
.data {
  background: radial-gradient(circle at 50% 30%, #1e6a9b, #0b1e32 60%, #071321);
}
.data:before {
  content: "";
  position: absolute;
  inset: 25% 10%;
  background: repeating-linear-gradient(
    90deg,
    #3fcfff22 0 12px,
    transparent 12px 23px
  );
  box-shadow: 0 0 25px #2ecbff33;
}
.factory {
  background: linear-gradient(145deg, #39444b, #17242d 52%, #101921);
}
.factory:before {
  content: "⚙";
  position: absolute;
  font-size: 92px;
  right: 9%;
  top: 16%;
  color: #9faab0aa;
}
.card-body {
  padding: 9px 14px 13px;
}
.category {
  color: #c15cff;
  font-size: 9px;
}
.card-body h3 {
  font-size: 13px;
  margin: 8px 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-body p {
  color: #a5afbb;
  font-size: 10px;
  line-height: 1.5;
  margin: 4px 0;
}
.card-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  gap: 5px;
}
.card-stats span {
  font-size: 9px;
  color: #a0aab6;
}
.card-stats b {
  display: block;
  color: #fff;
  font-size: 11px;
  margin-top: 3px;
}
.details {
  width: 100%;
  height: 28px;
  margin-top: 10px;
  border: 1px solid #7532b7;
  border-radius: 5px;
  background: #08111d;
  color: #cfa0ff;
  font-size: 9px;
}
.bottom-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.bottom-grid .panel {
  min-height: 157px;
  padding: 14px;
}
.box-title {
  font-size: 12px;
  font-weight: 600;
}
.box-title a {
  float: right;
  color: #ad53ff;
  font-size: 9px;
  font-weight: 400;
}
.signals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 19px;
}
.signals > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.signals i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #102b1b;
  color: #52dc78;
  display: grid;
  place-items: center;
  font-style: normal;
}
.signals span {
  font-size: 9px;
  color: #9ca6b2;
  flex: 1;
}
.signals span b {
  display: block;
  color: #6ce08b;
  font-size: 10px;
  margin-top: 3px;
}
.signals strong {
  color: #39d9ff;
  font-size: 19px;
}
.signals > div:nth-child(2) i {
  background: #261044;
  color: #b74cff;
}
.signals > div:nth-child(2) span b {
  color: #bd70ff;
}
.signals > div:nth-child(3) i {
  background: #302411;
  color: #ffbd32;
}
.signals span b.amber {
  color: #ffbd32;
}
.signals > div:nth-child(4) i {
  background: #0d2b39;
  color: #32d8ff;
}
.insights ul,
.why ul {
  list-style: none;
  padding: 9px 0 0;
  margin: 0;
}
.insights li,
.why li {
  font-size: 9px;
  color: #aab3bf;
  margin: 9px 0;
}
.insights li:before,
.why li:before {
  content: "◉";
  color: #a84cff;
  margin-right: 8px;
}
.why li:before {
  content: "✓";
  color: #b45aff;
}
.why li {
  margin: 11px 0;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #101e2e;
  border: 1px solid #7e39bd;
  padding: 10px 18px;
  border-radius: 6px;
  opacity: 0;
  transition: 0.25s;
  z-index: 20;
  font-size: 11px;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 1200px) {
  .sidebar {
    width: 150px;
  }
  .content {
    width: calc(100% - 150px);
  }
  .top-grid {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .bottom-grid {
    grid-template-columns: 1fr 1fr;
  }
  .why {
    grid-column: 1/-1;
  }
  .topbar nav a {
    padding-left: 10px;
    padding-right: 10px;
  }
  .brand {
    width: 190px;
  }
  .matches-layout {
    grid-template-columns: 230px 1fr;
  }
}
@media (max-width: 800px) {
  .sidebar {
    display: none;
  }
  .content {
    width: 100%;
    padding: 14px;
  }
  .topbar {
    height: auto;
    min-height: 65px;
    flex-wrap: wrap;
  }

  .topbar nav a {
    padding: 14px 12px;
  }
  .header-actions {
    margin-left: auto;
  }
  .top-grid,
  .matches-layout,
  .bottom-grid {
    display: block;
  }
  .criteria {
    margin-bottom: 15px;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .tabs {
    overflow: auto;
  }
  .tab-actions {
    display: none;
  }
  .summary {
    margin-top: 15px;
  }
  .popular {
    overflow: auto;
  }
  .popular button {
    flex: none;
  }
}
@media (max-width: 500px) {
  .brand {
    width: auto;
  }
  .header-actions span,
  .header-actions button:first-of-type {
    display: none;
  }
  .header-actions {
    gap: 5px;
  }
  .header-actions button {
    padding: 0 10px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .bottom-grid .panel {
    margin-top: 12px;
  }
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .ai-orb {
    display: none;
  }
  .metric {
    border-left: 0 !important;
  }
  .metric:nth-child(n + 5) {
    border-top: 1px solid #132536;
  }
  .intro h1 {
    font-size: 24px;
  }
}

/* ================================
   MOBILE NAVBAR ONLY
================================ */

.mobile-menu-btn {
  display: none;
}

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  /* إخفاء عناصر الديسكتوب */
  .topbar > nav,
  .header-actions {
    display: none;
  }

  /* زر الهامبرغر */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    margin-left: auto;

    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;

    background: rgba(12, 18, 34, 0.85);
    color: #dce4f4;

    font-size: 24px;

    cursor: pointer;

    transition: 0.25s ease;
  }

  .mobile-menu-btn:hover {
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(124, 58, 237, 0.12);

    box-shadow: 0 0 18px rgba(124, 58, 237, 0.18);
  }

  /* القائمة */
  .mobile-nav {
    position: absolute;

    top: calc(100% + 8px);
    left: 12px;
    right: 12px;

    display: flex;
    flex-direction: column;

    padding: 9px;

    background: rgba(6, 12, 25, 0.98);

    border: 1px solid rgba(92, 105, 139, 0.22);
    border-radius: 14px;

    box-shadow:
      0 20px 45px rgba(0, 0, 0, 0.45),
      0 0 25px rgba(91, 33, 182, 0.08);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s ease;

    z-index: 1001;
  }

  .mobile-nav.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* روابط القائمة */
  .mobile-nav > a {
    min-height: 45px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 13px;

    border-radius: 9px;

    color: #8995ad;
    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    transition: 0.2s ease;
  }

  .mobile-nav > a i {
    width: 20px;

    text-align: center;

    font-size: 16px;

    color: #74819a;
  }

  .mobile-nav > a:hover {
    color: #fff;
    background: rgba(124, 58, 237, 0.08);
  }

  /* الصفحة الحالية */
  .mobile-nav > a.active {
    color: #fff;

    background: linear-gradient(
      90deg,
      rgba(124, 58, 237, 0.16),
      rgba(34, 211, 238, 0.04)
    );

    border: 1px solid rgba(124, 58, 237, 0.14);
  }

  .mobile-nav > a.active i {
    color: #a78bfa;
  }

  /* الخط الفاصل */
  .mobile-divider {
    height: 1px;

    margin: 8px 4px;

    background: rgba(100, 115, 145, 0.14);
  }

  /* Sign In / Get Started */
  .mobile-auth {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    padding: 3px 2px 2px;
  }

  .mobile-auth a {
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    border-radius: 9px;

    text-decoration: none;

    font-size: 11px;
    font-weight: 600;
  }

  .mobile-signin {
    color: #cbd5e5;

    border: 1px solid rgba(104, 118, 150, 0.25);

    background: rgba(12, 19, 35, 0.65);
  }

  .mobile-get-started {
    color: #fff;

    background: linear-gradient(135deg, #7c3aed, #6d28d9);

    box-shadow: 0 0 15px rgba(124, 58, 237, 0.16);
  }
}

/* شاشات صغيرة جدًا */
@media (max-width: 380px) {
  .mobile-nav {
    left: 8px;
    right: 8px;
  }
}
/* ---- Mobile nav / burger breakpoint (desktop untouched above 860px) ---- */
@media (max-width: 860px) {
  .header__actions {
    display: none;
  }
  .nav {
    display: flex;
    position: absolute;
    top: calc(100% + 10px);
    right: 16px;
    left: 16px;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: linear-gradient(
      160deg,
      rgba(9, 15, 30, 0.98),
      rgba(5, 9, 20, 0.98)
    );
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 14px 16px 18px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.55);

    /* Smooth reveal instead of an abrupt display:none/flex swap,
       and no inner scrollbar under normal use. */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top center;
    transition:
      opacity 0.22s ease,
      transform 0.22s ease,
      visibility 0.22s ease;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 45;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  .nav__link {
    width: 100%;
    padding: 13px 6px;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
  }
  .nav__link--active::after {
    display: none;
  }

  .nav__pages {
    width: 100%;
  }
  .nav__pages-trigger {
    width: 100%;
  }
  .mega {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 4px;
    box-shadow: none;
    border-color: var(--border-soft);
    background: var(--surface-2);
    margin-top: 6px;
    display: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav__pages.is-open .mega {
    display: grid;
  }
  .mega__col a {
    padding: 9px 4px;
  }

  /* Login / Explore buttons, moved out of the header and shown
     full-width inside the hamburger menu on mobile only. */
  .nav__mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 14px;
  }
  .nav__mobile-actions .lang-switch {
    justify-content: center;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
  }
  .nav__mobile-actions .btn--block {
    margin-top: 0;
    width: 100%;
  }
}

/* Extra safety for very narrow phones so the dropdown never
   touches the viewport edges or overlaps the burger/logo. */
@media (max-width: 380px) {
  .header__inner {
    padding: 16px 16px;
  }
  .brand {
    width: auto;
  }
  .nav {
    right: 10px;
    left: 10px;
    padding: 12px 12px 16px;
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {
  .topbar {
    height: 64px;
  }

  .topbar-inner {
    padding: 0 16px;
  }

  /* Hide desktop elements */

  .desktop-nav,
  .top-actions {
    display: none;
  }

  /* Brand */

  .dlogo {
    width: 36px;
    height: 36px;

    font-size: 20px;
  }

  .brand-text strong {
    font-size: 15px;
  }

  .brand-text small {
    font-size: 8px;
  }

  /* Hamburger */

  .burger {
    display: flex;
  }

  /* Mobile dropdown */

  .mobile-nav {
    position: absolute;

    top: calc(100% + 8px);
    left: 12px;
    right: 12px;

    display: flex;
    flex-direction: column;

    padding: 10px;

    background: linear-gradient(
      145deg,
      rgba(8, 14, 28, 0.98),
      rgba(5, 10, 22, 0.98)
    );

    border: 1px solid rgba(92, 105, 139, 0.22);

    border-radius: 14px;

    box-shadow:
      0 20px 45px rgba(0, 0, 0, 0.45),
      0 0 25px rgba(91, 33, 182, 0.08);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s ease;
  }

  /* Open state */

  .mobile-nav.show {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
  }

  /* Links */

  .mobile-nav a {
    min-height: 47px;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 0 13px;

    border-radius: 9px;

    color: #8995ad;

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    transition:
      background 0.2s ease,
      color 0.2s ease;
  }

  .mobile-nav a i {
    width: 20px;

    text-align: center;

    font-size: 16px;

    color: #74819a;
  }

  .mobile-nav a:hover {
    color: #fff;

    background: rgba(124, 58, 237, 0.08);
  }

  .mobile-nav a:hover i {
    color: #a78bfa;
  }

  /* Active */

  .mobile-nav a.active {
    color: #fff;

    background: linear-gradient(
      90deg,
      rgba(124, 58, 237, 0.16),
      rgba(34, 211, 238, 0.04)
    );

    border: 1px solid rgba(124, 58, 237, 0.14);
  }

  .mobile-nav a.active i {
    color: #a78bfa;
  }

  /* Divider */

  .mobile-divider {
    height: 1px;

    margin: 9px 4px;

    background: rgba(100, 115, 145, 0.14);
  }

  /* Account */

  .mobile-account {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 10px 8px 7px;
  }

  .mobile-account .avatar {
    width: 36px;
    height: 36px;
  }

  .mobile-account > div:last-child {
    display: flex;
    flex-direction: column;

    line-height: 1.1;
  }

  .mobile-account strong {
    color: #e8edf7;

    font-size: 11px;
  }

  .mobile-account small {
    margin-top: 4px;

    color: #65728b;

    font-size: 9px;
  }
}

/* =====================================================
   VERY SMALL PHONES
===================================================== */

@media (max-width: 380px) {
  .topbar-inner {
    padding: 0 12px;
  }

  .brand-text small {
    display: none;
  }

  .mobile-nav {
    left: 8px;
    right: 8px;
  }
}
