/* 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-btn.is-signed {
  border-color: rgba(197, 160, 89, 0.6);
  color: #e8c86a;
}

.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-session { position: relative; }
.asab-chrome-session-pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 230px;
  padding: 8px;
  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: 4px;
}
.asab-chrome-session-pop.open { display: flex; }
.asab-chrome-session-kind {
  padding: 0.4rem 0.7rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--asab-chrome-muted);
  line-height: 1.4;
}
.asab-chrome-session-kind strong {
  display: block;
  color: var(--asab-chrome-gold);
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 2px;
}
.asab-chrome-session-pop a,
.asab-chrome-session-pop button.asab-chrome-session-act {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--asab-chrome-ink);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  text-align: start;
  text-decoration: none;
}
.asab-chrome-session-pop a:hover,
.asab-chrome-session-pop button.asab-chrome-session-act:hover {
  background: rgba(197, 160, 89, 0.18);
  color: #e8c86a;
}
.asab-chrome-session-pop a i,
.asab-chrome-session-pop button.asab-chrome-session-act i { font-size: 1.1rem; }

#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),
html.asab-chrome-on #top {
  display: none !important;
}
html.asab-chrome-storefront #shop-lang-selector { display: none !important; }
html.asab-chrome-storefront .asab-chrome #cart-btn.asab-chrome-cart,
html.asab-chrome-storefront .asab-chrome #cart-btn.asab-chrome-cart i,
html.asab-chrome-storefront .asab-chrome #cart-btn.asab-chrome-cart span:not(#cart-count) {
  color: #1a1408 !important;
  -webkit-text-fill-color: #1a1408 !important;
  text-shadow: none !important;
}
html.asab-chrome-storefront .asab-chrome #cart-btn.asab-chrome-cart {
  background: #c5a059 !important;
  border: 1px solid #e8c86a !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(197, 160, 89, 0.45) !important;
  min-height: 40px;
  width: 42px !important;
  height: 40px;
  padding: 0 !important;
}
html.asab-chrome-storefront .asab-chrome #cart-btn.asab-chrome-cart i {
  font-size: 1.35rem !important;
}
.asab-chrome-cart {
  position: relative;
  width: 42px !important;
  min-width: 42px;
  padding: 0 !important;
  gap: 0;
}
.asab-chrome-cart [data-i18n-shop="cart_btn"] { display: none; }
.asab-chrome-cart #cart-count {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #faf6ee !important;
  color: #1a1408 !important;
  -webkit-text-fill-color: #1a1408 !important;
  font-size: 0.68rem;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f0f10;
}

/* 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; }
}
