/* ══════════════════════════════════════════
     BOTTOM NAV
     ══════════════════════════════════════════ */
.bnav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  min-height: calc(64px + env(safe-area-inset-bottom));
  padding: 0 8px calc(4px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  align-items: stretch;
  justify-content: space-around;
  direction: rtl;
}

html.dark .bnav {
  background: rgba(30, 41, 59, 0.94);
  border-top-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
  .bnav {
    display: flex;
  }
}

@media (min-width: 769px) {
  .bnav {
    display: none;
  }
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--text-dim, #9ca3af);
  text-decoration: none;
  border-radius: 12px;
  margin: 6px 3px;
  transition: color 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  position: relative;
  min-width: 0;
}

.bnav-item i {
  font-size: 19px;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.bnav-item span {
  font-family: var(--font-body, 'Tajawal', sans-serif);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bnav-item:not(.bnav-cta):hover {
  color: var(--blue-500, #3b82f6);
}

.bnav-item:not(.bnav-cta).active {
  color: var(--blue-600, #2563eb);
  background: rgba(59, 130, 246, 0.09);
}

.bnav-item:not(.bnav-cta).active i {
  transform: scale(1.15) translateY(-1px);
}

html.dark .bnav-item:not(.bnav-cta).active {
  color: var(--blue-500, #3b82f6);
  background: rgba(59, 130, 246, 0.14);
}

.bnav-cta {
  color: #fff;
  background: linear-gradient(145deg, var(--blue-600, #2563eb) 0%, #4f46e5 100%);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  margin: 6px 6px;
  flex: 1.1;
}

.bnav-cta span {
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
}

.bnav-cta i {
  font-size: 18px;
}

.bnav-cta:hover,
.bnav-cta.active {
  background: linear-gradient(145deg, var(--blue-700, #1d4ed8) 0%, #4338ca 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

.bnav-cta.active i {
  transform: none;
}

html.dark .nav-shell {
  background: #1e293b;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .5)
}

html.dark .nav {
  background: transparent
}

html.dark .nav-action-btn {
  background: #243044;
  border-color: rgba(255, 255, 255, .1);
  color: var(--text-muted)
}

html.dark .nav-action-btn:hover {
  background: #2d3f55;
  color: var(--blue-light);
  border-color: rgba(59, 130, 246, .3)
}

html.dark .nav-search {
  background: #243044;
  border-color: rgba(255, 255, 255, .12)
}

html.dark .nav-search input {
  background: transparent;
  color: var(--text)
}

html.dark .nav-search-category {
  background: #1e293b;
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, .08)
}

html.dark #themeToggle {
  background: #243044;
  border-color: rgba(255, 255, 255, .1);
  color: var(--text-muted)
}

html.dark .header-cats {
  background: #1e293b;
  border-top-color: rgba(255, 255, 255, .08)
}

html.dark .header-topbar {
  background: #1d4ed8
}

html.dark .nav-search input {
  background: #243044;
  border-color: rgba(255, 255, 255, .12);
  color: var(--text)
}

html.dark .nav-search input:focus {
  background: #2d3f55;
  border-color: var(--blue-light)
}

html.dark .nav-search-icon {
  color: var(--text-dim)
}

html.dark .nav-search-category {
  background: #1a2336;
  border-color: rgba(255, 255, 255, .08);
  color: var(--text-muted)
}

html.dark .nav-search-btn {
  background: var(--blue)
}

html.dark .header-cats::before {
  background: linear-gradient(to left, #1e293b 0%, transparent 100%)
}

html.dark .header-cats::after {
  background: linear-gradient(to right, #1e293b 0%, transparent 100%)
}

html.dark .header-cat-link {
  color: var(--text-muted)
}

html.dark .header-cat-link:hover,
html.dark .header-cat-link.active {
  color: var(--blue-light)
}

.nav-action-btn,
#themeToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0
}

#themeToggle {
  width: 36px;
  padding: 0;
  font-size: 15px
}

.nav-action-btn i,
#themeToggle i {
  font-size: 14px
}

.nav-action-btn:hover,
#themeToggle:hover {
  color: var(--blue);
  border-color: var(--blue-light);
  background: var(--blue-pale)
}

.nav-action-btn.cta {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  padding: 0 16px
}

.nav-action-btn.cta:hover {
  background: var(--blue-mid);
  border-color: var(--blue-mid)
}

.nav-action-btn span {
  display: none
}

.nav-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
  width: 100%
}

.header-topbar {
  background: var(--blue);
  color: rgba(255, 255, 255, .92);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
  overflow: hidden
}

.header-topbar-item {
  display: flex;
  align-items: center;
  gap: 6px
}

.header-topbar-item i {
  font-size: 11px;
  opacity: .85
}

.header-topbar-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, .25)
}

.header-topbar-inner {
  display: none;
  gap: 0;
  white-space: nowrap;
  align-items: center;
  width: max-content;
  flex-shrink: 0;
}

.header-topbar-inner span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 28px
}

.header-topbar-inner i {
  font-size: 11px;
  opacity: .75
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
  width: min(1240px, 100%);
  margin: 0 auto
}

.nav.scrolled {
  padding: 8px 20px
}

.nav-search {
  flex: 1;
  min-width: 0;
  max-width: 620px;
  position: relative;
  height: 42px
}

.nav-search-icon {
  position: absolute;
  right: 14px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
  z-index: 2;
  line-height: 1
}

.nav-search input {
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 0 40px 0 52px;
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  direction: rtl
}

.nav-search input::placeholder {
  color: var(--text-dim)
}

.nav-search input:focus {
  border-color: var(--blue-light);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--blue-pale)
}

.nav-search-btn {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 44px;
  height: 100%;
  background: var(--blue);
  border: none;
  border-radius: 9px 0 0 9px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .18s;
  z-index: 2
}

.nav-search-btn:hover {
  background: var(--blue-mid);
  transform: none
}

.nav-search-inner {
  display: contents
}

.nav-search-category {
  display: none
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-right: auto
}

.nav-links {
  display: none
}

.nav-center {
  display: none
}

.nav-journey-step,
.nav-journey-sep {
  display: none
}

.nav>a.btn-primary {
  display: none
}

.header-cats {
  border-top: 1px solid var(--border);
  background: #fff;
  position: relative;
  z-index: 100;
  overflow: visible
}

.header-cats::before,
.header-cats::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  z-index: 2;
  pointer-events: none;
  transition: opacity .2s ease
}

.header-cats::before {
  right: 0;
  background: linear-gradient(to left, #fff 0%, transparent 100%)
}

.header-cats::after {
  left: 0;
  background: linear-gradient(to right, #fff 0%, transparent 100%)
}

html.dark .header-cats::before {
  background: linear-gradient(to left, #1e293b 0%, transparent 100%)
}

html.dark .header-cats::after {
  background: linear-gradient(to right, #1e293b 0%, transparent 100%)
}

.header-cats-inner {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  flex-wrap: nowrap
}

.header-cats-inner::-webkit-scrollbar {
  display: none
}

.header-cat-link {
  flex-shrink: 0
}

.header-cat-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--trans);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-body)
}

.header-cat-link i {
  font-size: 13px
}

.header-cat-link:hover {
  color: var(--blue);
  border-bottom-color: var(--blue-light)
}

.header-cat-link.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 800
}

.header-cat-link.hot-cat {
  color: var(--red)
}

.header-cat-link.hot-cat:hover {
  color: var(--red);
  border-bottom-color: var(--red)
}

.header-cat-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 2px
}

.header-cat-link.sys-link {
  color: var(--text-muted)
}

.header-cat-link.sys-link:hover {
  color: var(--amber-600);
  border-bottom-color: var(--amber-400)
}

.header-cat-link.sys-link.active {
  color: var(--amber-600);
  border-bottom-color: var(--amber-500)
}

.badge-dropdown-wrap .header-cat-link {
  gap: 6px
}

.nav-spacer {
  height: 112px
}

.nav-shell {
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%)
}

.header-cats {
  border-top: 1px solid var(--border);
  background: var(--surface)
}

.header-cat-link {
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  padding: 10px 14px;
  letter-spacing: .01em
}

.header-cat-link.active {
  color: var(--blue-600);
  border-bottom-color: var(--blue-600);
  font-weight: var(--weight-bold)
}

.nav-search {
  border-radius: var(--r3);
  border-color: var(--border);
  box-shadow: var(--shadow-xs)
}

.nav-search:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(147, 197, 253, .25)
}

.nav-action-btn {
  border-radius: var(--r3);
  border-color: var(--border);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  box-shadow: none;
  padding: 7px 11px
}

.nav-action-btn:hover {
  color: var(--blue-600);
  background: var(--blue-50);
  border-color: var(--blue-200)
}

.nav-action-btn.cta {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
  box-shadow: var(--shadow-blue)
}

.nav-action-btn.cta:hover {
  background: var(--blue-700);
  border-color: var(--blue-700);
  box-shadow: var(--shadow-blue-lg)
}

.header-topbar {
  font-size: 11.5px
}

@media(min-width:900px) {
  .nav-action-btn span {
    display: inline
  }
}

@media(max-width:600px) {
  .header-topbar-item {
    display: none
  }

  .header-topbar-sep {
    display: none
  }

  .header-topbar {
    padding: 5px 0;
    justify-content: flex-start
  }

  .header-topbar-inner {
    display: flex;
    animation: mq-scroll 38s linear infinite
  }
}

@media(max-width:760px) {
  .nav-spacer {
    height: 100px
  }
}

@media(max-width:760px) {
  .header-topbar {
    font-size: 11px;
    padding: 5px 12px
  }

  .nav-search-category {
    display: none
  }

  .nav {
    flex-wrap: wrap;
    padding: 8px 12px 6px;
    gap: 8px
  }

  .brand {
    flex: 1;
    min-width: 0
  }

  .nav-actions {
    margin-right: 0
  }

  .nav-search {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    height: 42px;
    margin-bottom: 4px
  }

  .nav-search input {
    font-size: 14px
  }
}

@media(max-width:520px) {
  .nav-actions {
    gap: 3px
  }
}

@media(max-width:900px) {
  .nav-center {
    display: none
  }
}

@media(max-width:760px) {
  body {
    padding-bottom: 72px
  }

  .nav-shell {
    top: 0
  }
}

@media(max-width:640px) {
  .nav {
    padding: 8px 12px;
    gap: 8px;
    grid-template-columns: auto 1fr auto
  }

  .brand-text span {
    display: none
  }

  .brand img {
    width: 34px;
    height: 34px
  }

  .brand-text b {
    font-size: 15px
  }

  .nav-search {
    height: 38px;
    border-radius: 8px;
    border-width: 1.5px
  }

  .nav-search-category {
    display: none
  }

  .nav-search input {
    font-size: 13px;
    padding: 0 12px 0 10px
  }

  .nav-search-btn {
    width: 40px;
    font-size: 14px
  }

  .nav-actions {
    gap: 4px
  }

  .nav-action-btn {
    padding: 8px 10px;
    border-radius: 8px;
    min-height: 38px
  }

  .nav-action-btn span {
    display: none
  }

  .nav-action-btn i {
    font-size: 17px
  }

  .nav-action-btn:first-child {
    display: none
  }

  .header-cats-inner {
    padding: 0 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0
  }

  .header-cat-link {
    padding: 9px 12px;
    font-size: 12px;
    scroll-snap-align: start;
    border-bottom-width: 2px
  }

  .header-cat-link i {
    font-size: 12px
  }

  .header-cat-sep {
    display: none
  }

  .nav-spacer {
    height: 96px
  }
}

@media(max-width:380px) {
  .nav-action-btn.cta {
    padding: 8px 12px
  }

  .nav-action-btn.cta span {
    display: none
  }
}

.header-wrap {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .04)
}

html.dark .header-wrap {
  background: var(--surface)
}

.nav {
  padding: 10px 16px 8px;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap
}

.nav-actions {
  gap: 4px;
  flex-shrink: 0
}

.nav-action-btn,
#themeToggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  background: var(--surface-2);
  border: none;
  justify-content: center;
  min-width: 0
}

.nav-action-btn span,
#themeToggle span {
  display: none
}

.nav-search {
  order: 3;
  flex: 1 1 100%;
  max-width: 100%;
  height: 40px;
  margin-bottom: 4px
}

.nav-search input {
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  width: 100%
}

@media (max-width: 768px) {
  .nav.scrolled {
    padding: 10px 14px 0;
    box-shadow: none;
    transform: none;
    transition: none
  }
}


@media (max-width: 768px) {
  .nav-shell {
    display: flex;
    flex-direction: column;
    overflow: visible
  }

  .header-cats {
    overflow: visible;
    position: relative;
    z-index: 200
  }

  .header-cats-inner {
    overflow-x: auto;
    overflow-y: visible
  }

  .header-topbar {
    margin: 0;
    padding: 5px 12px
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    padding: 7px 12px 4px;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: unset
  }

  .brand {
    flex: 1;
    min-width: 0;
    order: 1
  }

  .brand-text span {
    display: none
  }

  .brand img {
    width: 30px;
    height: 30px
  }

  .brand-text b {
    font-size: 14px
  }

  .nav-actions {
    order: 2;
    margin-right: 0;
    flex-shrink: 0;
    gap: 4px
  }

  .nav-action-btn {
    display: none
  }

  #themeToggle {
    display: flex;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    padding: 0;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0
  }

  .nav-search {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
    height: 38px;
    margin-bottom: 4px;
    box-sizing: border-box;
    position: relative;
    border-radius: 9px
  }

  .nav-search input {
    width: 100%;
    height: 38px;
    border-radius: 9px;
    border: 1.5px solid var(--border);
    padding: 0 42px 0 46px;
    font-size: 13px;
    background: var(--surface-2);
    direction: rtl;
    outline: none;
    box-sizing: border-box
  }

  .nav-search-icon {
    position: absolute;
    right: 14px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--text-dim);
    pointer-events: none;
    z-index: 2
  }

  .nav-search-btn {
    position: absolute;
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    transform: none;
    width: 40px;
    height: 38px;
    min-height: 38px;
    border-radius: 9px 0 0 9px;
    background: var(--blue);
    border: none;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    flex-shrink: 0
  }

  .nav-search-btn:hover {
    background: var(--blue-mid);
    transform: none
  }

  .nav-spacer {
    height: 182px
  }
}