/* Unified public top bar — same color + controls on phone, tablet, desktop */
:root {
  --asab-chrome-bg: rgba(15, 15, 16, 0.94);
  --asab-chrome-ink: #faf6ee;
  --asab-chrome-muted: rgba(250, 246, 238, 0.72);
  --asab-chrome-line: rgba(255, 255, 255, 0.12);
  --asab-chrome-gold: #c5a059;
  --asab-chrome-h: 56px;
}

html.asab-chrome-on {
  scroll-padding-top: calc(var(--asab-chrome-h) + 24px);
}

#asab-chrome-spacer {
  height: calc(var(--asab-chrome-h) + 20px);
  flex-shrink: 0;
  pointer-events: none;
}
html.asab-chrome-home #asab-chrome-spacer { height: 0; }
html.asab-chrome-on,
html.asab-chrome-home,
html.asab-chrome-overlay {
  display: block !important;
  visibility: visible !important;
}

.asab-chrome {
  position: fixed;
  top: 10px;
  left: 12px;
  right: 12px;
  width: auto;
  max-width: none;
  box-sizing: border-box;
  z-index: 12000;
  height: var(--asab-chrome-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: var(--asab-chrome-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--asab-chrome-line);
  border-radius: 16px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
  font-family: 'Tajawal', sans-serif;
  color: var(--asab-chrome-ink);
  direction: inherit;
}

.asab-chrome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--asab-chrome-ink);
  font-size: 1.28rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.asab-chrome-btn:hover,
.asab-chrome-btn:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}
.asab-chrome-btn:active { background: rgba(255, 255, 255, 0.22); }
.asab-chrome-btn i { color: inherit; pointer-events: none; }

.asab-chrome-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--asab-chrome-ink);
  text-align: start;
}

.asab-chrome-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
}

.asab-chrome-lang-wrap { position: relative; }

.asab-chrome-lang-pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 168px;
  padding: 6px;
  background: rgba(18, 18, 20, 0.96);
  border: 1px solid var(--asab-chrome-line);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 12001;
  flex-direction: column;
  gap: 2px;
}
.asab-chrome-lang-pop.open { display: flex; }

.asab-chrome-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--asab-chrome-ink);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: start;
}
.asab-chrome-lang-item:hover,
.asab-chrome-lang-item.active { background: rgba(197, 160, 89, 0.18); color: #e8c86a; }
.asab-chrome-lang-item img { width: 24px; height: 16px; border-radius: 3px; object-fit: cover; }

#asab-chrome-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 11990;
}
#asab-chrome-overlay.open { display: block; }

.asab-chrome-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: min(320px, 88vw);
  z-index: 11995;
  background: #121214;
  color: var(--asab-chrome-ink);
  transform: translateX(-110%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  font-family: 'Tajawal', sans-serif;
}
html[dir="rtl"] .asab-chrome-drawer { transform: translateX(110%); }
.asab-chrome-drawer.open,
html[dir="rtl"] .asab-chrome-drawer.open { transform: translateX(0); }

.asab-chrome-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--asab-chrome-line);
}
.asab-chrome-drawer-brand {
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--asab-chrome-gold);
}
.asab-chrome-drawer-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--asab-chrome-ink);
  font-size: 1.4rem;
  cursor: pointer;
}

.asab-chrome-drawer-links {
  display: flex;
  flex-direction: column;
  padding: 0.7rem;
  gap: 4px;
  overflow-y: auto;
}
.asab-chrome-drawer-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  color: var(--asab-chrome-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.asab-chrome-drawer-links a:hover,
.asab-chrome-drawer-links a[aria-current="page"] {
  background: rgba(197, 160, 89, 0.16);
  color: #e8c86a;
}
.asab-chrome-drawer-links a i { font-size: 1.25rem; color: var(--asab-chrome-gold); }

/* Hide competing public headers once chrome is on */
html.asab-chrome-on .nav-center-btns,
html.asab-chrome-on #nav-mobile,
html.asab-chrome-on .nav-mobile,
html.asab-chrome-on #mob-drawer,
html.asab-chrome-on #mob-overlay,
html.asab-chrome-on .about-lang-wrap,
html.asab-chrome-on .shops-page-header,
html.asab-chrome-on .blog-header,
html.asab-chrome-on header.header,
html.asab-chrome-on header.top,
html.asab-chrome-on .page-wrap > .top-bar,
html.asab-chrome-on body > .top-bar:not(header) {
  display: none !important;
}

/* Legal pages: keep category tabs under the unified bar */
html.asab-chrome-on header.top-bar {
  top: calc(var(--asab-chrome-h) + 14px);
  background: transparent;
  border: none;
  box-shadow: none;
  padding-top: 0.2rem;
}
html.asab-chrome-on header.top-bar > .btn-back,
html.asab-chrome-on header.top-bar > .lang-sel,
html.asab-chrome-on header.top-bar > a.btn-home {
  display: none !important;
}
html.asab-chrome-on .policy-section {
  padding-top: 8.4rem;
}

@media (max-width: 640px) {
  .asab-chrome {
    left: 8px;
    right: 8px;
    top: 8px;
    gap: 4px;
    padding: 0 6px;
  }
  .asab-chrome-btn { width: 38px; height: 38px; font-size: 1.18rem; }
  .asab-chrome-title { font-size: 0.86rem; }
}

@media (prefers-reduced-motion: reduce) {
  .asab-chrome-drawer { transition: none; }
}
