.catalog-shell {
  margin-top: 24px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.catalog-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #fff7ed, #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.catalog-sidebar:has(.category-nav:empty) {
  min-height: 470px;
}

.catalog-sidebar h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #7c2d12;
}

.catalog-toggle {
  display: none;
  width: 100%;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #7c2d12;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-nav:empty {
  display: block;
  min-height: 420px;
}

.category-nav:empty::before {
  content: "";
  display: block;
  width: 100%;
  height: 420px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.68) 48%, rgba(255,255,255,0) 100%) 0 0 / 220px 100% no-repeat,
    repeating-linear-gradient(
      to bottom,
      #fff 0,
      #fff 44px,
      transparent 44px,
      transparent 54px
    );
  border: 1px solid #e5e7eb;
  animation: catalog-nav-skeleton-shimmer 1.25s linear infinite;
}

.category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: #1f2937;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font-weight: 800;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.category-link:hover {
  transform: translateY(-1px);
  border-color: #f59e0b;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
}

.category-link.active {
  border-color: #ef4444;
  background: linear-gradient(180deg, #fff1f2, #fff7ed);
  color: #991b1b;
}

.category-count {
  flex: 0 0 auto;
  min-width: 34px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 12px;
}

.category-link.active .category-count {
  background: #fee2e2;
  color: #b91c1c;
}

.catalog-main {
  min-width: 0;
}

#catalog-content:empty {
  min-height: 640px;
}

#catalog-content:empty::before {
  content: "";
  display: block;
  width: 100%;
  height: 640px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.55) 48%, rgba(255,255,255,0) 100%) 0 0 / 280px 100% no-repeat,
    linear-gradient(#ffffff, #ffffff) 0 0 / 260px 28px no-repeat,
    linear-gradient(#f3f4f6, #f3f4f6) 0 44px / 380px 18px no-repeat,
    repeating-linear-gradient(
      to right,
      #ffffff 0,
      #ffffff calc(25% - 10px),
      transparent calc(25% - 10px),
      transparent 25%
    ) 0 92px / 100% 248px repeat-y;
  animation: catalog-content-skeleton-shimmer 1.35s linear infinite;
}

.grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 14px;
}

.card {
  background: #ffffff;
  color: #111827;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card h3 {
  margin: 0;
  font-size: 15px;
  color: #7c2d12;
  text-align: center;
}

.card p {
  margin: 0;
  color: #6b7280;
  line-height: 1.6;
  font-size: 13px;
}

.cover-link {
  width: 57%;
  padding-top: 56.25%;
  background: #f8fafc;
  position: relative;
  margin: 0 auto;
  border-radius: 29px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  display: block;
}

.cover-link .cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  transition: transform .22s ease, box-shadow .22s ease;
}

.cover-link:hover .cover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(239,68,68,.3);
}

.cover-link::after {
  content: 'Play';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .04em;
  border-radius: 10px;
  opacity: 0;
  transition: opacity .22s ease;
}

.cover-link:hover::after {
  opacity: 1;
}

.catalog-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.catalog-header h2 {
  margin: 0;
}

.catalog-header p {
  margin: 0;
  color: #6b7280;
  line-height: 1.6;
}

.catalog-group + .catalog-group {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.catalog-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.catalog-group-head h3 {
  margin: 0;
  font-size: 24px;
  color: #7c2d12;
}

.catalog-group-head span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.catalog-empty {
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
}

@keyframes catalog-nav-skeleton-shimmer {
  from {
    background-position: -240px 0, 0 0;
  }
  to {
    background-position: calc(100% + 240px) 0, 0 0;
  }
}

@keyframes catalog-content-skeleton-shimmer {
  from {
    background-position: -280px 0, 0 0, 0 44px, 0 92px;
  }
  to {
    background-position: calc(100% + 280px) 0, 0 0, 0 44px, 0 92px;
  }
}

@media (max-width: 960px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    position: static;
  }

  .category-nav {
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }

  .category-link {
    min-width: 0;
    flex: 1 1 calc(50% - 10px);
  }

  .catalog-header {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 560px) {
  .catalog-sidebar h3 {
    margin-bottom: 10px;
  }

  .catalog-toggle {
    display: block;
  }

  .catalog-sidebar.collapsed .category-nav {
    display: none;
  }

  .category-link {
    flex-basis: 100%;
  }
}
