/* ============================================================
   Builders24 — Shared Header + Navigation
   Rewritten to match the markup emitted by header.js exactly.
   (Previous version of this file used an unrelated .b24-* naming
   scheme that no longer matched the JS output — header.js is the
   source of truth going forward.)
   ============================================================ */

/* ---------- Reset for header scope ---------- */
.app-header * { box-sizing: border-box; }
.app-header a { text-decoration: none; color: inherit; }
.app-header button { font-family: 'Space Grotesk', sans-serif; }

/* ---------- Main header shell ---------- */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(13,27,62,0.08);
  font-family: 'Space Grotesk', sans-serif;
}

/* ---------- Utility bar (top strip) ---------- */
.util-bar { background: #0D1B3E; }
.util-bar-inner {
  display: flex; align-items: center; gap: 18px;
  max-width: 1400px; margin: 0 auto;
  padding: 9px 20px;
  overflow-x: auto; scrollbar-width: none;
}
.util-bar-inner::-webkit-scrollbar { display: none; }
.util-deliver {
  display: flex; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer;
  color: #C9D3E8; font-size: 12.5px; font-weight: 500;
  padding: 4px 6px; border-radius: 7px; flex: none;
  white-space: nowrap; transition: background .15s;
}
.util-deliver:hover { background: #16274F; }
.util-deliver svg { flex: none; }
.util-deliver strong { color: #ffffff; font-weight: 700; }

.util-mid {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #8FA0C7; white-space: nowrap;
  flex: 1; justify-content: center;
}

.util-right {
  display: flex; align-items: center; gap: 12px; flex: none;
}
.util-right > a {
  font-size: 12.5px; font-weight: 600; color: #C9D3E8;
  white-space: nowrap; transition: color .15s;
}
.util-right > a:hover { color: #F0A500; }
.util-div { width: 1px; height: 14px; background: #1E325A; flex: none; }

/* Account / profile menu (in utility bar) */
.profile-menu-wrap { position: relative; }
.profile-avatar-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer; padding: 4px 4px 4px 4px;
}
.profile-avatar-inner {
  width: 28px; height: 28px; border-radius: 50%;
  background: #16274F; border: 2px solid #F0A500;
  color: #F0A500; font-weight: 700; font-size: 12.5px;
  display: grid; place-items: center; overflow: hidden; flex: none;
}
.profile-avatar-inner.guest {
  border-color: rgba(255,255,255,0.35);
}
.profile-avatar-inner img { width: 100%; height: 100%; object-fit: cover; }
.util-login-text { font-size: 12.5px; font-weight: 600; color: #C9D3E8; white-space: nowrap; }

.profile-dropdown {
  /* position:fixed (not absolute) — util-bar-inner has overflow-x:auto,
     which forces overflow-y to clip too, cutting this off before it was
     fixed. Real screen coordinates are set from JS on open (see
     header.js), same fix already used for .menu-dropdown. */
  display: none; position: fixed; top: 0; right: 0;
  background: #ffffff; border: 1px solid #E3E8F0; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(13,27,62,0.16); min-width: 210px;
  padding: 8px 0; z-index: 999;
}
.profile-dropdown.open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13.5px; font-weight: 500;
  color: #0D1B3E; background: none; border: none; width: 100%;
  text-align: left; cursor: pointer; font-family: 'Space Grotesk', sans-serif;
  transition: background .15s;
}
.dropdown-item:hover { background: #F3F5F9; }

/* ---------- Main head row (logo / search / icons) ---------- */
.head-row { border-bottom: 1px solid #EEF1F7; }
.head-row-inner {
  display: flex; align-items: center; gap: 24px;
  max-width: 1400px; margin: 0 auto; padding: 14px 20px;
}

/* Logo */
.logo { display: flex; flex-direction: column; flex: none; }
.logo-text {
  font-weight: 700; font-size: 24px; letter-spacing: -0.02em;
  line-height: 1; color: #0D1B3E;
}
.logo-text .orange { color: #F0A500; }
.logo-text sup { font-size: 11px; }
.logo-tagline {
  font-size: 9.5px; font-weight: 600; color: #5B6A8C;
  margin-top: 3px; letter-spacing: 0.02em; white-space: nowrap;
}

/* Search */
.search-bar {
  flex: 1; display: flex; align-items: center; gap: 10px;
  border: 2px solid #0D1B3E; border-radius: 12px;
  padding: 0 14px; height: 44px; background: #ffffff;
  transition: border-color .18s;
}
.search-bar:focus-within { border-color: #F0A500; }
.search-bar input {
  flex: 1; height: 100%; border: none; outline: none;
  font-family: 'Space Grotesk', sans-serif; font-size: 14.5px;
  color: #0D1B3E; background: transparent; padding: 0;
}
.search-bar input::placeholder { color: #8A96B0; }
.head-search-btn {
  width: 38px; height: 34px; margin-right: -6px;
  background: #0D1B3E; border: none; border-radius: 9px;
  display: grid; place-items: center; cursor: pointer; flex: none;
  transition: background .18s;
}
.head-search-btn:hover { background: #F0A500; }

/* Right-side icon group */
.head-icons { display: flex; align-items: center; gap: 4px; flex: none; }
.head-icon-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  transition: background .15s; position: relative;
}
.head-icon-item:hover { background: #F3F5F9; }
.head-icon-item span { font-size: 10.5px; font-weight: 600; color: #5B6A8C; white-space: nowrap; }
.cart-badge-count {
  position: absolute; top: 2px; right: 6px;
  min-width: 17px; height: 17px; border-radius: 999px;
  background: #F0A500; color: #0D1B3E; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; padding: 0 3px;
}

.currency-badge {
  display: flex; align-items: center; gap: 6px;
  background: #0D1B3E; border: none; border-radius: 10px;
  padding: 9px 12px; cursor: pointer; color: #ffffff;
  font-size: 12.5px; font-weight: 700; transition: background .15s;
}
.currency-badge:hover { background: #16274F; }

/* ---------- Category / service nav row ---------- */
.head-nav {
  border-bottom: 1px solid #EEF1F7;
  max-width: 1400px; margin: 0 auto;
}
.head-nav-inner { padding: 0 20px; }
.head-nav-inner > a {
  padding: 12px 4px; font-size: 13px; font-weight: 600; color: #0D1B3E;
  border-bottom: 2.5px solid transparent; transition: color .15s, border-color .15s;
}
.head-nav-inner > a:hover { color: #F0A500; border-color: #F0A500; }

.menu-btn-wrap { display: flex; align-items: center; }
.shop-all-btn {
  display: flex; align-items: center; gap: 8px;
  background: #0D1B3E; color: #ffffff; border: none; border-radius: 9px;
  padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background .15s;
}
.shop-all-btn:hover { background: #16274F; }

/* ---------- "Menu" mega dropdown (appended to body, positioned via JS) ---------- */
.menu-dropdown a:hover { background: #FDF1D7; color: #B97A00; border-radius: 6px; }

/* ---------- Location / currency modal ---------- */
.b24loc-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(13,27,62,0.55); backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
}
.b24loc-overlay.open { display: flex; }
.b24loc-sheet {
  background: #ffffff; border-radius: 16px; width: 420px;
  max-width: calc(100vw - 32px); max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(13,27,62,0.25);
}
.b24loc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid #EEF1F7;
}
.b24loc-head h3 { font-size: 16px; font-weight: 700; color: #0D1B3E; margin: 0; }
.b24loc-close {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: #0D1220; display: grid; place-items: center; border-radius: 8px;
}
.b24loc-close:hover { background: #F3F5F9; }
.b24loc-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.loc-search {
  width: 100%; height: 42px; border: 1.5px solid #E3E8F0; border-radius: 10px;
  padding: 0 14px; font-family: 'Space Grotesk', sans-serif; font-size: 13.5px;
  color: #0D1B3E; margin-bottom: 10px; outline: none;
}
.loc-search:focus { border-color: #0D1B3E; }
.loc-list { display: flex; flex-direction: column; gap: 4px; }
.loc-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  transition: background .15s;
}
.loc-item:hover { background: #F3F5F9; }
.loc-item.selected { background: #FDF1D7; }
.loc-item-name { font-size: 13.5px; font-weight: 600; color: #0D1B3E; }
.loc-item-country { font-size: 12px; color: #8A96B0; margin-top: 1px; }
.loc-check {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #E3E8F0; flex: none;
}
.loc-item.selected .loc-check { background: #F0A500; border-color: #F0A500; }
.currency-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.currency-chip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1.5px solid #E3E8F0; border-radius: 10px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.currency-chip:hover { background: #F3F5F9; }
.currency-chip.selected { border-color: #F0A500; background: #FDF1D7; }
.currency-chip .code { font-size: 13px; font-weight: 700; color: #0D1B3E; }
.currency-chip .sym { font-size: 12px; color: #8A96B0; }
.currency-note { font-size: 11.5px; color: #8A96B0; margin-top: 12px; }
.b24loc-foot { padding: 14px 20px; border-top: 1px solid #EEF1F7; }
.b24loc-apply-btn {
  width: 100%; height: 44px; background: #0D1B3E; color: #ffffff;
  border: none; border-radius: 10px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.b24loc-apply-btn:hover { background: #16274F; }

/* ---------- Footer (classes already match header.js output) ---------- */
.b24-footer {
  background: #0D1B3E; color: #C9D3E8; font-family: 'Space Grotesk', sans-serif;
  padding: 40px 20px 24px; margin-top: 40px;
}
.b24-footer-inner { max-width: 1400px; margin: 0 auto; }
.b24-footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px;
}
.b24-footer-brand .wm { font-size: 22px; font-weight: 700; color: #ffffff; margin-bottom: 8px; }
.b24-footer-brand .wm span { color: #F0A500; }
.b24-footer-brand p { font-size: 13px; color: #8FA0C7; line-height: 1.6; max-width: 280px; }
.b24-footer-col h4 {
  font-size: 13px; font-weight: 700; color: #ffffff; margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: .05em;
}
.b24-footer-col a { display: block; font-size: 13px; color: #8FA0C7; margin-bottom: 9px; transition: color .15s; }
.b24-footer-col a:hover { color: #F0A500; }
.b24-footer-bottom {
  border-top: 1px solid #1E325A; padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.b24-footer-bottom p { font-size: 12.5px; color: #5B6A8C; }
.b24-footer-bottom .social { display: flex; gap: 10px; }
.b24-footer-bottom .social a {
  width: 34px; height: 34px; border-radius: 9px; background: #16274F;
  color: #C9D3E8; display: grid; place-items: center; transition: background .15s, color .15s;
}
.b24-footer-bottom .social a:hover { background: #F0A500; color: #0D1B3E; }
.b24-footer-bottom .social svg { width: 16px; height: 16px; }

/* ---------- Mobile hamburger + slide-in sidebar (buildMobileSidebar) ---------- */
/* Distinct from the desktop "Menu" mega-dropdown (.shop-all-btn/.menu-dropdown) —
   this is the true off-canvas drawer opened by #mobileBurgerBtn, shown only at
   narrower widths (see responsive block below). */
.b24-burger {
  display: none; background: none; border: none; color: #0D1B3E;
  cursor: pointer; padding: 6px; flex: none; margin-right: 4px;
}
.b24-burger svg { width: 24px; height: 24px; }

.b24-sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(13,27,62,0.55); backdrop-filter: blur(2px);
}
.b24-sidebar-overlay.show { display: block; }

.b24-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 290px; z-index: 301;
  background: #ffffff; display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.22,.9,.3,1);
}
.b24-sidebar.open { transform: none; }

.b24-sidebar-head {
  background: #0D1B3E; padding: 18px 18px 16px;
  display: flex; align-items: center; justify-content: space-between; flex: none;
}
.b24-sidebar-head .wm { font-size: 22px; font-weight: 700; color: #ffffff; }
.b24-sidebar-head .wm span { color: #F0A500; }
.b24-sidebar-close { background: none; border: none; color: #ffffff; cursor: pointer; padding: 4px; }
.b24-sidebar-close svg { width: 22px; height: 22px; }

.b24-sidebar-body { flex: 1; overflow-y: auto; padding: 10px 0; }
.b24-sidebar-body::-webkit-scrollbar { width: 4px; }
.b24-sidebar-body::-webkit-scrollbar-thumb { background: #E3E8F0; border-radius: 4px; }

.b24-sb-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #8A96B0; padding: 14px 18px 6px;
}
.b24-sb-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 18px;
  font-size: 13.5px; font-weight: 500; color: #0D1B3E;
  transition: background .15s;
}
.b24-sb-item:hover { background: #F3F5F9; }
.b24-sb-item svg { width: 18px; height: 18px; color: #5B6A8C; flex: none; }
.b24-sb-item.gold { color: #B97A00; }
.b24-sb-item.gold svg { color: #F0A500; }
.b24-sb-div { height: 1px; background: #EEF1F7; margin: 8px 0; }

.b24-sidebar-foot { padding: 14px 18px; border-top: 1px solid #EEF1F7; flex: none; }
.b24-sb-signout {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: #FBE7E7; border-radius: 11px; color: #D64535;
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  width: 100%; font-family: 'Space Grotesk', sans-serif;
}
.b24-sb-signout svg { width: 18px; height: 18px; }

/* ---------- Bottom nav (mobile) vs footer (desktop) toggle ---------- */
/* NOTE: renderBottomNav()'s own markup/CSS lives outside this file (b24app.js).
   This just controls which wrapper is visible at which width, per the
   footerMode logic in header.js ("nav on mobile/app widths, full footer
   on desktop/PC"). If renderBottomNav's container is a fixed-position bar,
   confirm its real height so body padding below can be set precisely —
   64px is a placeholder here. */
.desktop-footer-wrap { display: block; }
.mobile-nav-wrap { display: none; }
body.has-bottom-nav { padding-bottom: 64px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .util-mid { display: none; }
  .head-row-inner { padding: 10px 14px; gap: 12px; }
  .util-bar-inner { padding: 8px 14px; gap: 10px; }
  .logo-tagline { display: none; }
  .b24-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .b24-footer-brand { grid-column: 1 / -1; }
  .desktop-footer-wrap { display: none; }
  .mobile-nav-wrap { display: block; }
  /* Menu stays in the nav row at every width — burger-next-to-logo pattern removed */
  .b24-burger { display: none; }
  .menu-btn-wrap { display: flex; }
}

@media (max-width: 560px) {
  .b24-footer-grid { grid-template-columns: 1fr; }
  .search-bar { border-radius: 10px; }
}
