@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #00070f;
  --surface: #03101b;
  --surface-2: #061522;
  --line: #142536;
  --line-2: #1b3042;
  --text: #e9edf2;
  --muted: #8b98a7;
  --purple: #771bd7;
  --violet: #9c40ff;
  --cyan: #20d9ff;
  --yellow: #ffd522;
}

/* ===================== 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 {
  width: min(1600px, 100%);
  margin: auto;
  padding: 22px 24px 30px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(420px, 1.4fr) 250px;
  gap: 17px;
  align-items: center;
  margin-bottom: 17px;
}

.crumb {
  margin: 0 0 16px;
  color: #8995a3;
  font-size: 10px;
}

.crumb span {
  padding: 0 8px;
  color: #495666;
}

.crumb a {
  text-decoration: none;
  color: #8995a3;
}

.hero h1 {
  margin: 0 0 8px;
  letter-spacing: -0.7px;
  font-size: 30px;
}

.hero h1 em {
  width: 39px;
  height: 39px;
  margin-left: 6px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #6d2caf;
  border-radius: 50%;
  color: #a14aff;
  font-size: 15px;
  font-style: normal;
  vertical-align: middle;
}

.hero-copy p {
  margin: 0;
  color: #c3c9d1;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(145deg, #061522, #03101b);
  box-shadow: 0 9px 28px #0004;
}

.stats {
  height: 83px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stats div {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid #172b3c;
}

.stats div:last-child {
  border-right: 0;
}

.stats i {
  grid-row: 1 / 3;
  color: #a03eff;
  font-size: 21px;
}

.stats div:last-child i {
  color: #4dd3b2;
}

.stats b {
  font-size: 18px;
}

.stats span {
  color: #c0c7d0;
  font-size: 10px;
}

.ai-box {
  height: 87px;
  position: relative;
  padding: 13px 15px;
  text-align: left;
  border: 1px solid #9235df;
  border-radius: 7px;
  background: linear-gradient(135deg, #061421, #090d20);
  color: #fff;
  box-shadow: 0 0 25px #7621c51b;
}

.ai-box div {
  font-size: 12px;
}

.ai-box i {
  margin-right: 6px;
  color: #b052ff;
}

.ai-box p {
  margin: 8px 0;
  color: #abb5c0;
  font-size: 10px;
  line-height: 1.5;
}

.ai-box strong {
  position: absolute;
  top: 30px;
  right: 18px;
  color: #a94bff;
  font-size: 25px;
}

.directory {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 325px;
  gap: 16px;
}

.toolbar {
  min-height: 91px;
  grid-column: 1;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 135px 145px 210px;
  gap: 10px;
  align-content: start;
}

.search,
.field {
  height: 39px;
  display: flex;
  align-items: center;
  border: 1px solid #1a3042;
  border-radius: 5px;
  background: #04101b;
}

.search input,
.field input {
  min-width: 0;
  flex: 1;
  padding: 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 10px;
}

.search i,
.field > i {
  padding: 0 12px;
  font-size: 17px;
}

.tool,
.sort {
  height: 39px;
  border: 1px solid #1c3144;
  border-radius: 5px;
  background: #05111d;
  color: #dfe3e9;
  font-size: 10px;
}

.tool i {
  margin-right: 4px;
}

.sort {
  padding: 0 14px;
  text-align: left;
}

.sort b {
  font-weight: 400;
}

.sort span {
  float: right;
}

.view {
  grid-column: 4;
  justify-self: end;
  display: flex;
  overflow: hidden;
  border: 1px solid #172b3c;
  border-radius: 5px;
}

.view button {
  height: 31px;
  padding: 0 12px;
  border: 0;
  background: #06121f;
  color: #9ba5b1;
  font-size: 10px;
}

.view .chosen {
  background: #32105e55;
  color: #a94eff;
}

.count {
  grid-column: 1 / 4;
  align-self: center;
  color: #8996a5;
  font-size: 10px;
}

.cards-wrap {
  grid-column: 1;
  margin-top: -1px;
  padding: 10px 16px 12px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.partner {
  height: 307px;
  position: relative;
  overflow: hidden;
  border: 1px solid #193043;
  border-radius: 7px;
  background: #061522;
}

.cover {
  height: 121px;
  position: relative;
  overflow: hidden;
  background: #172a39;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0001 40%, #061522 100%);
}

.cover .category {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 11px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #5420a6;
  color: #fff;
  font-size: 9px;
}

.cover .heart {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 9px;
  border: 0;
  background: none;
  color: #f3f5f7;
  font-size: 24px;
}

.city {
  background: linear-gradient(150deg, #182e45, #3b5d70 45%, #101c27);
}

.building {
  background: linear-gradient(140deg, #6685a0, #c5b6a2 40%, #263d49);
}

.law {
  background: linear-gradient(145deg, #251c15, #b17838 45%, #211711);
}

.audit {
  background: linear-gradient(145deg, #31424c, #b5b5ad 55%, #26333b);
}

.bank {
  background: linear-gradient(145deg, #263b47, #765a38 45%, #101820);
}

.insurance {
  background: radial-gradient(circle at 50% 20%, #23618a, #0c2131 65%);
}

.logistics {
  background: linear-gradient(145deg, #405363, #916f4c 55%, #17242c);
}

.tech {
  background: radial-gradient(circle at 50% 30%, #1c6b99, #071725 65%);
}

.cover.city::before {
  content: "";
  position: absolute;
  inset: 25% 0 0;
  background:
    linear-gradient(
      155deg,
      transparent 0 25%,
      #1b354c 26% 45%,
      transparent 46%
    ),
    repeating-linear-gradient(90deg, #91d8ff20 0 8px, transparent 8px 15px);
}

.cover.building::before {
  content: "▦ ▦";
  position: absolute;
  right: 18px;
  bottom: -16px;
  color: #d7e1e455;
  font-size: 76px;
  letter-spacing: 3px;
}

.cover.law::before {
  content: "⚖";
  position: absolute;
  right: 30px;
  bottom: -16px;
  color: #d8a76199;
  font-size: 83px;
}

.cover.audit::before {
  content: "▥";
  position: absolute;
  right: 22px;
  bottom: -25px;
  color: #edf0ed77;
  font-size: 100px;
}

.cover.bank::before {
  content: "BANK";
  position: absolute;
  top: 37px;
  right: 18px;
  color: #d5b37999;
  font-size: 27px;
  font-weight: 800;
}

.cover.insurance::before {
  content: "♢";
  position: absolute;
  top: 8px;
  right: 35px;
  color: #9ad7ff55;
  font-size: 105px;
}

.cover.logistics::before {
  content: "▰";
  position: absolute;
  right: 28px;
  bottom: -15px;
  color: #c8d5dc66;
  font-size: 95px;
}

.cover.tech::before {
  content: "⌘";
  position: absolute;
  top: 10px;
  right: 34px;
  color: #2bd3ff44;
  font-size: 100px;
}

.partner-body {
  padding: 9px 14px;
}

.partner-logo {
  position: absolute;
  z-index: 4;
  top: 70px;
  left: 14px;
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border: 1px solid #dce3e8;
  border-radius: 50%;
  background: #f2f4f4;
  color: #27313b;
  font-size: 15px;
  font-weight: 700;
}

.partner h3 {
  margin: 7px 0 4px;
  font-size: 13px;
}

.partner p {
  margin: 4px 0;
  color: #aeb7c1;
  font-size: 10px;
  line-height: 1.45;
}

.meta {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 5px 0 7px;
  border-bottom: 1px solid #132a3b;
}

.rating {
  color: var(--yellow);
}

.verified {
  padding: 4px 7px;
  border-radius: 3px;
  background: #251044;
  color: #b04cff;
  font-size: 9px;
}

.tags {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}

.tags span {
  padding: 5px 8px;
  border: 1px solid #1d3345;
  border-radius: 3px;
  color: #aab4bf;
  font-size: 9px;
}

.filters {
  grid-column: 2;
  grid-row: 1 / 4;
  height: max-content;
  position: sticky;
  top: 10px;
  padding: 17px 16px;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid #132737;
}

.filter-head h2 {
  margin: 0;
  font-size: 16px;
}

.filter-head button {
  border: 0;
  background: none;
  color: #aeb6c1;
  font-size: 10px;
}

.filters > label {
  display: block;
  margin: 18px 0 9px;
  font-size: 11px;
  font-weight: 600;
}

.field {
  width: 100%;
}

.field .stars {
  padding-right: 10px;
  white-space: nowrap;
  color: #a8b0ba;
  font-size: 12px;
}

.filters select {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  border: 1px solid #1a3042;
  border-radius: 5px;
  outline: 0;
  background: #04101b;
  color: #bfc6cf;
  font-size: 10px;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checks {
  display: grid;
  gap: 11px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #bfc6cf;
  font-size: 10px;
  font-weight: 400;
}

.checks input {
  appearance: none;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid #304152;
  border-radius: 4px;
  background: #05111c;
}

.checks input:checked {
  border-color: #8835ed;
  background: #7121d0;
}

.checks input:checked::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
}

.apply {
  width: 100%;
  height: 41px;
  margin-top: 30px;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(135deg, #6919d0, #8524e9);
  color: #fff;
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 14px;
}

.pagination button {
  width: 31px;
  height: 31px;
  border: 1px solid #1b3042;
  border-radius: 4px;
  background: #06121e;
  color: #d7dce3;
}

.pagination .current {
  border-color: #8732ee;
  background: #7620d8;
}

.pagination span {
  color: #84909e;
}

#toast {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 24px;
  padding: 10px 18px;
  border: 1px solid #8534ca;
  border-radius: 6px;
  background: #101e2d;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: 0.25s;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Large tablets / small laptops */
@media (max-width: 1250px) {
  .brand {
    width: 190px;
    flex-basis: 190px;
  }

  .desktop-nav a {
    padding: 0 11px;
  }

  .hero {
    grid-template-columns: 1fr 1.2fr;
  }

  .ai-box {
    display: none;
  }

  .directory {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: 1fr 130px 140px;
  }

  .view {
    grid-column: 3;
  }

  .count {
    grid-column: 1 / 3;
  }
}

/* Mobile navigation breakpoint */
@media (max-width: 900px) {
  .topbar {
    min-height: 68px;
    padding: 10px 15px;
  }

  .desktop-nav,
  .header-actions .lang,
  .header-actions .signin {
    display: none;
  }

  .brand {
    width: auto;
    flex: 1;
  }

  .hamburger {
    width: 42px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid #26394c;
    border-radius: 6px;
    background: #05111d;
    color: #dfe5eb;
    font-size: 23px;
  }

  .header-actions {
    margin-left: auto;
    gap: 8px;
  }

  .header-actions > .primary {
    display: inline-block;
    height: 40px;
    padding: 0 13px;
  }

  .mobile-menu {
    position: absolute;
    top: 100%;
    right: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    padding: 8px;
    border: 1px solid #1b3042;
    border-radius: 8px;
    background: #03101bf8;
    box-shadow: 0 18px 45px #0009;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: 0.2s ease;
  }

  .mobile-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .mobile-menu > a {
    padding: 13px 14px;
    border-radius: 5px;
    color: #dce1e7;
    text-decoration: none;
  }

  .mobile-menu > a:hover,
  .mobile-menu > a.active {
    background: #32105e55;
    color: #a94eff;
  }

  .mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 6px 4px;
    border-top: 1px solid #162a3d;
  }

  .mobile-actions .header-btn {
    width: 100%;
  }

  .hero {
    display: block;
  }

  .stats {
    margin-top: 15px;
  }

  .directory {
    display: block;
  }

  .filters {
    display: none;
  }

  .filters.open {
    display: block;
    position: fixed;
    z-index: 200;
    top: 78px;
    right: 10px;
    width: min(310px, calc(100vw - 20px));
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }

  .toolbar {
    grid-template-columns: 1fr 120px;
  }

  .search {
    grid-column: 1 / -1;
  }

  .sort {
    grid-column: 1;
  }

  .view {
    grid-column: 2;
  }

  .count {
    grid-column: 1 / -1;
  }
}

/* Phones */
@media (max-width: 600px) {
  .page {
    padding: 15px 10px 25px;
  }

  .topbar {
    padding-inline: 10px;
  }

  .brand-copy b {
    font-size: 15px;
  }

  .brand-copy small {
    font-size: 9px;
  }

  .header-actions > .primary {
    display: none;
  }

  .hero h1 {
    font-size: 25px;
  }

  .stats {
    height: auto;
    grid-template-columns: 1fr 1fr;
  }

  .stats div {
    min-height: 64px;
  }

  .stats div:nth-child(2) {
    border-right: 0;
  }

  .stats div:nth-child(-n + 2) {
    border-bottom: 1px solid #172b3c;
  }

  .toolbar {
    display: flex;
    flex-wrap: wrap;
  }

  .search {
    width: 100%;
  }

  .tool,
  .sort {
    flex: 1 1 120px;
  }

  .view {
    width: 100%;
    justify-self: stretch;
  }

  .view button {
    flex: 1;
  }

  .count {
    width: 100%;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .partner {
    height: 310px;
  }

  .filters.open {
    top: 74px;
  }

  .mobile-menu {
    right: 10px;
    left: 10px;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 22px;
  }

  .brand {
    gap: 8px;
  }

  .mobile-actions {
    grid-template-columns: 1fr;
  }

  .two {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   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;
  }
}
