/**
 * Мегаменю card-grid — канон как в Radix Product/Company демо.
 * Позиционирование панелей — nfs_header.css; здесь внутренности.
 */

/* ── Trigger polish (pill при .is-open) ── */
@media (min-width: 1024px) {
  .nfs-megamenu-nav .nfs-nav-item.has-megamenu > a {
    border-radius: 0.5rem;
    transition: background 0.15s ease, box-shadow 0.15s ease;
  }

  .nfs-header--ds-light .nfs-megamenu-nav .nfs-nav-item.has-megamenu.is-open > a,
  .nfs-header--two-tier.nfs-header--ds-light .nfs-megamenu-nav .nfs-nav-item.has-megamenu.is-open > a {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    box-shadow: none;
  }

  .nfs-header:not(.nfs-header--ds-light) .nfs-megamenu-nav .nfs-nav-item.has-megamenu.is-open > a {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(59, 127, 255, 0.45);
  }
}

/* ── Shared panel shell ── */
@media (min-width: 1024px) {
  .nfs-header-main .nfs-megamenu.nfs-megamenu--catalog-only,
  .nfs-header-main .nfs-megamenu.nfs-megamenu--brands-panel,
  .nfs-header-main .nfs-megamenu.nfs-megamenu--tabbed,
  .nfs-header-main .nfs-megamenu.nfs-megamenu--featured,
  .nfs-header-main .nfs-megamenu.nfs-megamenu--cards {
    padding: 0 !important;
    min-height: 17.5rem !important;
    background: #fff !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    border-radius: 0.75rem !important;
    box-shadow:
      0 16px 40px -12px rgba(15, 23, 42, 0.18),
      0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
    overflow: hidden;
    z-index: 5000;
  }

  /* Бренды: высота панели по контенту; скролл — у .nfs-mm-grid--brands */
  .nfs-header-main .nfs-megamenu.nfs-megamenu--brands-panel.nfs-megamenu--cards {
    overflow: hidden !important;
    max-height: none !important;
  }

  /* Сброс legacy tabbed/featured grid (200px | 1fr) — иначе карточки сжимаются в ~26px */
  .nfs-header-main .nfs-megamenu.nfs-megamenu--cards,
  .nfs-header-main .nfs-megamenu.nfs-megamenu--tabbed.nfs-megamenu--cards,
  .nfs-header-main .nfs-megamenu.nfs-megamenu--featured.nfs-megamenu--cards {
    display: block !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
  }
}

/* ── Layout: main | sidebar ── */
.nfs-mm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11.5rem, 0.28fr);
  width: 100%;
  min-height: 17.5rem;
  min-width: 0;
  color: #0f172a;
  align-items: stretch;
}

.nfs-mm-layout--solo {
  grid-template-columns: 1fr;
}

/* Каталог: флаги слева | кузова справа */
.nfs-mm-layout--mirror {
  grid-template-columns: minmax(12rem, 0.3fr) minmax(0, 1fr);
}

.nfs-mm-layout--mirror .nfs-mm-layout__side {
  border-right: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
}

.nfs-mm-layout--mirror .nfs-mm-layout__main {
  border-right: none;
}

.nfs-mm-layout__main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-right: 1px solid rgba(15, 23, 42, 0.1);
  min-width: 0;
  min-height: 0;
}

.nfs-mm-layout--solo .nfs-mm-layout__main {
  border-right: none;
}

.nfs-mm-layout__side {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 1rem 0.85rem;
  background: #fff;
  min-width: 0;
}

.nfs-mm-layout__side-title {
  margin: 0 0 0.35rem;
  padding: 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* ── Grids ── */
.nfs-mm-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.nfs-mm-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 0;
}

.nfs-mm-grid--3 > li {
  display: flex;
  min-height: 0;
}

.nfs-mm-grid--3 > li > .nfs-mm-card {
  flex: 1 1 auto;
  width: 100%;
  min-height: 14.5rem;
  height: 100%;
}

.nfs-mm-grid--1 {
  grid-template-columns: 1fr;
}

.nfs-mm-grid--1 > li {
  display: flex;
}

.nfs-mm-grid--1 > li > .nfs-mm-card {
  flex: 1 1 auto;
  width: 100%;
  min-height: 14.5rem;
  height: 100%;
}

.nfs-mm-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1 1 auto;
  align-items: stretch;
}

.nfs-mm-grid--2 > li {
  display: flex;
}

.nfs-mm-grid--2 > li > .nfs-mm-card {
  flex: 1 1 auto;
  width: 100%;
  min-height: 9.5rem;
  height: 100%;
}

.nfs-mm-grid--row3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
}

/* ── GridCard (Product tall) ── */
.nfs-mm-card {
  --nfs-mm-grid-line: rgba(15, 23, 42, 0.055);
  --nfs-mm-grid-fill: rgba(15, 23, 42, 0.035);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.15rem 1.15rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background-color: #fff;
  text-decoration: none !important;
  color: #0f172a !important;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Perspective diagonal grid (как в демо) */
.nfs-mm-card::before {
  content: "";
  position: absolute;
  inset: -20% -10% -40% -10%;
  z-index: -1;
  pointer-events: none;
  background-color: #fff;
  background-image:
    linear-gradient(var(--nfs-mm-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--nfs-mm-grid-line) 1px, transparent 1px),
    linear-gradient(var(--nfs-mm-grid-fill) 1px, transparent 1px),
    linear-gradient(90deg, var(--nfs-mm-grid-fill) 1px, transparent 1px);
  background-size:
    18px 18px,
    18px 18px,
    72px 72px,
    72px 72px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  transform: perspective(420px) rotateX(52deg) scale(1.35);
  transform-origin: center top;
  opacity: 0.9;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.12) 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.12) 70%, transparent 100%);
}

.nfs-mm-card:hover {
  border-color: rgba(26, 95, 217, 0.32);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  color: #0f172a !important;
}

.nfs-mm-card--china:hover {
  border-color: rgba(220, 38, 38, 0.35);
}

.nfs-mm-card--tall {
  min-height: 14.5rem;
}

.nfs-mm-card__icon,
.nfs-mm-card__flag {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #334155;
}

.nfs-mm-card__icon {
  width: 1.75rem;
  height: 1.75rem;
}

.nfs-mm-card__icon svg,
.nfs-mm-card__icon .nfs-ti,
.nfs-mm-card__icon .nfs-nav-cat-ico {
  width: 1.35rem;
  height: 1.35rem;
}

.nfs-mm-card__flag {
  width: 2.1rem;
  height: 1.4rem;
  border-radius: 0.2rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.nfs-mm-card__flag img,
.nfs-mm-card__flag svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nfs-mm-card__body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  max-width: 100%;
}

.nfs-mm-card__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.nfs-mm-card__desc {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #64748b;
}

/* ── NavLargeItem (Company bottom / sidebar cards) ── */
.nfs-mm-large {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  text-decoration: none !important;
  color: #0f172a !important;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-height: 4.25rem;
}

.nfs-mm-large:hover {
  background: #f8fafc;
  border-color: rgba(26, 95, 217, 0.25);
  color: #0f172a !important;
}

.nfs-mm-large__text {
  min-width: 0;
}

.nfs-mm-large__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}

.nfs-mm-large__desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nfs-mm-large__icon {
  flex-shrink: 0;
  color: #64748b;
}

.nfs-mm-large__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.nfs-mm-side-stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1 1 auto;
}

.nfs-mm-side-stack .nfs-mm-large {
  flex: 1 1 auto;
}

/* ── NavSmallItem (Product sidebar) ── */
.nfs-mm-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nfs-mm-side-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.45rem;
  border-radius: 0.5rem;
  text-decoration: none !important;
  color: #0f172a !important;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.12s ease;
}

.nfs-mm-side-item:hover {
  background: rgba(15, 23, 42, 0.04);
  color: #0f172a !important;
}

.nfs-mm-side-item__icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 1.15rem;
  justify-content: center;
  color: #64748b;
}

.nfs-mm-side-item__icon svg,
.nfs-mm-side-item__icon .nfs-ti,
.nfs-mm-side-item__icon .nfs-nav-cat-ico,
.nfs-mm-side-item__icon img {
  width: 1.05rem;
  height: 1.05rem;
}

.nfs-mm-side-item__label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nfs-mm-side-item__count {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.nfs-mm-side-item__arrow {
  display: none;
}

.nfs-mm-side-group + .nfs-mm-side-group {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* Каталог: сайдбар флагов + сетка кузовов */
.nfs-megamenu--catalog-only .nfs-mm-layout__side {
  max-height: none;
  overflow: visible;
}

.nfs-mm-large__icon--flag {
  width: 2rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.2rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
}

.nfs-mm-large__icon--flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nfs-mm-grid--body4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  flex: 1 1 auto;
  align-content: start;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nfs-mm-body {
  display: block;
  text-decoration: none !important;
  color: #0f172a !important;
  min-width: 0;
}

.nfs-mm-body__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 0.65rem;
  border: none;
  background: transparent;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nfs-mm-body__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: scale(1);
  transition: transform 0.28s ease;
}

.nfs-mm-body__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #94a3b8;
  background: #f8fafc;
  border-radius: 0.65rem;
}

.nfs-mm-body__fallback-label {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: #0f172a;
}

.nfs-mm-body:hover .nfs-mm-body__media {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
}

.nfs-mm-body:hover .nfs-mm-body__img {
  transform: scale(1.06);
}

@media (max-width: 1200px) {
  .nfs-mm-grid--body4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .nfs-mm-grid--body4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nfs-mm-layout--mirror {
    grid-template-columns: minmax(10rem, 0.34fr) minmax(0, 1fr);
  }
}

/* Brand tile — квадратная обложка + meta; ограниченная высота + скролл */
.nfs-mm-grid--brands {
  grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr));
  grid-auto-rows: max-content;
  gap: 0.65rem 0.75rem;
  flex: 0 0 auto;
  width: 100%;
  max-height: min(22rem, calc(100vh - 11rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  margin: 0 !important;
  padding: 0 0.15rem 0 0;
  align-content: start !important;
  align-items: start !important;
  justify-content: start;
}

/* Сброс legacy tile-стилей (nfs_header / silo), чтобы не сжимать cover */
.nfs-megamenu--cards .nfs-mm-brand.nfs-megamenu-link--brand-with-logo,
.nfs-megamenu--cards a.nfs-mm-brand {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0.4rem !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
  color: #0f172a !important;
  text-align: center;
  position: relative;
  isolation: isolate;
  overflow: visible;
  transform: none !important;
}

.nfs-mm-brand::before {
  display: none !important;
  content: none !important;
}

.nfs-mm-brand__cover,
.nfs-megamenu--cards .nfs-mm-brand .nfs-megamenu-brand-logo-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
  aspect-ratio: 1 / 1 !important;
  flex: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  border-radius: 0.75rem !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background:
    linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
  box-shadow: none !important;
  overflow: hidden !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nfs-mm-brand__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 12px 12px;
  opacity: 0.85;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 90%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 90%);
}

.nfs-mm-brand:hover .nfs-mm-brand__cover {
  border-color: rgba(26, 95, 217, 0.35) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* Лого: flex-центр в cover (absolute+translate обрезал верх PNG) */
.nfs-mm-brand__logo,
.nfs-mm-brand .nfs-megamenu-brand-logo,
.nfs-megamenu--cards .nfs-mm-brand .nfs-megamenu-brand-logo {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  inset: auto !important;
  z-index: 1;
  display: block !important;
  width: 68% !important;
  height: 68% !important;
  max-width: 68% !important;
  max-height: 68% !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
  pointer-events: none;
}

.nfs-mm-brand__fallback,
.nfs-mm-brand .nfs-megamenu-brand-fallback {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border-radius: inherit;
}

.nfs-mm-brand__fallback.is-visible,
.nfs-mm-brand .nfs-megamenu-brand-fallback.is-visible {
  display: flex;
}

.nfs-mm-brand__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0 0.15rem;
  min-width: 0;
}

.nfs-mm-brand__name,
.nfs-mm-brand .nfs-megamenu-brand-text {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a !important;
}

.nfs-mm-brand__count,
.nfs-mm-brand .nfs-megamenu-brand-count {
  font-size: 0.6875rem !important;
  color: #64748b !important;
  font-weight: 500 !important;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(26, 95, 217, 0.08);
  border: none !important;
}

/* ── Mobile drawer: Radix-style rows + brand covers (высокая специфичность) ── */
.nfs-mobile-drawer .nfs-mm-mobile-item,
.nfs-mm-mobile-item {
  display: flex !important;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem !important;
  text-align: left;
  text-decoration: none !important;
  color: #0f172a !important;
  background: #fff !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  border-radius: 0 !important;
  box-sizing: border-box;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.nfs-mobile-drawer .nfs-mm-mobile-item--root {
  min-height: 3.5rem;
  padding-top: 0.85rem !important;
  padding-bottom: 0.85rem !important;
}

.nfs-mobile-drawer .nfs-mm-mobile-item__chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: #94a3b8;
  width: 1.15rem;
  height: 1.15rem;
}

.nfs-mobile-drawer .nfs-mm-mobile-item:last-child {
  border-bottom: none !important;
}

.nfs-mobile-drawer .nfs-mm-mobile-item--accent .nfs-mm-mobile-item__title {
  color: #1a5fd9;
}

.nfs-mobile-drawer .nfs-mm-mobile-item__icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem !important;
  height: 2.5rem !important;
  border-radius: 0.65rem;
  background: #f1f5f9 !important;
  color: #334155;
}

.nfs-mobile-drawer .nfs-mm-mobile-item__icon svg,
.nfs-mobile-drawer .nfs-mm-mobile-item__icon .nfs-ti {
  width: 1.25rem;
  height: 1.25rem;
}

.nfs-mobile-drawer .nfs-mm-mobile-item__icon--flag {
  background: #fff !important;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.nfs-mobile-drawer .nfs-mm-mobile-item__icon--flag img {
  width: 1.35rem;
  height: auto;
  display: block;
}

.nfs-mobile-drawer .nfs-mm-mobile-item__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
}

.nfs-mobile-drawer .nfs-mm-mobile-item__title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  color: #0f172a;
}

.nfs-mobile-drawer .nfs-mm-mobile-item__desc {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #64748b;
}

.nfs-mobile-drawer .nfs-mm-mobile-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 1rem 0.85rem;
}

.nfs-mobile-drawer .nfs-mm-mobile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none !important;
  color: #0f172a !important;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.nfs-mobile-drawer .nfs-mm-mobile-chip--china {
  border-color: rgba(220, 38, 38, 0.22);
}

.nfs-mobile-drawer .nfs-mm-mobile-brands {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.25rem 1rem 1.25rem;
}

.nfs-mobile-drawer .nfs-mm-mobile-brands .nfs-mm-brand {
  min-width: 0;
}

.nfs-mobile-drawer .nfs-mobile-nav--mm-list,
.nfs-mobile-drawer .nfs-mobile-nav--brands-cards,
.nfs-mobile-drawer .nfs-mobile-nav--mm-root {
  display: flex;
  flex-direction: column;
  padding-bottom: 0.5rem;
}

@media (max-width: 380px) {
  .nfs-mobile-drawer .nfs-mm-mobile-brands {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Сброс старых col-обёрток */
.nfs-megamenu--cards .nfs-megamenu-col,
.nfs-megamenu--cards .nfs-megamenu-col--categories,
.nfs-megamenu--cards .nfs-megamenu-col--brands {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  min-width: 0;
  width: 100%;
  display: block;
  /* catalog_nav: max-height + overflow:hidden сжимал/обрезал cover-сетку */
  max-height: none !important;
  overflow: visible !important;
}

.nfs-megamenu--brands-panel.nfs-megamenu--cards {
  overflow: hidden;
}

@media (min-width: 1024px) {
  .nfs-header-main .nfs-megamenu.nfs-megamenu--brands-panel.nfs-megamenu--cards {
    overflow: hidden;
    max-height: none;
  }
}

@media (max-width: 1200px) {
  .nfs-mm-layout {
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 0.32fr);
  }

  .nfs-mm-grid--brands {
    grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
  }
}

@media (max-width: 1100px) {
  .nfs-mm-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nfs-mm-grid--3 > li:last-child {
    grid-column: 1 / -1;
  }
}
