/* Новое меню каталога (админ) — префикс avm- */

/* Админ: старый дропдаун «Каталог» скрыт — открытие hover → #avm-root */
body.avm-admin li.sub-full-width:has(> a[href="/catalog/"]) > .full-sub,
body.avm-admin li.sub-full-width:has(> a[href="/catalog"]) > .full-sub {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.avm-root { 
  --avm-red: #CC2233;
  --avm-text: #19191E;
  --avm-text-2: #323237;
  --avm-muted: #4A4A4F;
  --avm-gray: #6C6C71;
  --avm-line: #E1E1E6;
  --avm-soft: #EDEDED;
  --avm-white: #FFFFFF;
  --avm-scroll-thumb: #CC2233;
  --avm-scroll-track: #F0F0F4;
  --avm-container: 1328px;
  --avm-font: "Roboto", Helvetica, Arial, sans-serif;
  --avm-col-l1-max: 344px;
  --avm-col-l2-max: 464px;
  --avm-col-l3-max: 559px;
  --avm-mega-h: 849px;
  --avm-top: 0px;

  position: fixed;
  top: var(--avm-top);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100000;
  overflow: auto;
  background: transparent;
  font-family: var(--avm-font);
  color: var(--avm-text);
}

/* Шапка остаётся над меню — «Каталог» не перекрывается */
@media (min-width: 1201px) {
  body.avm-admin .header.type1 {
    position: relative;
    z-index: 100001;
  }
  body.avm-admin .header-fixed,
  body.avm-admin .type1-fixed {
    z-index: 100001;
  }
}

.avm-root[hidden] {
  display: none !important;
}

.avm-root *,
.avm-root *::before,
.avm-root *::after {
  box-sizing: border-box;
}

/*
  У шаблона есть ul li { margin: 12px 0 } без !important.
  Бьём специфичностью — без !important, чтобы дальше спокойно править padding.
*/
.avm-root .avm-tree {
  margin: 0;
  padding: 0;
  list-style: none;
}

.avm-root .avm-tree > li {
  margin: 0;
  padding: 0;
  list-style: none;
  display: block;
  border: 0;
  background: transparent;
}

.avm-root a {
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  border: 0;
  background: transparent;
}

.avm-root a:hover,
.avm-root a:focus,
.avm-root a:active {
  text-decoration: none;
  outline: none;
}

.avm-empty {
  padding: 40px 24px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--avm-muted);
}

.avm-empty a {
  color: var(--avm-red);
}

/* Как .container в прототипе */
.avm-container {
  width: min(100% - 40px, var(--avm-container));
  margin: 0 auto 40px;
  container-type: inline-size;
  container-name: avm-shell;
}

/* ПК: поля по бокам не удерживают hover */
@media (min-width: 1201px) {
  .avm-root {
    pointer-events: none;
  }
  .avm-root .avm-container {
    pointer-events: auto;
  }
}

/* ===== Mega =====
   L1 — 344px, L2 и L3 — остаток пополам. */
.avm-mega {
  --avm-col-l1: 344px;
  --avm-col-l2: 50%;
  --avm-col-l3: 50%;

  position: relative;
  display: block;
  width: 100%;
  max-width: var(--avm-container);
  min-height: var(--avm-mega-h);
  border: 1px solid var(--avm-line);
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .06);
  overflow: hidden;
}

.avm-tree--l1 {
  position: relative;
  width: var(--avm-col-l1);
  min-height: var(--avm-mega-h);
  background: #E1E1E6;
  z-index: 3;
}

.avm-tree--l1 > .avm-tree__item,
.avm-tree--l2 > .avm-tree__item {
  position: static;
}

/* Маркер для JS — без визуальных стилей.
   Редактировать уровни: --l1 / --l2 / --l3 */
.avm-tree__link {
  text-decoration: none;
  color: inherit;
  box-shadow: none;
}

/* ===== L1 ===== */
.avm-tree__link--l1 {
  display: grid;
  grid-template-columns: 72px 1fr 24px;
  align-items: center;
  gap: 20px;
  min-height: 92px;
  padding: 10px 20px;
  border-bottom: 2px solid #CACACA;
  font-size: 18px;
  font-weight: 700;
  color: #000;
  background: transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.avm-tree__img {
  width: 72px;
  height: 72px;
  border-radius: 5px;
  overflow: hidden;

  flex-shrink: 0;
}

/* Пустое «Изображение» — белая заглушка того же размера */
.avm-tree__img:not(:has(img)) {

}

.avm-tree__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avm-tree__title {
  line-height: 1.2;
}



.avm-tree__arrow {
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.18 10.9717L10.8 5.46015L12.22 4L20 12L12.22 20L10.8 18.5398L16.18 13.0283H4V10.9717H16.18Z' fill='%23B9B9B9'/%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
  border: 0;
  flex: 0 0 auto;
}

.avm-tree__link--l1 .avm-tree__arrow {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.18 10.9717L10.8 5.46015L12.22 4L20 12L12.22 20L10.8 18.5398L16.18 13.0283H4V10.9717H16.18Z' fill='%23E1E1E6'/%3E%3C/svg%3E%0A");
}

/* ===== L2 ===== */
.avm-tree__link--l2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  min-height: 65px;
  padding: 0 30px;
  border-bottom: 1px solid #E1E1E6;
  color: #323237;
  font-size: 18px;
  background: transparent;
}

/* ===== L3 ===== */
.avm-tree__link--l3 {
  display: block;
  font-family: var(--avm-font);
  font-size: 16px;
  line-height: 36px;
  font-weight: 400;
  color: #6C6C71;
  min-height: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #E1E1E6 !important;
  background: transparent;
  box-shadow: none;
}

.avm-tree__link--l3:hover,
.avm-tree__link--l3.is-active {
  color: var(--avm-red);
}

.avm-root .avm-tree > li:after {
  display: none !important;
}

.avm-tree__link--muted {
  opacity: .6;
  cursor: default;
}

.avm-tree__head {
  padding: 0 0 20px !important;
  margin: 0;
  font-family: var(--avm-font);
  font-size: 18px;
  font-weight: 700;
  color: #000;
  list-style: none;
  line-height: 21px;
  border: 0;
  background: transparent;
}

.avm-tree__flyout {
  position: absolute;
  left: 100%;
  top: 0;
  height: var(--avm-mega-h);
  /* 100% здесь = ширина L1 (344), нужен контейнер меню */
  width: calc(100cqi - var(--avm-col-l1));
  display: flex;
  flex-direction: row;
  align-items: stretch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(8px);
  transition:
    opacity .2s ease,
    transform .2s ease,
    visibility .2s;
  z-index: 4;
}

.avm-tree--l1 > .avm-tree__item.is-open > .avm-tree__flyout,
.avm-mega.is-open .avm-tree--l1 > .avm-tree__item.is-default > .avm-tree__flyout {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  z-index: 5;
}

.avm-tree--l1 > .avm-tree__item.is-open > .avm-tree__flyout {
  z-index: 10;
}

.avm-mega.is-open:has(.avm-tree--l1 > .avm-tree__item.is-open) .avm-tree--l1 > .avm-tree__item.is-default:not(.is-open) > .avm-tree__flyout {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(8px);
  z-index: 4;
}

.avm-tree--l2,
.avm-tree--l3 {
  background: #fff;
  border-left: 1px solid var(--avm-line);
  scrollbar-width: thin;
  scrollbar-color: var(--avm-scroll-thumb) var(--avm-scroll-track);
}

.avm-tree--l2::-webkit-scrollbar,
.avm-tree--l3::-webkit-scrollbar {
  width: 10px;
}

.avm-tree--l2::-webkit-scrollbar-track,
.avm-tree--l3::-webkit-scrollbar-track {
  background: var(--avm-scroll-track);
  border-radius: 10px;
}

.avm-tree--l2::-webkit-scrollbar-thumb,
.avm-tree--l3::-webkit-scrollbar-thumb {
  background: var(--avm-scroll-thumb);
  border-radius: 10px;
}

.avm-root .avm-tree--l2 {
  position: relative;
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  height: 100%;
  max-height: var(--avm-mega-h);
  padding: 20px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  z-index: 4;
}

.avm-tree__l3-slot {
  position: relative;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 100%;
  max-height: var(--avm-mega-h);
  background: #fff;
  border-left: 1px solid var(--avm-line);
  overflow: hidden;
}

.avm-root .avm-tree--l3 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 20px 24px 20px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition:
    opacity .15s ease,
    transform .15s ease;
  z-index: 5;
  scrollbar-width: thin;
  scrollbar-color: var(--avm-scroll-thumb) var(--avm-scroll-track);
}

.avm-tree--l1 > .avm-tree__item.is-open > .avm-tree__flyout .avm-tree--l3.is-shown,
.avm-mega.is-open:not(:has(.avm-tree--l1 > .avm-tree__item.is-open)) .avm-tree--l1 > .avm-tree__item.is-default > .avm-tree__flyout .avm-tree--l3.is-shown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.avm-tree--l2 > .avm-tree__item.is-hot > .avm-tree__link--l2 {
  color: var(--avm-red);
}

.avm-tree--l2 > .avm-tree__item.is-hot > .avm-tree__link--l2 .avm-tree__arrow {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.18 10.9717L10.8 5.46015L12.22 4L20 12L12.22 20L10.8 18.5398L16.18 13.0283H4V10.9717H16.18Z' fill='%23CC2233'/%3E%3C/svg%3E%0A");
}

.avm-tree--l1 > .avm-tree__item:hover > .avm-tree__link--l1,
.avm-tree--l1 > .avm-tree__item:focus-within > .avm-tree__link--l1,
.avm-tree--l1 > .avm-tree__item.is-open > .avm-tree__link--l1,
.avm-mega.is-open .avm-tree--l1 > .avm-tree__item.is-default > .avm-tree__link--l1 {
  background: var(--avm-red);
  color: #fff;
  border-bottom-color: var(--avm-red);
}

.avm-tree--l1 > .avm-tree__item:hover > .avm-tree__link--l1 .avm-tree__arrow,
.avm-tree--l1 > .avm-tree__item:focus-within > .avm-tree__link--l1 .avm-tree__arrow,
.avm-tree--l1 > .avm-tree__item.is-open > .avm-tree__link--l1 .avm-tree__arrow,
.avm-mega.is-open .avm-tree--l1 > .avm-tree__item.is-default > .avm-tree__link--l1 .avm-tree__arrow {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.18 10.9717L10.8 5.46015L12.22 4L20 12L12.22 20L10.8 18.5398L16.18 13.0283H4V10.9717H16.18Z' fill='white'/%3E%3C/svg%3E%0A");
}

.avm-mega.is-open:has(.avm-tree--l1 > .avm-tree__item.is-open) .avm-tree--l1 > .avm-tree__item.is-default:not(.is-open) > .avm-tree__link--l1 {
  background: transparent;
  color: #000;
  border-bottom-color: #D8D8DC;
}

.avm-mega.is-open:has(.avm-tree--l1 > .avm-tree__item.is-open) .avm-tree--l1 > .avm-tree__item.is-default:not(.is-open) > .avm-tree__link--l1 .avm-tree__arrow {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.18 10.9717L10.8 5.46015L12.22 4L20 12L12.22 20L10.8 18.5398L16.18 13.0283H4V10.9717H16.18Z' fill='%23E1E1E6'/%3E%3C/svg%3E%0A");
}

/* ===== Mobile ===== */
.avm-m-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #E8E8EC;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(12px);
  transition:
    opacity .22s ease,
    transform .22s ease,
    visibility .22s;
}

.avm-m-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.avm-m-overlay[hidden] {
  display: none !important;
}

.avm-m-overlay__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  background: #E1E1E6;
  flex: 0 0 auto;
  transition: background .18s ease;
}

/* L2 / L3 — белый бар */
.avm-m-overlay.is-deep .avm-m-overlay__bar {
  background: #fff;
}

.avm-m-back {
  border: 0;
  background: none;
  color: #CC2233;
  font: 400 16px/1.2 var(--avm-font);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding:0;
}

.avm-m-close {
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #111;
}

.avm-m-close svg {
  display: block;
}


.avm-m-overlay__body {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #E1E1E6;
  background: #fff;
}

.avm-m-overlay__scroller {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--avm-scroll-thumb) var(--avm-scroll-track);
}

.avm-m-overlay__scroller::-webkit-scrollbar {
  width: 6px;
}

.avm-m-overlay__scroller::-webkit-scrollbar-track {
  background: var(--avm-scroll-track);
  border-radius: 6px;
}

.avm-m-overlay__scroller::-webkit-scrollbar-thumb {
  background: var(--avm-scroll-thumb);
  border-radius: 6px;
}

.avm-m-list {
  min-height: 100%;
  will-change: transform, opacity;
}

.avm-m-list.is-enter-forward {
  animation: avm-slide-in-right .22s ease both;
}

.avm-m-list.is-enter-back {
  animation: avm-slide-in-left .22s ease both;
}

.avm-m-list.is-leave-forward {
  animation: avm-slide-out-left .2s ease both;
  position: absolute;
  inset: 0;
  width: 100%;
  pointer-events: none;
}

.avm-m-list.is-leave-back {
  animation: avm-slide-out-right .2s ease both;
  position: absolute;
  inset: 0;
  width: 100%;
  pointer-events: none;
}

@keyframes avm-slide-in-right {
  from { opacity: .35; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes avm-slide-in-left {
  from { opacity: .35; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes avm-slide-out-left {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-20px); }
}

@keyframes avm-slide-out-right {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

.avm-m-list a,
.avm-m-list button.avm-m-row {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr 18px;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid #D5D5DA;
  background: transparent;
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  color: #323237;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

/* Только мобильный L1 — не трогает --plain / --leaves */
.avm-m-list--l1 > a,
.avm-m-list--l1 > button.avm-m-row {
  border-bottom: 2px solid #CACACA !important;
}

.avm-m-list--l1 > a:hover,
.avm-m-list--l1 > button.avm-m-row:hover {
background: #CC2233 !important;
color: #fff !important;
}

.avm-m-list--l1 > a:hover .avm-m-chev,
.avm-m-list--l1 > button.avm-m-row:hover .avm-m-chev {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.18 10.9717L10.8 5.46015L12.22 4L20 12L12.22 20L10.8 18.5398L16.18 13.0283H4V10.9717H16.18Z' fill='white'/%3E%3C/svg%3E%0A");
}

.avm-m-list--plain a,
.avm-m-list--plain button.avm-m-row {
  grid-template-columns: 1fr 18px;
  min-height: 48px;
  background: #fff;
}

.avm-m-list--leaves a {
  grid-template-columns: 1fr;
  background: #fff;
  font-weight: 400;
  color: var(--avm-gray);
  min-height: 44px;
  padding-top: 10px;
    padding-bottom: 10px;
}

.avm-m-list .avm-m-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.avm-m-list .avm-m-thumb:not(:has(img)) {
  box-shadow: inset 0 0 0 1px #E4E4E8;
}

.avm-m-list .avm-m-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avm-m-list .avm-m-chev {
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.18 10.9717L10.8 5.46015L12.22 4L20 12L12.22 20L10.8 18.5398L16.18 13.0283H4V10.9717H16.18Z' fill='%23B9B9B9'/%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
  border: 0;
  flex: 0 0 auto;
}

.avm-m-list .is-open {
  background: var(--avm-red);
  color: #fff;
}

.avm-m-list .is-open .avm-m-chev {
  border-color: #fff;
}

.avm-m-title {
  padding: 14px 16px 16px 16px;
  font-size: 20px;
  font-weight: 600;
  background: #fff;
}

@media (max-width: 1200px) {
  .avm-container,
  .avm-mega {
    display: none;
  }
}

@media (min-width: 1201px) {
  .avm-m-overlay {
    display: none !important;
  }
}

/*

.filter-block .sub .scroll-wrapper {
  min-height: 52px;
}

*/