/* ==========================================================================
   LEFT DOCK PANELS (category navigation + filter)
   Off-canvas drawers anchored to the left, opened from the bottom bar. On
   desktop an open dock pushes the page content aside (a docked split, no
   grey-out); on mobile it overlays with the shared overlay. A grip bar on the
   right edge gives the slide affordance and collapses the dock when clicked.
   Only one dock is open at a time (enforced in JS).
   ========================================================================== */

:root {
  --left-panel-w: 360px;
}

/* --- The dock shell (shared by nav + filter) --- */
.left-dock {
  position: fixed;
  top: 0;
  bottom: var(--bottom-bar-h);
  left: 0;
  width: var(--left-panel-w);
  max-width: 86vw;
  background: #fff;
  z-index: 6000; /* above the bottom slide-panels (5000) */
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
  padding-right: 16px; /* reserve space for the grip bar */
}

  .left-dock.is-open {
    transform: translateX(0);
  }

/* Right-edge grip: the slide handle that collapses the dock. */
.left-dock-grip {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 16px;
  border: 0;
  border-left: 1px solid #e5e7eb;
  background: #f4f6f8;
  color: #9aa0ac;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

  .left-dock-grip:hover {
    background: #e9eef2;
    color: #729b3b;
  }

/* Generic scrollable body (used by the filter dock). */
.left-dock-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
}

/* --- Desktop: push the content aside rather than overlaying it --- */
@media (min-width: 992px) {
  .site-content {
    transition: margin-left 0.3s ease-in-out;
  }

  body.left-panel-open .site-content {
    margin-left: var(--left-panel-w);
  }

  /* The header is position:fixed, so it ignores the content margin; shift it
     by the same amount so the logo stays visible beside the dock. */
  .navbar {
    transition: left 0.3s ease-in-out;
  }

  body.left-panel-open .navbar {
    left: var(--left-panel-w);
  }
}

/* --- Shared header (nav + filter) --- */
.category-nav-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px;
  border-bottom: 1px solid #eee;
  flex: 0 0 auto;
}

.category-nav-title {
  flex: 1 1 auto;
  font-weight: 600;
  font-size: 18px;
  text-align: center;
}

.category-nav-back,
.category-nav-close {
  border: 0;
  background: transparent;
  font-size: 18px;
  color: #1a1a4d;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
}

  .category-nav-back[hidden] {
    visibility: hidden; /* keep layout stable when there is nothing to go back to */
  }

/* --- Navigation tree --- */
.category-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-node-row {
  display: flex;
  align-items: center;
}

.cat-node-link {
  flex: 1 1 auto;
  display: block;
  padding: 11px 10px;
  color: #1a1a4d;
  text-decoration: none;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.3;
}

  .cat-node-link:hover {
    background: #eff4f7;
  }

.cat-node.is-current > .cat-node-row > .cat-node-link {
  font-weight: 700;
  color: #729b3b;
}

.cat-node-toggle {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #8a8a99;
  padding: 11px 12px;
  cursor: pointer;
  line-height: 1;
}

  .cat-node-toggle:hover {
    color: #729b3b;
  }

/* --- Column drill-in --- */
.category-nav-viewport {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
}

.category-nav-root {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 8px;
}

/* Every child list is a full-size column that slides in from the right. */
.cat-children {
  display: block;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  background: #fff;
  padding: 8px;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

  .cat-children.is-col-active {
    transform: translateX(0);
  }
