@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap");
:root {
  --bg: #020914;
  --panel: #061221;
  --panel2: #071525;
  --border: #1c2b41;
  --muted: #8490a4;
  --text: #f4f5f8;
  --purple: #a343ff;
  --purple2: #6716d9;
  --cyan: #53d7ff;
  --green: #24b77b;
  --glow: 0 0 25px rgba(139, 45, 255, 0.16);
}

/* ===================== TOKENS ===================== */
: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;
  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);
}

.page {
  max-width: 1480px;
  margin: auto;
  padding: 11px 28px 28px;
  position: relative;
}
.crumbs {
  height: 39px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #778196;
  font-size: 11px;
}
.crumbs b {
  color: #69758a;
  font-size: 18px;
  font-weight: 400;
}
.crumbs strong {
  font-weight: 500;
  color: #aab2c1;
}

.crumbs a {
  text-decoration: none;
  color: #aab2c1;
}

.panel {
  background: linear-gradient(
    145deg,
    rgba(6, 17, 31, 0.96),
    rgba(3, 12, 23, 0.97)
  );
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.02),
    0 14px 35px rgba(0, 0, 0, 0.13);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}
.hero {
  height: 303px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  direction: ltr;
  padding: 0;
  overflow: hidden;
}
.hero-image {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 8px 0 0 8px;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-image:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.1) 60%,
    rgba(1, 7, 16, 0.55)
  );
}
.renew {
  position: absolute;
  top: 13px;
  left: 15px;
  z-index: 2;
  background: rgba(2, 8, 17, 0.82);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 11px;
}
.renew:first-letter {
  color: #ffda36;
}
.active-tag {
  position: absolute;
  bottom: 12px;
  left: 15px;
  z-index: 2;
  border: 1px solid #a13eff;
  background: #130d2d;
  color: #c26bff;
  border-radius: 5px;
  padding: 6px 11px;
  font-size: 10px;
}
.hero-main {
  direction: rtl;
  padding: 14px 15px;
}
.title-line {
  display: flex;
  align-items: center;
  gap: 14px;
}
.title-line h1 {
  font-size: 27px;
  margin: 2px 0 6px;
  line-height: 1.4;
  font-weight: 800;
  white-space: nowrap;
}
.bookmark {
  font-size: 28px;
  color: #bdc4d0;
  background: transparent;
  border: 0;
  padding: 0;
  line-height: 1;
}
.bookmark:hover,
.bookmark[aria-pressed="true"] {
  color: #a448ff;
}
.location {
  color: #d0d4dc;
  margin: 0 0 23px;
  font-size: 12px;
}
.location:first-letter {
  color: #a448ff;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.metrics > div {
  height: 85px;
  border: 1px solid #213149;
  border-radius: 6px;
  text-align: center;
  position: relative;
  padding: 8px;
}
.metrics small {
  display: block;
  color: #9ca5b4;
  font-size: 9px;
}
.metrics strong {
  display: block;
  font-size: 16px;
  margin-top: 6px;
}
.metrics em {
  font-style: normal;
  font-size: 11px;
  color: #d7dbe3;
}
.metrics i {
  font-style: normal;
  color: #a84cff;
  font-size: 22px;
  position: absolute;
  left: 11px;
  bottom: 8px;
}
.description {
  font-size: 11px;
  color: #c4c9d3;
  line-height: 1.9;
  margin: 18px 0 0;
}
.action-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.action-card button {
  height: 45px;
  border: 1px solid #26364d;
  background: #061120;
  color: #eee;
  border-radius: 6px;
  text-align: right;
  padding: 0 15px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.action-card .primary-action {
  background: linear-gradient(90deg, #7118ed, #5c13c6);
  border-color: #8436f2;
  box-shadow: 0 0 20px rgba(122, 32, 237, 0.2);
}
.action-card button span {
  font-size: 18px;
  color: #ad50ff;
}
.login-note {
  font-size: 9px;
  color: #aeb5c3;
  border: 1px solid #202e43;
  background: #050d19;
  border-radius: 6px;
  padding: 11px 12px;
  line-height: 1.7;
}
.tabs {
  height: 55px;
  margin-top: 9px;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #172438;
  border-radius: 0;
  box-shadow: none;
}
.tab {
  background: transparent;
  border: 0;
  color: #d6d9e0;
  padding: 0 18px;
  position: relative;
  font-size: 12px;
}
.tab span {
  color: #a64cff;
  font-size: 17px;
  margin-right: 7px;
}
.tab.active {
  font-weight: 700;
}
.tab.active:after {
  content: "";
  height: 3px;
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  background: #a43dff;
  box-shadow: 0 0 13px #a43dff;
}

/* ==== Layout below the tabs ====
   Rebuilt with CSS Grid/Flexbox instead of hard-coded absolute
   positioning, so the sidebar (quick info / interested / share)
   can never overlap the main content, at any screen size or
   content length. */
.content-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 13px;
  margin-top: 10px;
  align-items: start;
}
.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}

.body-grid {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 13px;
}
.body-grid > .panel {
  min-height: 348px;
}
.map-card {
  padding: 11px;
}
.map-card h2,
.summary-card h2,
.insight-card h2 {
  font-size: 14px;
  margin: 0 0 10px;
}
.map {
  height: 166px;
  position: relative;
  border: 1px solid #25364e;
  border-radius: 6px;
  overflow: hidden;
}
.map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) brightness(0.78);
}
.pin {
  position: absolute;
  top: 65px;
  right: 48%;
  color: #9b3fff;
  font-size: 34px;
  text-shadow: 0 0 20px #8e34ff;
}
.map-card h3 {
  font-size: 11px;
  margin: 12px 0 8px;
}
.map-card ul {
  padding: 0;
  margin: 0;
  list-style: none;
}
.map-card li {
  font-size: 9px;
  color: #b4bbc8;
  line-height: 1.9;
  position: relative;
  padding-right: 17px;
}
.map-card li b {
  position: absolute;
  right: 0;
  color: #9f42ff;
}
.summary-card {
  padding: 11px 16px;
}
.summary-card > p {
  font-size: 10px;
  line-height: 1.9;
  color: #c4cad5;
  margin: 0 0 10px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid #1d2a3e;
  border-bottom: 1px solid #1d2a3e;
  padding: 10px 0;
}
.facts div {
  text-align: center;
  border-left: 1px solid #1d2a3e;
  position: relative;
}
.facts div:last-child {
  border-left: 0;
}
.facts b {
  display: block;
  font-size: 13px;
}
.facts span {
  display: block;
  font-size: 8px;
  color: #a0a9b9;
  line-height: 1.55;
  margin-top: 5px;
}
.facts i {
  font-style: normal;
  color: #a54bff;
  font-size: 20px;
  display: block;
  margin-top: 6px;
}
.section-title {
  font-size: 12px;
  margin: 13px 0 9px;
}
.financials {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.financials div {
  text-align: center;
}
.financials b {
  display: block;
  color: #b652ff;
  font-size: 14px;
}
.financials small {
  font-size: 7px;
  color: #9aa4b4;
  line-height: 1.45;
}
.footnote {
  font-size: 8px !important;
  text-align: right;
  margin: 11px 0 0 !important;
  color: #8993a5 !important;
}
.insight-card {
  padding: 11px;
  text-align: center;
}
.insight-card h2 {
  text-align: right;
}
.insight-card h2 span {
  font-weight: 400;
  color: #a3aaba;
}
.insight-card h2 b {
  color: #b04fff;
  float: left;
}
.donut-wrap {
  height: 170px;
  position: relative;
  display: grid;
  place-items: center;
}
.donut {
  width: 150px;
  height: 150px;
  transform: rotate(-90deg);
}
.donut circle {
  fill: none;
  stroke-width: 8;
}
.track {
  stroke: #18263b;
}
.arc {
  stroke: #a03fff;
  stroke-dasharray: 345;
  stroke-dashoffset: 28;
  filter: drop-shadow(0 0 4px #7e32ff);
  stroke-linecap: round;
}
.score {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.score strong {
  font-size: 28px;
}
.score small {
  font-size: 9px;
  color: #a9b0bd;
}
.insight-card h3 {
  font-size: 12px;
  color: #b957ff;
  margin: 0;
}
.insight-card p {
  font-size: 9px;
  color: #b7beca;
  line-height: 1.8;
}
.outline-btn {
  height: 38px;
  border: 1px solid #8739dc;
  border-radius: 5px;
  background: #080d19;
  color: #c268ff;
  padding: 0 18px;
}
.quick {
  padding: 12px 18px;
  min-height: 287px;
}
.quick h2,
.interested h2,
.share h2 {
  font-size: 14px;
  margin: 0 0 7px;
}
.quick-row {
  height: 45px;
  border-bottom: 1px solid #1a2739;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}
.quick-row:last-child {
  border-bottom: 0;
}
.quick-row span {
  color: #d3d7df;
}
.quick-row b {
  font-weight: 400;
  color: #c3c9d3;
}
.quick-row b:nth-child(2) {
  text-align: left;
}
.quick-row b.green {
  color: #2ab87e;
}
.interested {
  padding: 12px 18px;
  min-height: 168px;
}
.interested-count {
  font-size: 24px;
  font-weight: 700;
}
.interested p {
  font-size: 9px;
  margin: -4px 0 4px;
  color: #b4bbc7;
}
.avatars {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  direction: ltr;
  margin: -28px 0 10px 65px;
}
.avatars span,
.avatars b {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a2536;
  border: 2px solid #0a1321;
  margin-left: -7px;
  font-size: 16px;
}
.avatars b {
  background: #344055;
  color: #fff;
  font-size: 10px;
}
.interested .outline-btn {
  width: 100%;
  height: 36px;
}
.similar {
  padding: 10px 13px;
}
.similar h2 {
  font-size: 12px;
  margin: 0 0 8px;
}
.similar h2 a {
  float: right;
  color: #ad51ff;
  font-weight: 500;
  font-size: 10px;
  text-decoration: none;
}
.similar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}
.op-card {
  height: 103px;
  border: 1px solid #213149;
  border-radius: 6px;
  display: flex;
  gap: 10px;
  padding: 7px;
  direction: ltr;
}
.op-card img {
  width: 123px;
  height: 87px;
  object-fit: cover;
  border-radius: 5px;
}
.op-card > div {
  direction: rtl;
  flex: 1;
  min-width: 0;
}
.op-card small {
  color: #b54fff;
  font-size: 7px;
}
.op-card h3 {
  font-size: 10px;
  margin: 4px 0;
}
.op-card p {
  font-size: 8px;
  color: #8993a4;
  margin: 0;
}
.op-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 7px;
  color: #a2aaba;
  direction: ltr;
}
.op-card footer b {
  color: #fff;
  font-size: 10px;
}
.share {
  padding: 12px 18px;
  min-height: 142px;
  text-align: center;
}
.share h2 {
  text-align: right;
}
.share-icons {
  display: flex;
  justify-content: center;
  gap: 19px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.share-icons button {
  width: 40px;
  height: 40px;
  border: 1px solid #2b3b52;
  background: #06111f;
  border-radius: 50%;
  color: #aeb5c3;
}
.share-icons button:last-child {
  color: #6bc89b;
}
.share-icons button:nth-child(2) {
  font-size: 12px;
}

@media (max-width: 1100px) {
  .nav {
    padding: 0 15px;
    gap: 15px;
  }
  .nav nav {
    gap: 18px;
  }
  .brand {
    min-width: 180px;
  }
  .page {
    padding: 10px 15px;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .hero {
    grid-template-columns: 40% 60%;
  }
  .title-line h1 {
    font-size: 22px;
  }
  .content-area {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .body-grid {
    grid-template-columns: 1fr 1.5fr;
  }
  .donut-wrap {
    height: 130px;
  }
  .donut {
    width: 120px;
    height: 120px;
  }
}
@media (max-width: 800px) {
  .topbar {
    height: 61px;
  }
  .nav {
    position: relative;
  }
  .brand {
    min-width: 0;
  }
  .nav-actions {
    display: none;
  }
  .hamburger {
    display: block;
    margin-right: auto;
  }
  .nav nav {
    display: none;
    position: absolute;
    top: 61px;
    right: 10px;
    left: 10px;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    background: #06101e;
    border: 1px solid #26344b;
    border-radius: 7px;
    padding: 8px;
    box-shadow: 0 18px 40px #000;
  }
  .nav nav.open {
    display: flex;
  }
  .nav nav a {
    height: 44px;
    padding: 0 12px;
    border-bottom: 1px solid #18263b;
  }
  .nav nav a.active:after {
    display: none;
  }
  .hero-grid,
  .content-area,
  .body-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    height: auto;
    grid-template-columns: 1fr;
  }
  .hero-image {
    height: 230px;
    border-radius: 8px 8px 0 0;
  }
  .hero-main {
    padding: 13px;
  }
  .title-line h1 {
    font-size: 20px;
    white-space: normal;
  }
  .action-card {
    order: -1;
  }
  .tabs {
    overflow: auto;
    justify-content: flex-start;
  }
  .tab {
    min-width: 125px;
  }
  .body-grid > .panel {
    min-height: auto;
  }
  .similar-grid {
    grid-template-columns: 1fr;
  }
  .op-card {
    height: 115px;
  }
  .op-card img {
    width: 145px;
    height: 99px;
  }
  .page {
    padding: 8px;
  }
  .facts,
  .financials {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .facts div:nth-child(4),
  .facts div:nth-child(5) {
    margin-top: 5px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .brand-name {
    font-size: 9px;
  }
  .logo {
    width: 40px;
    height: 40px;
  }
  .crumbs {
    font-size: 9px;
  }
  .hero-image {
    height: 190px;
  }
  .metrics > div {
    height: 76px;
  }
  .metrics strong {
    font-size: 17px;
  }
  .description {
    font-size: 10px;
  }
  .action-card button {
    height: 42px;
  }
  .facts,
  .financials {
    grid-template-columns: repeat(2, 1fr);
  }
  .similar-grid {
    gap: 8px;
  }
  .op-card img {
    width: 105px;
  }
  .op-card h3 {
    font-size: 9px;
  }
  .op-card footer {
    font-size: 6px;
  }
}

/* =====================================================
   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;
  }
}

/* ---- 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;
  }
}
