/* catalog_flyout — full-width mega-panel with 3-column cards */
.catalog_flyout__module {
  position: relative;
  display: inline-block;
}

.catalog_flyout__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #e34c26;
  color: #fff;
  border: none;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  line-height: 1.2;
  transition: background-color 0.15s ease;
}

.catalog_flyout__trigger:hover,
.catalog_flyout__trigger[aria-expanded="true"] {
  background: #c43d1e;
}

.catalog_flyout__trigger-icon { display: inline-flex; }

.catalog_flyout__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 80;
}
.catalog_flyout__backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.catalog_flyout__panel {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  max-height: 90vh;
  background: #ffffff;
  border-bottom: 2px solid #e34c26;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  transform: translateY(-105%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.28s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.45s;
  z-index: 90;
  overflow: hidden;
  display: flex;
  will-change: transform, opacity;
}
.catalog_flyout__panel.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.32s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0s;
}

.catalog_flyout__panel-inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.catalog_flyout__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #e3e6ea;
}
.catalog_flyout__title { margin: 0; font-size: 20px; color: #222; }

.catalog_flyout__close {
  background: transparent;
  border: 1px solid #c7ccd4;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5b6270;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.catalog_flyout__close:hover { background: #f7f8fa; color: #1a1d21; }

.catalog_flyout__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.catalog_flyout__empty,
.catalog_flyout__error,
.catalog_flyout__loading {
  padding: 32px 16px;
  text-align: center;
  color: #5b6270;
  font-size: 14px;
}
.catalog_flyout__error { color: #c62828; }

/* 3-column grid of category cards (ampermetr-style compact rows) */
.catalog_flyout__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .catalog_flyout__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .catalog_flyout__grid { grid-template-columns: minmax(0, 1fr); }
}

/* Category card (root-level) */
.catalog_flyout__card {
  position: relative;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  padding: 6px 10px;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.catalog_flyout__card:hover {
  border-color: #e3e6ea;
  background: #fdfdfd;
}

.catalog_flyout__card.is-expanded {
  border-color: #e34c26;
  background: #fff;
  z-index: 3;
}

.catalog_flyout__card-head {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
}

.catalog_flyout__card-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 4px;
  background: #f7f8fa;
}

.catalog_flyout__card-fallback-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f7f8fa;
  border-radius: 4px;
}

.catalog_flyout__card-title {
  color: #1a1d21;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
  min-width: 0;
  overflow-wrap: break-word;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}

.catalog_flyout__card-title:hover {
  color: #e34c26;
  text-decoration: none;
}

.catalog_flyout__card-name { font-weight: 600; }

.catalog_flyout__count {
  color: #999;
  font-weight: 400;
  font-size: 12px;
  white-space: nowrap;
}

.catalog_flyout__card-chevron {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: #c7ccd4;
  transition: color 0.15s ease, transform 0.2s ease;
}

.catalog_flyout__card.has-kids:hover .catalog_flyout__card-chevron {
  color: #777;
}

.catalog_flyout__card.is-expanded .catalog_flyout__card-chevron {
  color: #e34c26;
  transform: rotate(90deg);
}

.catalog_flyout__card.has-kids {
  cursor: pointer;
}

/* L2 sublist — overlay popup below card (не сдвигает соседние карточки) */
.catalog_flyout__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog_flyout__sub--l2 {
  position: absolute;
  top: calc(100% + 2px);
  left: -1px;
  right: -1px;
  z-index: 4;
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e34c26;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  animation: catalog_flyout__sub-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top center;
}

@keyframes catalog_flyout__sub-in {
  from { opacity: 0; transform: translateY(-6px) scaleY(0.98); }
  to   { opacity: 1; transform: translateY(0) scaleY(1); }
}

.catalog_flyout__sub--l2 > li {
  margin-bottom: 2px;
}

.catalog_flyout__sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog_flyout__sub-link {
  flex: 1;
  display: block;
  padding: 6px 4px;
  color: #1a1d21;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 4px;
}

.catalog_flyout__sub-link:hover {
  color: #e34c26;
  background: rgba(251, 231, 223, 0.5);
  text-decoration: none;
}

.catalog_flyout__sub-toggle {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #e3e6ea;
  background: #fff;
  color: #5b6270;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.catalog_flyout__sub-toggle:hover {
  background: #fbe7df;
  border-color: #e34c26;
  color: #e34c26;
}

/* L3 list nested */
.catalog_flyout__sub--l3 {
  margin-top: 4px;
  margin-left: 12px;
  padding: 0 0 0 12px;
  border-top: none;
  border-left: 2px solid #fbe7df;
}

.catalog_flyout__sub--l3 .catalog_flyout__sub-link {
  font-size: 12px;
  color: #5b6270;
  padding: 4px;
}

.catalog_flyout__sub--l3 .catalog_flyout__sub-link:hover {
  color: #e34c26;
  background: transparent;
}
