.hdr__in,
.hdr.is-stuck .hdr__in {
  height: 72px;
}

.hdr__logo img,
.hdr.is-stuck .hdr__logo img {
  height: 30px;
}

.hdr__act {
  min-width: 332px;
  justify-content: flex-end;
}

.catalog-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.catalog-nav::after {
  position: absolute;
  top: 100%;
  left: -18px;
  width: calc(100% + 36px);
  height: 18px;
  content: '';
}

.catalog-mega {
  /*
   * The desktop navigation is centred independently from the logo/actions.
   * Anchoring this 1040px panel to the narrow "Каталог" item pushed it
   * outside the viewport at common laptop widths; body overflow clipping then
   * made the menu look as if it had disappeared. Keep the trigger relational,
   * but centre the panel in the viewport.
   */
  position: fixed;
  z-index: 120;
  top: 72px;
  left: 50vw;
  width: min(1040px, calc(100vw - 32px));
  max-height: min(74vh, 680px);
  overflow-y: auto;
  scrollbar-color: #586473 transparent;
  scrollbar-width: thin;
  border: 1px solid #3a4553;
  border-radius: 10px;
  background: rgba(24, 29, 36, .98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .52);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .16s ease, transform .16s ease;
}

.catalog-nav:hover > .catalog-mega,
.catalog-nav:focus-within > .catalog-mega {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.catalog-mega__top {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 18px;
  border-bottom: 1px solid #333c48;
  background: rgba(24, 29, 36, .98);
}

.catalog-mega__top > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.catalog-mega__top strong {
  font: 600 16px/1.2 Onest, sans-serif;
}

.catalog-mega__top span {
  color: #828d99;
  font-size: 12px;
}

.catalog-mega__top > a {
  color: #f4431f !important;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-mega__actions {
  display: flex;
  align-items: center;
  gap: 20px !important;
}

.catalog-mega__actions a {
  color: #dfe4ea;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.catalog-mega__actions a:last-child { color: #f4431f; }
.catalog-mega__actions a:hover,
.catalog-mega__actions a:focus-visible { color: #fff; }

.mnav-catalog__tool {
  display: block;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff !important;
  font-weight: 600;
}

.catalog-mega__grid {
  columns: 3;
  column-gap: 0;
}

.catalog-mega__section {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border-right: 1px solid #333c48;
  border-bottom: 1px solid #333c48;
  background: #1e232b;
  break-inside: avoid;
}

.catalog-mega::-webkit-scrollbar { width: 8px; }
.catalog-mega::-webkit-scrollbar-track { background: transparent; }
.catalog-mega::-webkit-scrollbar-thumb {
  border: 2px solid #181d24;
  border-radius: 99px;
  background: #586473;
}
.catalog-mega::-webkit-scrollbar-thumb:hover { background: #73808f; }

.catalog-mega__title,
.catalog-mega__section div a {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  text-decoration: none;
}

.catalog-mega__title {
  min-height: 38px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #e9ecef !important;
  font: 650 15px/1.25 Onest, sans-serif;
}

.catalog-mega__title img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: .88;
  filter: grayscale(1) brightness(1.8);
}

.catalog-mega__title:has(img) {
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
}

.catalog-mega__section > div {
  display: grid;
  align-content: start;
  gap: 3px;
}

.catalog-mega__section div a {
  padding: 6px 7px;
  border-radius: 5px;
  color: #a2acb8;
  font-size: 12px;
  line-height: 1.3;
}

.catalog-mega__section div a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .05);
}

.catalog-mega__title b,
.catalog-mega__section div b {
  color: #828d99;
  font: 600 11px/1.4 Onest, sans-serif;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .catalog-mega__grid { columns: 2; }
  .hdr__act { min-width: 290px; }
}

@media (max-width: 900px) {
  .hdr__in,
  .hdr.is-stuck .hdr__in { height: 64px; }
  .hdr__logo img,
  .hdr.is-stuck .hdr__logo img { height: 28px; }
  .hdr__act { min-width: 0; }
  .catalog-mega { display: none; }
}
