/* Smart Web Nav EB — nav.css v4.1 */

:root {
  --swneb-accent:     #C8860A;
  --swneb-accent-rgb: 200,134,10;
  --swneb-bg:         #fff;
  --swneb-muted:      #999;
  --swneb-text:       #201c1b;
  --swneb-border:     rgba(0,0,0,.07);
  --swneb-h:          70px;
  --swneb-z:          99990;
  --swneb-ease:       .2s cubic-bezier(.4,0,.2,1);
}

#swneb-bar,
#swneb-panel,
#swneb-backdrop { display: none !important; }

@media (max-width: 768px) {

/* ══ NAV BAR ══ */
#swneb-bar {
  display:         flex !important;
  align-items:     center;
  justify-content: space-around;
  position:        fixed;
  bottom:0; left:0; right:0;
  height:          var(--swneb-h);
  background:      var(--swneb-bg);
  border-top:      1px solid var(--swneb-border);
  box-shadow:      0 -4px 24px rgba(0,0,0,.10);
  z-index:         var(--swneb-z);
  padding:         0 4px env(safe-area-inset-bottom, 0);
}
body { padding-bottom: calc(var(--swneb-h) + env(safe-area-inset-bottom,0)) !important; }

.swneb-item {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             3px;
  flex:            1;
  min-width:       0;
  padding:         6px 2px;
  text-decoration: none;
  color:           var(--swneb-muted);
  background:      none;
  border:          none;
  cursor:          pointer;
  -webkit-tap-highlight-color: transparent;
  outline:         none;
  font-family:     -apple-system,'Plus Jakarta Sans',sans-serif;
  position:        relative;
  transition:      color var(--swneb-ease), transform var(--swneb-ease);
}
.swneb-item:not(.swneb-centre):hover  { color: var(--swneb-accent); transform: translateY(-4px); }
.swneb-item:not(.swneb-centre):active { transform: translateY(-1px) scale(.92); }
.swneb-item.swneb-active              { color: var(--swneb-accent); }
.swneb-item.swneb-active::after {
  content:''; position:absolute; bottom:0; left:50%;
  transform:translateX(-50%); width:20px; height:3px;
  background:var(--swneb-accent); border-radius:2px 2px 0 0;
}
.swneb-centre::after,
.swneb-centre.swneb-active::after { display:none !important; }
.swneb-item:focus-visible { outline:2px solid var(--swneb-accent); border-radius:8px; }

.swneb-icon-wrap {
  position:relative; display:flex;
  align-items:center; justify-content:center;
  width:26px; height:26px;
}
.swneb-label {
  font-size:10px; font-weight:600; letter-spacing:.2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  max-width:64px; display:flex; flex-direction:column;
  align-items:center; gap:1px; line-height:1.2; color:inherit;
}

/* ══ CENTRE BUTTON ══ */
.swneb-centre {
  flex:0 0 56px; width:56px; height:56px;
  border-radius:18px; background:var(--swneb-accent);
  color:#fff !important;
  box-shadow:0 6px 20px rgba(var(--swneb-accent-rgb),.50);
  margin-top:-18px; padding:0; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  -webkit-tap-highlight-color:transparent; position:relative; z-index:2;
  transition:transform var(--swneb-ease), box-shadow var(--swneb-ease);
}
.swneb-centre:hover  { transform:translateY(-5px) scale(1.07); box-shadow:0 10px 28px rgba(var(--swneb-accent-rgb),.60); }
.swneb-centre:active { transform:translateY(-2px) scale(.93); box-shadow:0 2px 10px rgba(var(--swneb-accent-rgb),.35); }
.swneb-centre svg    { stroke:#fff !important; fill:none; transition:transform .28s ease; }
.swneb-centre.swneb-open svg { transform:rotate(180deg); }

/* ══ BADGE ══ */
.swneb-badge {
  position:absolute; top:-5px; right:-6px;
  background:var(--swneb-accent); color:#fff;
  font-size:9px; font-weight:700; min-width:16px; height:16px;
  border-radius:8px; display:flex; align-items:center;
  justify-content:center; padding:0 4px; border:2px solid #fff;
  line-height:1; animation:swneb-pop .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes swneb-pop { 0%{transform:scale(0);opacity:0} 100%{transform:scale(1);opacity:1} }
.swneb-cart-total { font-size:9px; font-weight:700; color:var(--swneb-accent); display:block; line-height:1; }
.swneb-avatar { width:26px; height:26px; border-radius:50%; object-fit:cover; border:2px solid var(--swneb-accent); display:block; }

/* ══ BACKDROP ══ */
#swneb-backdrop {
  display:block !important; position:fixed; inset:0;
  background:rgba(0,0,0,.52); z-index:calc(var(--swneb-z)+1);
  opacity:0; pointer-events:none; transition:opacity .28s ease;
}
#swneb-backdrop.swneb-bd-show { opacity:1; pointer-events:auto; }

/* ══ SIDE PANEL ══ */
#swneb-panel {
  display:flex !important; position:fixed;
  top:0; left:0; bottom:0;
  width:82vw; max-width:320px;
  z-index:calc(var(--swneb-z)+2);
  background:var(--swneb-bg); flex-direction:column;
  border-radius:0 20px 20px 0;
  box-shadow:4px 0 30px rgba(0,0,0,.18);
  transform:translateX(-100%); opacity:0; pointer-events:none;
  overflow:hidden;
  transition:transform .32s cubic-bezier(.4,0,.2,1), opacity .25s ease;
}
#swneb-panel.swneb-panel-open { transform:translateX(0); opacity:1; pointer-events:auto; }

/* ── Header ── */
.swneb-panel-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 18px 16px; flex-shrink:0;
  background:var(--swneb-accent);
}
.swneb-panel-title { font-size:16px; font-weight:700; color:#fff; font-family:-apple-system,'Plus Jakarta Sans',sans-serif; }

/* ── CLOSE BUTTON — explicit white color + visible SVG ── */
.swneb-panel-close {
  width:34px; height:34px; border-radius:50%;
  background:rgba(255,255,255,.22);
  border:none; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  color:#fff;                            /* ensures currentColor = white */
  -webkit-tap-highlight-color:transparent;
  transition:background var(--swneb-ease), transform var(--swneb-ease);
}
.swneb-panel-close svg { stroke:#fff; display:block; }  /* explicit stroke white */
.swneb-panel-close:hover { background:rgba(255,255,255,.40); transform:rotate(90deg); }
.swneb-panel-close:active { background:rgba(255,255,255,.55); }

/* ── List ── */
.swneb-panel-list { flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:4px 0; }

/* ══ CATEGORY ROW ══ */
.swneb-cat-row {
  border-bottom:1px solid rgba(0,0,0,.05);
}
.swneb-cat-row:last-child { border-bottom:none; }

/*
  Layout for rows WITH children:
  ┌─────────────────────────┬────────┐
  │  .swneb-cat-link (flex:1)│ toggle │
  ├─────────────────────────┴────────┤
  │  .swneb-sub-list (full width)    │
  └──────────────────────────────────┘
  Use CSS grid so sub-list spans both columns cleanly.
*/
.swneb-cat-row.has-children {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
}
.swneb-cat-row.has-children .swneb-cat-link {
  grid-column: 1;
  grid-row:    1;
}
.swneb-cat-row.has-children .swneb-sub-toggle {
  grid-column: 2;
  grid-row:    1;
}
.swneb-cat-row.has-children .swneb-sub-list {
  grid-column: 1 / -1;   /* span all columns */
  grid-row:    2;
}

/* ── Top-level link ── */
.swneb-cat-link {
  display:flex; align-items:center; gap:14px;
  padding:13px 18px; text-decoration:none;
  color:var(--swneb-text); position:relative;
  transition:background var(--swneb-ease), padding-left var(--swneb-ease);
  -webkit-tap-highlight-color:transparent;
}
.swneb-cat-link:hover  { background:rgba(var(--swneb-accent-rgb),.06); padding-left:22px; }
.swneb-cat-link:active { background:rgba(var(--swneb-accent-rgb),.12); }
.swneb-cat-link::before {
  content:''; position:absolute; left:0; top:15%; bottom:15%;
  width:0; background:var(--swneb-accent); border-radius:0 3px 3px 0;
  transition:width var(--swneb-ease);
}
.swneb-cat-link:hover::before { width:3px; }

/* Icon box */
.swneb-cat-icon-wrap {
  width:42px; height:42px; border-radius:12px;
  background:rgba(var(--swneb-accent-rgb),.09);
  display:flex; align-items:center; justify-content:center;
  color:var(--swneb-accent); overflow:hidden; flex-shrink:0;
  transition:background var(--swneb-ease);
}
.swneb-cat-link:hover .swneb-cat-icon-wrap { background:rgba(var(--swneb-accent-rgb),.18); }
.swneb-cat-icon-wrap img { width:100%; height:100%; object-fit:cover; }

.swneb-cat-meta  { flex:1; min-width:0; }
.swneb-cat-name  { font-size:13px; font-weight:600; color:var(--swneb-text); display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.swneb-cat-count { font-size:11px; color:var(--swneb-muted); display:block; margin-top:1px; }

.swneb-cat-arrow { color:#ccc; flex-shrink:0; transition:transform var(--swneb-ease),color var(--swneb-ease); }
.swneb-cat-link:hover .swneb-cat-arrow { transform:translateX(3px); color:var(--swneb-accent); }

/* ── TOGGLE BUTTON (chevron, outside <a>) ── */
.swneb-sub-toggle {
  display:flex; align-items:center; justify-content:center;
  width:48px; height:100%;          /* fill grid cell height */
  min-height:52px;
  background:none; border:none; cursor:pointer;
  color:#bbb; flex-shrink:0;
  -webkit-tap-highlight-color:transparent;
  padding:0 14px 0 0;
  transition:color var(--swneb-ease), background var(--swneb-ease);
}
.swneb-sub-toggle:hover  { color:var(--swneb-accent); background:rgba(var(--swneb-accent-rgb),.04); }
.swneb-sub-toggle:active { background:rgba(var(--swneb-accent-rgb),.10); }
.swneb-sub-toggle svg { pointer-events:none; stroke:currentColor; transition:transform .25s ease; }
/* Rotate chevron when open */
.swneb-sub-toggle[aria-expanded="true"] svg  { transform:rotate(180deg); }
.swneb-sub-toggle[aria-expanded="true"]      { color:var(--swneb-accent); }

/* ══ SUBMENU ══ */
.swneb-sub-list {
  display:none; width:100%;
  background:rgba(var(--swneb-accent-rgb),.03);
  border-top:1px solid rgba(var(--swneb-accent-rgb),.07);
}
.swneb-sub-list.open { display:block; }

.swneb-sub-row {
  display:flex; align-items:center; gap:12px;
  padding:12px 18px 12px 30px;
  text-decoration:none;
  font-size:13px;                /* same size as parent */
  font-weight:500;
  color:var(--swneb-text);
  border-bottom:1px solid rgba(0,0,0,.04);
  transition:background var(--swneb-ease), padding-left var(--swneb-ease);
  -webkit-tap-highlight-color:transparent;
}
.swneb-sub-row:last-child { border-bottom:none; }
.swneb-sub-row:hover  { background:rgba(var(--swneb-accent-rgb),.07); padding-left:36px; }
.swneb-sub-row:active { background:rgba(var(--swneb-accent-rgb),.13); }

.swneb-sub-dot {
  width:6px; height:6px; border-radius:50%;
  background:var(--swneb-accent); flex-shrink:0; opacity:.55;
  transition:opacity var(--swneb-ease), transform var(--swneb-ease);
}
.swneb-sub-row:hover .swneb-sub-dot { opacity:1; transform:scale(1.3); }
.swneb-sub-name  { flex:1; }
.swneb-sub-count { font-size:11px; color:var(--swneb-muted); }

/* ══ EMPTY ══ */
.swneb-cat-empty { padding:32px 20px; text-align:center; color:var(--swneb-muted); font-size:13px; line-height:1.7; }
.swneb-cat-empty strong { color:var(--swneb-text); }

} /* end @media */

/* ══ NESTED DEPTH STYLES (depth > 0) ══ */

/* depth-1: child rows — indented, smaller icon */
.swneb-depth-1 .swneb-cat-link {
  padding: 11px 18px 11px 24px;
  font-size: 13px;
}
.swneb-depth-1.has-children {
  background: rgba(var(--swneb-accent-rgb), .02);
}

/* depth-2: grandchild rows — more indent */
.swneb-depth-2 .swneb-cat-link {
  padding: 10px 18px 10px 36px;
  font-size: 12px;
}

/* depth-1 and beyond: show bullet dot instead of icon box */
[data-depth] .swneb-cat-meta {
  padding-left: 0;
}

/* ══ PANEL POSITION FIX ══
   WordPress admin bar pushes content down 32px (desktop) / 46px (mobile).
   We use top:0 with !important so the panel always starts at
   the very top of the viewport, ignoring any theme/admin offsets.
*/
#swneb-panel {
  top: 0 !important;
}

/* Also ensure backdrop covers from true top */
#swneb-backdrop {
  top: 0 !important;
}
