/* Hero is scoped to the catalogue only. It never touches the coloring editor. */
.rc-hero--catalog.is-built-in {
  min-height: 0;
  aspect-ratio: 2.5 / 1;
  margin-bottom: 24px;
  background: #fffaf0;
}

/* Catalog hero removed on desktop and mobile. */
.rc-hero--catalog {
  display: none !important;
}

/* Compact catalogue search and filters. */
.rc-catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(215px, 255px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.rc-catalog-toolbar > div {
  min-width: 0;
}

.rc-catalog-toolbar h2 {
  margin: 4px 0;
  font-size: 24px;
}

.rc-catalog-toolbar p {
  font-size: 13px;
  line-height: 1.35;
}

.rc-filters {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  grid-template-areas:
    "search age actions"
    "search level actions";
  align-items: center;
  gap: 8px 12px;
  width: 100%;
}

.rc-filters label {
  grid-area: search;
  min-width: 0;
}

.rc-filters input[type="search"] {
  min-height: 40px;
  padding: 9px 12px;
}

.rc-filters .rc-filter-line:nth-of-type(1) {
  grid-area: age;
}

.rc-filters .rc-filter-line:nth-of-type(2) {
  grid-area: level;
}

.rc-filter-line {
  width: auto;
  flex-wrap: nowrap;
}

.rc-filter-actions {
  grid-area: actions;
  flex-direction: column;
  gap: 2px;
  min-width: 88px;
}

.rc-filter-actions button {
  width: 100%;
  min-height: 40px;
  padding: 8px 13px;
}

.rc-filter-actions a {
  padding: 5px 7px;
  font-size: 12px;
}

@media (max-width: 1050px) {
  .rc-catalog-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .rc-filters {
    grid-template-columns: minmax(160px, .8fr) minmax(0, 1.2fr);
    grid-template-areas:
      "search age"
      "search level"
      "actions actions";
  }

  .rc-filter-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .rc-filter-actions button {
    width: auto;
  }
}

@media (max-width: 600px) {
  .rc-catalog-toolbar {
    gap: 10px;
    padding: 14px;
    margin-bottom: 15px;
    border-radius: 18px;
  }

  .rc-catalog-toolbar .rc-kicker,
  .rc-catalog-toolbar > div > p {
    display: none;
  }

  .rc-catalog-toolbar h2 {
    margin: 0;
    font-size: 21px;
  }

  .rc-filters {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "search"
      "age"
      "level"
      "actions";
    gap: 8px;
  }

  .rc-filters label {
    gap: 4px;
    font-size: 11px;
  }

  .rc-filters input[type="search"] {
    min-height: 38px;
    padding: 8px 11px;
  }

  .rc-filter-line {
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .rc-filter-line::-webkit-scrollbar {
    display: none;
  }

  .rc-filter-line strong {
    flex: 0 0 auto;
    font-size: 11px;
  }

  .rc-filter-line a,
  .rc-filter-line button {
    flex: 0 0 auto !important;
    min-height: 36px;
    padding: 7px 9px !important;
    font-size: 10.5px !important;
  }

  .rc-filter-actions {
    justify-content: stretch;
    gap: 8px;
  }

  .rc-filter-actions button {
    flex: 1 1 auto;
    min-height: 38px;
  }

  .rc-filter-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

.rc-hero--catalog.is-built-in::before,
.rc-hero--catalog.is-built-in::after {
  display: none;
}

.rc-catalog-hero-picture,
.rc-catalog-hero-picture .rc-banner {
  display: block;
  width: 100%;
  height: 100%;
}

.rc-catalog-hero-picture .rc-banner {
  object-fit: cover;
  object-position: center;
}

.rc-mobile-hero-copy {
  display: none;
}

/* Match the filter chips used by the "Развивающие игры" section. */
.rc-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.rc-category-pills a {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #e7eadf;
  border-radius: 9px;
  background: #fbfcf8;
  box-shadow: none;
  color: #687567;
  font: 800 12px Nunito, sans-serif;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}

.rc-category-pills a:nth-child(2n),
.rc-category-pills a:nth-child(3n) {
  background: #fbfcf8;
}

.rc-category-pills a:hover {
  border-color: #b9d8ca;
  background: #f3f8ee;
  color: #218b7b;
  transform: translateY(-1px);
}

.rc-category-pills a.is-active,
.rc-category-pills a.is-active:nth-child(2n),
.rc-category-pills a.is-active:nth-child(3n) {
  border-color: #229b8b;
  background: #229b8b;
  box-shadow: none;
  color: #fff;
}

.rc-filter-line a,
.rc-filter-line button {
  min-height: 40px;
  padding: 8px 14px !important;
  border: 1px solid #e7eadf !important;
  border-radius: 9px !important;
  background: #fbfcf8 !important;
  box-shadow: none !important;
  color: #687567 !important;
  font: 800 12px Nunito, sans-serif !important;
}

.rc-filter-line a:hover,
.rc-filter-line button:hover {
  border-color: #b9d8ca !important;
  background: #f3f8ee !important;
  color: #218b7b !important;
}

.rc-filter-line a.is-active,
.rc-filter-line button.is-active {
  border-color: #229b8b !important;
  background: #229b8b !important;
  color: #fff !important;
}

@media (max-width: 600px) {
  .rc-category-pills {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
    scrollbar-width: none;
  }

  .rc-category-pills::-webkit-scrollbar {
    display: none;
  }

  .rc-category-pills a,
  .rc-filter-line a,
  .rc-filter-line button {
    padding: 8px 10px !important;
    font-size: 11px !important;
  }

  .rc-hero--catalog.is-built-in {
    aspect-ratio: 1.45 / 1;
    min-height: 245px;
    margin-bottom: 18px;
    border-radius: 22px;
  }

  .rc-catalog-hero-picture .rc-banner {
    object-position: 77% center;
  }

  .rc-hero--catalog.is-built-in::after {
    content: '';
    display: block;
    position: absolute;
    z-index: 1;
    inset: 0 42% 0 0;
    background: linear-gradient(90deg, rgba(255, 252, 242, .97), rgba(255, 252, 242, .8) 64%, rgba(255, 252, 242, 0));
  }

  .rc-mobile-hero-copy {
    display: block;
    position: absolute;
    z-index: 2;
    left: 18px;
    top: 50%;
    width: 54%;
    transform: translateY(-50%);
    color: #4b2795;
    text-wrap: balance;
  }

  .rc-mobile-hero-copy h1 {
    margin: 0 0 7px;
    color: #4b2795;
    font-size: clamp(29px, 10vw, 42px);
    line-height: .95;
    letter-spacing: -1.2px;
    text-shadow: 0 3px 0 #ff9aab;
  }

  .rc-mobile-hero-copy p {
    margin: 0;
    color: #56318f;
    font-size: clamp(12px, 3.8vw, 15px);
    font-weight: 800;
    line-height: 1.24;
  }
}
