/* ═══════════════════════════════════════════════════════════
   The Loop — site navigation
   3 levels: nav-link → .sub-menu → .sub-menu-l2 (fly-out)
   ═══════════════════════════════════════════════════════════ */

:root {
  --nav-h: 56px;
  --nav-ink: #2c2b28;
  --nav-ink-soft: #76756f;
  --nav-rule: #e4e1db;
  --nav-surface: #faf9f7;
  --nav-hover: #f2f0ec;
  --nav-accent: #2c2b28;
  --nav-radius: 6px;
  --nav-shadow: 0 1px 2px rgba(20, 20, 26, .06), 0 12px 28px -12px rgba(20, 20, 26, .18);
  --nav-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-serif: 'Lora', Georgia, serif;
}

/* ─── shell ─── */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 100; /* needed so the bar + dropdowns sit above page content while sliding */
  background: var(--nav-surface);
  border-bottom: 1px solid var(--nav-rule);
  font-family: var(--nav-font);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

/* hide-on-scroll — class toggled by nav-scroll.js */
/* #site-nav.nav--hidden {
  transform: translateY(-100%);
} */

/* keep the header below the WP admin bar when logged in */
.admin-bar #site-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar #site-nav { top: 46px; } }
@media (max-width: 600px) { .admin-bar #site-nav { top: 0; } }

.nav-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  position: relative;
}

/* mobile-only group (hamburger) — hidden on desktop */
.nav-mob-left { display: none; }
/* mobile search lives in .nav-right, shown ≤900px only.
   #site-nav prefix needed — .nav-search-btn (display:grid) is declared later and would win */
#site-nav .nav-search-btn--mob { display: none; }

/* ─── logo ─── */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  z-index: 1;
}
.nav-logo img {
  display: block;
  height: 32px;
  width: auto;
}

/* ─── list resets ─── */
.nav-links,
.nav-menu-list,
.sub-menu,
.sub-menu-l2 {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-menu-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
  list-style: none;
}

/* ─── level 0 ─── */
.nav-link,
#site-nav .nav-link,
#site-nav .nav-menu-list a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: var(--nav-radius);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--nav-ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}

.nav-link:hover,
#site-nav .nav-link:hover,
#site-nav .nav-menu-list a:hover,
.nav-item:focus-within > .nav-link {
  color: var(--nav-ink);
  background: var(--nav-hover);
}

.nav-link.active {
  color: var(--nav-ink);
  font-weight: 600;
}

.nav-link-caret {
  flex-shrink: 0;
  opacity: .5;
  transition: transform .18s ease;
}

.has-dropdown:hover > .nav-link .nav-link-caret,
.has-dropdown.is-open > .nav-link .nav-link-caret {
  transform: rotate(180deg);
}

/* ─── level 1 panel ─── */
.sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 228px;
  padding: 6px;
  background: var(--nav-surface);
  border: 1px solid var(--nav-rule);
  border-radius: 8px;
  box-shadow: var(--nav-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;
}

.has-dropdown:hover > .sub-menu,
.has-dropdown:focus-within > .sub-menu,
.has-dropdown.is-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sub-item {
  position: relative;
  list-style: none;
}

.sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 450;
  color: var(--nav-ink-soft);
  text-decoration: none;
  transition: color .12s ease, background-color .12s ease;
}

.sub-link:hover,
.sub-item:focus-within > .sub-link {
  color: var(--nav-ink);
  background: var(--nav-hover);
}

.sub-caret {
  flex-shrink: 0;
  opacity: .45;
}

/* ─── level 2 fly-out ─── */
.sub-menu-l2 {
  position: absolute;
  top: -7px;
  left: calc(100% + 5px);
  min-width: 206px;
  padding: 6px;
  background: var(--nav-surface);
  border: 1px solid var(--nav-rule);
  border-radius: 8px;
  box-shadow: var(--nav-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.has-flyout:hover > .sub-menu-l2,
.has-flyout:focus-within > .sub-menu-l2,
.has-flyout.is-open > .sub-menu-l2 {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.sub-item.flip-left > .sub-menu-l2 {
  left: auto;
  right: calc(100% + 5px);
  transform: translateX(4px);
}

.sub-item.flip-left.is-open > .sub-menu-l2,
.sub-item.flip-left:hover > .sub-menu-l2 {
  transform: translateX(0);
}

.sub-item-l2 { list-style: none; }

.sub-link-l2 {
  display: block;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13.5px;
  color: var(--nav-ink-soft);
  text-decoration: none;
  transition: color .12s ease, background-color .12s ease;
}

.sub-link-l2:hover {
  color: var(--nav-ink);
  background: var(--nav-hover);
}

/* ─── right-side actions ─── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  z-index: 1;
}

.nav-search-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--nav-radius);
  background: transparent;
  color: var(--nav-ink-soft);
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}

.nav-search-btn:hover {
  color: var(--nav-ink);
  background: var(--nav-hover);
}

.nav-ghost {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--nav-radius);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--nav-ink-soft);
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}

.nav-ghost:hover {
  color: var(--nav-ink);
  background: var(--nav-hover);
}

.nav-cta {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border: 0;
  border-radius: var(--nav-radius);
  background: var(--nav-accent);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s ease;
}

.nav-cta:hover { opacity: .84; }

/* ─── keyboard focus ─── */
#site-nav a:focus-visible,
#site-nav button:focus-visible {
  outline: 2px solid var(--nav-ink);
  outline-offset: 2px;
}

/* ─── hamburger ─── */
.nav-ham {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--nav-radius);
  background: transparent;
  cursor: pointer;
}

.nav-ham span {
  display: block;
  height: 1.5px;
  background: var(--nav-ink);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* 1.5px line + 5px gap = 6.5px travel to the middle line */
.nav-ham[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-ham[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-ham[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════════
   MOBILE DRAWER
   Text aligns with the hamburger lines (20px).
   Level 0  → 16px ink, full-width rule between items
   Level 1+ → indented 14px behind a thin guide line, softer + smaller
   Utility (cart…) and CTA sit in their own block below the menu.
   #site-nav prefix beats theme/global ul, li, a resets.
   ═══════════════════════════════════════════════════════════ */
.nav-mobile {
  display: none;
  background: var(--nav-surface);
  border-top: 1px solid var(--nav-rule);
  max-height: calc(100dvh - var(--nav-h));
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-mobile.is-open { display: block; }

#site-nav .nav-mobile {
  padding: 4px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}
#site-nav .nav-mobile,
#site-nav .nav-mobile *,
#site-nav .nav-mobile *::before,
#site-nav .nav-mobile *::after { box-sizing: border-box; }

#site-nav .nav-mobile ul,
#site-nav .nav-mobile li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* row = link + optional toggle */
#site-nav .nav-mobile .mob-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* shared link reset */
#site-nav .nav-mobile-list a {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  text-decoration: none;
  line-height: 1.3;
}

/* ─ level 0 ─ */
#site-nav .nav-mobile-list > li {
  border-bottom: 1px solid var(--nav-rule);
}
#site-nav .nav-mobile-list > li > a,
#site-nav .nav-mobile-list > li > .mob-item-row > a {
  min-height: 52px;
  font-size: 16px;
  font-weight: 500;
  color: var(--nav-ink);
}

/* ─ level 1+ : indented behind a guide line ─ */
#site-nav .nav-mobile-list li ul {
  margin: 0 0 14px 2px;
  padding-left: 14px;
  border-left: 1.5px solid var(--nav-rule);
}
#site-nav .nav-mobile-list li li ul { margin-bottom: 6px; }

#site-nav .nav-mobile-list li li > a,
#site-nav .nav-mobile-list li li > .mob-item-row > a {
  min-height: 40px;
  font-size: 15px;
  font-weight: 450;
  color: var(--nav-ink-soft);
}
#site-nav .nav-mobile-list li li li > a,
#site-nav .nav-mobile-list li li li > .mob-item-row > a { font-size: 14.5px; }

/* current page */
#site-nav .nav-mobile-list .current-menu-item > a,
#site-nav .nav-mobile-list .current-menu-item > .mob-item-row > a {
  color: var(--nav-ink);
  font-weight: 600;
}

/* expand / collapse toggle — no border of its own, icon flush right */
#site-nav .nav-mobile .mob-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: -10px;
  border: 0;
  border-radius: var(--nav-radius);
  background: transparent;
  color: var(--nav-ink-soft);
  cursor: pointer;
}
#site-nav .nav-mobile .mob-toggle:hover { background: var(--nav-hover); color: var(--nav-ink); }
.mob-toggle-icon { transition: transform .18s ease; }
.mob-toggle[aria-expanded="true"] .mob-toggle-icon { transform: rotate(45deg); }

/* ─ utility block (cart, etc.) — separated from the menu ─ */
#site-nav .nav-mobile-util {
  margin-top: 20px;
  padding: 4px 14px;
  background: var(--nav-hover);
  border-radius: 8px;
}
#site-nav .nav-mobile-util li + li { border-top: 1px solid var(--nav-rule); }
#site-nav .nav-mobile-util__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0;
  border: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: var(--nav-ink);
  text-decoration: none;
  margin-top: 12px !important;
  padding-left: 12px !important;
}
#site-nav .nav-mobile-util__link svg {
  display: block;
  flex-shrink: 0;
  color: var(--nav-ink-soft);
}
.nav-mobile-util__label { flex: 1; }
.nav-mobile-util__count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--nav-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

/* ─ CTA ─ */
#site-nav .nav-mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin: auto;
  margin-top: 12px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--nav-accent);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
/* no utility block above? keep the same gap from the menu */
#site-nav .nav-mobile-list + .nav-mobile-cta { margin-top: 24px; }

/* ═══════════════════════════════════════════════════════════
   MOBILE  —  [☰]      [ LOGO ]      [🔍 👤]
   Cart (and anything else) moves into the hamburger drawer.
   The 1fr/auto/1fr grid keeps the logo centred whatever the sides hold.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  .nav-wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* equal side columns = truly centred logo */
    align-items: center;
    gap: 0;
    padding: 0 12px;
  }

  /* left: hamburger only */
  .nav-mob-left {
    display: flex;
    align-items: center;
    justify-self: start;
  }
  .nav-ham { display: flex; }

  /* centre: logo */
  .nav-logo { justify-self: center; }

  /* desktop menu off */
  .nav-links { display: none; }

  /* right: search + account only */
  .nav-right {
    justify-self: end;
    gap: 2px;
    margin-left: 0;
  }
  #site-nav .nav-search-btn--desk,
  #site-nav .nav-right .nav-cta { display: none; }

  #site-nav .nav-right .nav-icon-btn,
  #site-nav .nav-right .nav-search-btn--mob,
  #site-nav .bcn-acct-nav__trigger {
    display: grid;
    place-items: center;
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: var(--nav-radius);
    background: transparent;
    color: var(--nav-ink);
  }
  #site-nav .nav-right svg { width: 19px; height: 19px; }

  /* cart moves into the drawer on mobile */
  #site-nav .nav-right .nav-icon-btn.theloop-cart-icon-btn { display: none; }

  /* logged-in account: icon only, no hover dropdown on touch (drawer has My Account) */
  #site-nav .bcn-acct-nav__label,
  #site-nav .bcn-acct-nav__chevron,
  #site-nav .bcn-acct-nav__dropdown { display: none !important; }


  /* logo never shrinks or drifts */
  .nav-logo { min-width: 0; }
  .nav-mob-left,
  .nav-right { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #site-nav,
  #site-nav *,
  #site-nav *::before,
  #site-nav *::after {
    transition-duration: .01ms !important;
  }
}

/* RAJ */
#site-nav .nav-links .nav-link.active {
  color: var(--nav-ink);
  background: var(--nav-hover);
}