/* RVTStore — навигация библиотеки */

.library-explorer {
  padding: 32px 0 80px;
}

.lib-popular-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.lib-popular-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--lib-muted, #666);
  margin-right: 4px;
}

.lib-popular-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--lib-border, #e8e8e8);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.lib-popular-chip:hover {
  border-color: #111;
  transform: scale(1.02);
}

.library-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.library-nav {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 4px 0;
}

.lib-nav-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lib-muted, #666);
  padding: 0 12px 12px;
}

.lib-nav-group {
  margin-bottom: 2px;
}

.lib-nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #111;
  transition: background 160ms ease;
  position: relative;
}

.lib-nav-row:hover {
  background: #f5f5f5;
}

.lib-nav-row.is-active {
  background: var(--lib-green-soft, #eef4ef);
  font-weight: 600;
}

.lib-nav-row.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--lib-green, #386e44);
}

.lib-nav-row--child {
  padding-left: 36px;
  font-size: 13px;
  font-weight: 400;
}

.lib-nav-row-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.lib-nav-chevron-btn {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px 0 0 8px;
  transition: background 160ms ease;
}

.lib-nav-chevron-btn:hover {
  background: #f0f0f0;
}

.lib-nav-chevron-spacer {
  flex: 0 0 32px;
}

.lib-nav-row-wrap .lib-nav-row--parent {
  flex: 1;
  min-width: 0;
  border-radius: 0 8px 8px 0;
}

.lib-nav-chevron {
  flex: 0 0 14px;
  font-size: 10px;
  color: var(--lib-muted, #666);
  line-height: 1;
  transition: transform 180ms ease;
}

.lib-nav-group.is-expanded .lib-nav-chevron {
  transform: rotate(0deg);
}

.lib-nav-label {
  flex: 1;
  min-width: 0;
}

.lib-nav-count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--lib-muted, #666);
  font-variant-numeric: tabular-nums;
}

.lib-nav-children {
  overflow: hidden;
  transition: max-height 280ms ease, opacity 220ms ease;
}

.lib-nav-children[hidden] {
  display: none;
}

.library-catalog-main {
  min-width: 0;
}

.library-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}

.lib-crumb-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--lib-muted, #666);
  cursor: pointer;
  transition: color 140ms ease;
}

.lib-crumb-link:hover {
  color: #111;
}

.lib-crumb-sep {
  color: #e0e0e0;
}

body.library-catalog-home .lib-nav-row.is-active {
  background: rgba(56, 110, 68, 0.06);
  font-weight: 500;
}

body.library-catalog-home .lib-nav-row.is-active::before {
  width: 2px;
  background: var(--lib-green, #386e44);
}

body.library-catalog-home .lib-nav-count {
  color: #c8c8c8;
}

body.library-catalog-home .lib-nav-title {
  color: #b8b8b8;
}

.lib-crumb-current {
  color: #111;
  font-weight: 500;
}

body.library-v2 .feed-hero {
  min-height: auto;
  padding: 40px 0 32px;
}

body.library-v2.has-library-explorer .library-catalog--hidden {
  display: none !important;
}

body.library-v2 .feed-home--below {
  margin-top: 64px;
  padding-top: 64px;
  border-top: 1px solid var(--lib-border, #e8e8e8);
}

.btn-library-nav {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--lib-border, #e8e8e8);
  border-radius: 8px;
  cursor: pointer;
}

.library-nav-overlay {
  display: none;
}

.filter-pill--toggle input {
  margin-right: 6px;
}

@media (max-width: 960px) {
  .library-layout {
    grid-template-columns: 1fr;
  }

  .btn-library-nav {
    display: inline-flex;
  }

  .library-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    z-index: 200;
    background: #fff;
    padding: 20px 12px 32px;
    max-height: none;
    transform: translateX(-105%);
    transition: transform 200ms ease;
    box-shadow: none;
    border-right: 1px solid var(--lib-border, #e8e8e8);
  }

  body.library-nav-open .library-nav {
    transform: translateX(0);
  }

  .library-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  body.library-nav-open .library-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .lib-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    margin-bottom: 8px;
    border: 1px solid var(--lib-border, #e8e8e8);
    border-radius: 8px;
    background: #fff;
    font-size: 20px;
    cursor: pointer;
  }
}

@media (min-width: 961px) {
  .lib-nav-close {
    display: none;
  }
}
