@media (prefers-reduced-motion: no-preference) {
  html:has([data-catalog-hub]) {
    scroll-behavior: smooth;
  }
}

.catalog-hub__header {
  max-width: 40rem;
  margin: 0 0 20px;
}

.catalog-hub__lead {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.5;
}

.catalog-hub__jump {
  position: sticky;
  top: var(--header-height, 72px);
  z-index: 8;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px 20px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.catalog-hub__jump::-webkit-scrollbar {
  display: none;
}

.catalog-hub__jump-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--color-search-bg);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.catalog-hub__jump-link:hover {
  background: var(--color-hover);
}

.catalog-hub__departments {
  display: grid;
  gap: 16px;
}

.catalog-dept {
  --dept-accent: #1463aa;
  --dept-wash: color-mix(in srgb, var(--dept-accent) 14%, var(--color-search-bg));
  position: relative;
  scroll-margin-top: calc(var(--header-height, 72px) + 56px);
  padding: 18px 16px 16px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--dept-accent) 22%, transparent), transparent 34%),
    var(--dept-wash);
  cursor: pointer;
}

.catalog-dept__hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}

.catalog-dept__intro,
.catalog-dept__body,
.catalog-dept__subs,
.catalog-dept__products {
  pointer-events: none;
}

.catalog-dept__all,
.catalog-dept__sub,
.catalog-dept .product-grid__item {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.catalog-dept:has(.catalog-dept__hit:hover) .catalog-dept__all {
  color: var(--dept-accent);
}

.catalog-dept--plush {
  --dept-accent: #c48a1a;
}

.catalog-dept--keychains {
  --dept-accent: #1b7f8a;
}

.catalog-dept--rubber {
  --dept-accent: #d4537a;
}

.catalog-dept__intro {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.catalog-dept__visual {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
}

.catalog-dept__image {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

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

.catalog-dept__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.catalog-dept__blurb {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.45;
}

.catalog-dept__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.catalog-dept__all:hover {
  color: var(--dept-accent);
}

.catalog-dept__all-icon {
  display: block;
}

.catalog-dept__body {
  display: grid;
  gap: 14px;
}

.catalog-dept__subs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-dept__subs > li {
  display: flex;
  min-width: 0;
}

.catalog-dept__sub {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: 0 1px 4px var(--color-card-shadow);
  color: inherit;
  text-decoration: none;
}

.catalog-dept__sub:hover {
  background: var(--color-hover);
}

.catalog-dept__sub-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.catalog-dept__sub-count {
  margin-top: auto;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.2;
}

.catalog-dept .product-grid.catalog-dept__products {
  margin: 0;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .catalog-hub__header {
    margin-bottom: 24px;
  }

  .catalog-hub__jump {
    margin: 0 0 24px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .catalog-hub__departments {
    gap: 20px;
  }

  .catalog-dept {
    padding: 24px;
  }

  .catalog-dept__intro {
    gap: 18px;
    margin-bottom: 20px;
  }

  .catalog-dept__visual {
    width: 88px;
    height: 88px;
    border-radius: 24px;
  }

  .catalog-dept__image {
    width: 64px;
    height: 64px;
  }

  .catalog-dept__title {
    font-size: 26px;
  }

  .catalog-dept__blurb {
    font-size: 15px;
  }

  .catalog-dept__subs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .catalog-dept .product-grid.catalog-dept__products {
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 220px));
    justify-content: start;
  }
}

@media (min-width: 1024px) {
  .catalog-dept {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    padding: 28px;
  }

  .catalog-dept__intro {
    display: block;
    margin: 0;
  }

  .catalog-dept__visual {
    width: 104px;
    height: 104px;
    margin-bottom: 16px;
  }

  .catalog-dept__image {
    width: 76px;
    height: 76px;
  }

  .catalog-dept__subs {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  }

  .catalog-dept .product-grid.catalog-dept__products {
    grid-template-columns: repeat(4, minmax(0, 200px));
    gap: 12px;
  }
}
