/* 📱 Выдвижное мобильное меню */
.nav.mobile {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  max-width: 70%;
  width: 260px;
  background: #fff;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 80px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateX(-100%);
  transition: transform 0.3s ease, background 0.3s, color 0.3s;
}

.nav.mobile.show {
  transform: translateX(0);
}

/* Ссылки меню */
.nav.mobile a {
  padding: 12px 24px;
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.3s, color 0.3s;
}

.nav.mobile a:hover {
  background: var(--green);
  color: #fff;
}

/* 🌙 Тёмная тема */
body.dark .nav.mobile {
  background: var(--card-bg);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.6);
}

body.dark .nav.mobile a {
  color: var(--dark-text);
  border-bottom: 1px solid #333;
}

/* 🔲 Затемнение заднего фона при открытии меню */
#mobileOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  z-index: 900;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobileOverlay.show {
  display: block;
  opacity: 1;
}
/* ========================== */
/* Общий стиль для боковых панелей */
.sidebar {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
  transition: background 0.3s, color 0.3s;
}

body.dark .sidebar {
  background: var(--card-bg);
  color: var(--dark-text);
}

.sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================== */
/* Боковое меню категорий */
.sidebar-categories h2 {
  color: var(--green);
}

.sidebar-categories ul {
  list-style: none;
  padding-left: 0;
}

.sidebar-categories li {
  margin: 6px 0;
  line-height: 1.5;
  position: relative;
}

/* Родительские категории */
.sidebar-categories li.parent > a {
  font-weight: 600;
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius);
  display: block;
  transition: background 0.3s, color 0.3s;
}

body.dark .sidebar-categories li.parent > a {
  color: var(--dark-text);
}

.sidebar-categories li.parent > a:hover {
  background: var(--green);
  color: #fff;
}

/* Дочерние категории */
.sidebar-categories li.child > a {
  font-weight: 400;
  color: #555;
  padding: 5px 15px;
  display: block;
  border-left: 2px solid var(--green);
  border-radius: var(--radius);
  transition: background 0.3s, color 0.3s;
  margin-left: 8px;
}

body.dark .sidebar-categories li.child > a {
  color: #aaa;
  border-left-color: var(--green);
}

.sidebar-categories li.child > a:hover {
  background: rgba(76, 175, 80, 0.1);
  color: var(--green);
}

/* Иконки */
.sidebar-categories a i {
  margin-right: 6px;
}

/* Ламповые маркеры */
.sidebar-categories li.parent::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--green);
  font-size: 0.8rem;
  line-height: 1.5;
}

.sidebar-categories li.child::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--green);
  font-size: 0.8rem;
  line-height: 1.5;
}
.sidebar-categories ul.subcategories {
  max-height: 0;              /* скрыто */
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 10px;
}

.sidebar-categories li.parent.open > ul.subcategories {
  max-height: 1000px;         /* достаточно большой для любого количества элементов */
}
/* ========================== */
/* Правый сайдбар "Популярное" */
.sidebar-popular {
  background: #fff;
  margin: 0 0 5px 20px; /* ← здесь добавил левый отступ */
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
}

body.dark .sidebar-popular {
  background: var(--card-bg);
  color: var(--dark-text);
}

.sidebar-popular h2 {
  color: #ff5722;
  font-size: 1.2rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-popular ul {
  list-style: none;
  padding-left: 0;
}

.sidebar-popular li {
  margin: 8px 0;
  position: relative;
}

.sidebar-popular a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: #333;
  font-weight: 500;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

body.dark .sidebar-popular a {
  color: #ddd;
}

.sidebar-popular a:hover {
  background: rgba(255, 87, 34, 0.1);
  color: #ff5722;
  transform: translateX(3px);
}

.sidebar-popular .popular-poster {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform 0.2s;
}

.sidebar-popular a:hover .popular-poster {
  transform: scale(1.05);
}

.sidebar-popular .popular-text {
  display: flex;
  flex-direction: column;
}

.sidebar-popular .popular-name {
  font-weight: 500;
  line-height: 1.2;
}

/* Ламповые маркеры */
.sidebar-popular li::before {
  content: ''; /* пусто — звездочки нет */
}

/* Адаптив */
@media (max-width: 1024px) {
  .sidebar-categories{
    display: none;
  }

  .sidebar-popular {
    padding: 15px;
    margin-top: 20px;
    display: none;
  }

  .sidebar-popular li::before {
    left: -14px;
     display: none;
  }

  .popular-poster {
    width: 35px;
    height: 35px;
     display: none;
  }
}


