/* Urban Proto — shared header chrome.
 *
 * One file, loaded by the storefront and by every console, so the bar across the top
 * is the same object everywhere rather than a copy that drifts. It is the companion
 * to console.css: that file owns the sidebar, this one owns the header.
 *
 * It styles markup only — no colours of its own beyond the tokens each host already
 * defines (--nav-bg, --surface, --border, --text, --text2, --accent, --r-xs). A host
 * that wants the header without site navigation simply omits .nav-links; nothing here
 * assumes they are present.
 */

.nav {
  z-index: 100;
  height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 10px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  transition: background .3s;
}
/* The storefront header floats over a padded page; a console header scrolls with a
   column that has its own sidebar. Same bar, two containers. */
.nav { position: fixed; top: 0; left: 0; right: 0; }
/* Inside a console column the bar scrolls with the content and starts after the
   sidebar, so it is sticky rather than pinned across the viewport. */
.main > .nav { position: sticky; left: auto; right: auto; }


/* ── Brand ── */
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800; letter-spacing: -.03em;
  color: var(--text); text-decoration: none; flex: none;
}
.logo-icon, .auth-logo-icon {
  background: url(/logo-mark-on-dark.png) center/contain no-repeat;
}
[data-theme=light] .logo-icon,
[data-theme=light] .auth-logo-icon { background-image: url(/logo-mark-on-light.png); }
.logo-icon { width: 34px; height: 34px; flex-shrink: 0; }
.logo-text span { color: var(--accent); }

/* ── Section title, for hosts with no nav links ── */


/* ── Right-hand controls ── */
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text2); cursor: pointer; text-decoration: none;
  position: relative; flex: none; padding: 0;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
/* The avatar clips itself; clipping the button would cut the badge off. */
.icon-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Count badge on the cart. Positioned against .icon-btn, so it needs no host rules. */
.cart-n {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--accent); color: #04191c;
  font-size: 9.5px; font-weight: 800; line-height: 16px; text-align: center;
}

/* ── Account menu ── */
.pm[hidden] { display: none; }          /* an id or class rule that sets display would
                                           otherwise outrank the hidden attribute */
.pm {
  position: fixed; top: 64px; right: 20px; min-width: 236px; padding: 8px; z-index: 120;
  background: var(--card, var(--surface)); border: 1px solid var(--border);
  border-radius: var(--r, 16px); box-shadow: 0 18px 44px rgba(0,0,0,.34);
  backdrop-filter: blur(20px);
}
.pm-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
.pm-av {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #04191c; font-weight: 700;
}
.pm-av img { width: 100%; height: 100%; object-fit: cover; }
.pm-name { font-size: 13.5px; font-weight: 600; }
.pm-mail {
  font-size: 11px; color: var(--text3);
  overflow: hidden; text-overflow: ellipsis; max-width: 170px;
}
.pm-item {
  display: block; width: 100%; text-align: left; padding: 9px 11px;
  border: 0; background: none; border-radius: var(--r-sm, 10px);
  color: var(--text2); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none;
}
.pm-item:hover { background: var(--hover, rgba(120,200,200,.09)); color: var(--text); }
.pm-danger:hover { color: var(--red); }

@media (max-width: 860px) {
  .nav { padding: 0 14px; }
  .logo-text { display: none; }
}

/* ── Projects link ── */
.nav-projects{
  display:inline-flex; align-items:center; gap:6px; padding:6px 11px;
  border:1px solid var(--border); border-radius:8px; color:var(--text2);
  font-size:13px; text-decoration:none; white-space:nowrap;
  transition:border-color .15s,color .15s;
}
.nav-projects:hover{ border-color:var(--accent); color:var(--accent); }
.nav-projects svg{ flex:none; }
.nav-projects[aria-current="page"]{ border-color:var(--accent); color:var(--accent); }

/* ── Cart count ── */
.cart-badge{
  position:absolute; top:-5px; right:-5px;
  min-width:18px; height:18px; padding:0 5px; box-sizing:border-box;
  border-radius:99px; background:var(--accent); color:#04191c;
  font-size:10px; font-weight:800; line-height:18px; text-align:center;
  font-variant-numeric:tabular-nums;   /* two digits should not reflow the pill */
  border:2px solid var(--bg);          /* lifts it off whatever sits behind */
}
.cart-badge.hidden{ display:none; }

/* ── Hamburger ── */
.hamburger{
  display:none; flex-direction:column; justify-content:center; gap:4px;
  width:38px; height:38px; padding:0 9px; border:1px solid var(--border);
  border-radius:50%; background:var(--surface); cursor:pointer;
}
.hamburger span{ display:block; height:1.6px; background:var(--text2); border-radius:2px; }

@media (max-width: 860px){
  .hamburger{ display:flex; }
  .nav-projects span{ display:none; }
  .nav-projects{ padding:6px 9px; }
}
