@charset "UTF-8";
/* =====================================================
   all_main-menu.css — Sidebar-меню каталога
   Путь: /css2/all_main-menu.css    Версия: 5.4
   ===================================================== */

/* ═══ CSS-переменные sidebar ═══ */
:root {
  --sb-w: 260px;
  --sb-bg: #f3f6fb;
  --sb-border: #c5cdd9;
  --sb-hover: #e4ebf5;
  --sb-text: #0f172a;
  --sb-text-sec: #1e293b;
  --sb-text-muted: #64748b;
  --sb-link: #1e40af;
  --sb-icon: #3b5076;
  --sb-icon-hover: #1e40af;
  --sb-icon-sub: #64748b;
  --sb-accent: #1e40af;
  --sb-accent-soft: rgba(30,64,175,0.1);
  --sb-divider: #cbd5e1;
  --sb-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.05);
  --sb-sale: #dc2626;
  --sb-sale-bg: rgba(220,38,38,0.06);
  --sb-sale-border: rgba(220,38,38,0.15);
  --sb-group-open-bar: #1e40af;
  /* Фон-паттерн */
  --bg-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23475569' stroke-width='0.5'%3E%3Ccircle cx='30' cy='30' r='12'/%3E%3Cpath d='M30 8v44M8 30h44'/%3E%3Crect x='18' y='18' width='24' height='24' rx='3' transform='rotate(45 30 30)'/%3E%3C/g%3E%3C/svg%3E");
  --bg-pattern-opacity: 0.07;
}
[data-theme="dark"] {
  --sb-bg: #0f1525;
  --sb-border: #1a2438;
  --sb-hover: rgba(100,150,255,0.06);
  --sb-text: #c8d4e8;
  --sb-text-sec: #7a8ea8;
  --sb-text-muted: #4a5c74;
  --sb-link: #5e9aff;
  --sb-icon: #4e6580;
  --sb-icon-hover: #5e9aff;
  --sb-icon-sub: #3a4e68;
  --sb-accent: #5e9aff;
  --sb-accent-soft: rgba(94,154,255,0.1);
  --sb-divider: #182030;
  --sb-shadow: 0 1px 4px rgba(0,0,0,0.3);
  --sb-sale: #f0864a;
  --sb-sale-bg: rgba(240,134,74,0.07);
  --sb-sale-border: rgba(240,134,74,0.15);
  --sb-group-open-bar: #5e9aff;
  --bg-pattern-opacity: 0.04;
}


/* ═══════════════════════════════════════════
   ANTI-JITTER: плавная смена высоты header
   Перекрывает all_HEADER.css — sticky header
   не дёргается при compact/expand
   ═══════════════════════════════════════════ */
.header {
  will-change: contents;
}
.organization-information {
  transition: padding 0.15s ease;
}
.header--compact .menu-organization {
  /* Переход через max-height вместо display:none — без рывка */
  max-height: 0 !important;
  opacity: 0 !important;
  overflow: hidden;
  padding: 0;
  margin: 0;
  pointer-events: none;
  transition: max-height 0.15s ease, opacity 0.1s ease;
}


/* ═══ FLEX-ОБЁРТКА СТРАНИЦЫ + ВЕКТОРНЫЙ ФОН ═══ */
.page-layout {
  display: flex;
  position: relative;
  max-width: var(--page-max-w, 1500px);
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h, 160px));
}
/* Фон через ::before — opacity не влияет на контент */
.page-layout::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* background-image: var(--bg-pattern); */
  background-size: 60px 60px;
  background-repeat: repeat;
  opacity: var(--bg-pattern-opacity);
}

.page-layout > main {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}


/* ═══ OVERLAY (mobile) ═══ */
.catalog-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,16,52,0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.catalog-sidebar-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}


/* ═══════════════════════════════════════════
   SIDEBAR — desktop
   ═══════════════════════════════════════════ */
.catalog-sidebar {
  width: var(--sb-w);
  flex-shrink: 0;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  box-shadow: var(--sb-shadow);
  overflow: hidden;
  position: sticky;
  top: var(--header-h, 160px);
  height: calc(100vh - var(--header-h, 160px));
  display: flex;
  flex-direction: column;
  transition: background 0.3s, border-color 0.3s, width 0.25s ease, opacity 0.25s ease;
  z-index: 1;
}
.catalog-sidebar--hidden {
  width: 0;
  border-right: none;
  box-shadow: none;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}


/* ─── Head ─── */
.catalog-sidebar__head {
  padding: 12px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sb-divider);
  flex-shrink: 0;
}
.catalog-sidebar__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sb-text-muted);
}
.catalog-sidebar__close {
  display: none;
  width: 28px; height: 28px;
  border: none; background: none;
  color: var(--sb-text-muted);
  cursor: pointer; border-radius: 6px;
  align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
}
.catalog-sidebar__close:hover { background: var(--sb-hover); }


/* ─── Groups list ─── */
.catalog-sidebar__groups {
  list-style: none;
  padding: 5px 6px 4px;
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.catalog-sidebar__group + .catalog-sidebar__group {
  border-top: 1px solid var(--sb-divider);
  margin-top: 1px;
  padding-top: 1px;
}


/* ─── Group button ─── */
.catalog-sidebar__group-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  background: transparent;
  color: var(--sb-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1.35;
}
.catalog-sidebar__group-btn:hover { background: var(--sb-hover); }
.catalog-sidebar__group-btn:hover .catalog-sidebar__icon { color: var(--sb-icon-hover); }

.catalog-sidebar__group.is-open > .catalog-sidebar__group-btn {
  border-left: 2px solid var(--sb-group-open-bar);
  padding-left: 6px;
}
.catalog-sidebar__group.is-open > .catalog-sidebar__group-btn .catalog-sidebar__arrow {
  transform: rotate(90deg);
}

.catalog-sidebar__icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--sb-icon); transition: color 0.15s; }
.catalog-sidebar__icon svg { width: 18px; height: 18px; display: block; }
.catalog-sidebar__arrow { width: 12px; height: 12px; margin-left: auto; flex-shrink: 0; color: var(--sb-text-muted); transition: transform 0.25s ease; opacity: 0.5; }
.catalog-sidebar__group-text { flex: 1; min-width: 0; }


/* ─── Subitems ─── */
.catalog-sidebar__items { display: none; padding: 0 0 4px 0; }
.catalog-sidebar__group.is-open > .catalog-sidebar__items { display: block; }

.catalog-sidebar__link {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 8px 3px 10px; font-size: 12.5px;
  color: var(--sb-text-sec); text-decoration: none;
  border-radius: 6px; transition: color 0.15s, background 0.15s; line-height: 1.35;
}
.catalog-sidebar__link:hover { color: var(--sb-link); background: var(--sb-hover); }
.catalog-sidebar__link.is-active { color: var(--sb-accent); font-weight: 600; background: var(--sb-accent-soft); }

.catalog-sidebar__sub-icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--sb-icon-sub); transition: color 0.15s; }
.catalog-sidebar__sub-icon svg { width: 15px; height: 15px; display: block; }
.catalog-sidebar__link:hover .catalog-sidebar__sub-icon { color: var(--sb-link); }
.catalog-sidebar__link.is-active .catalog-sidebar__sub-icon { color: var(--sb-accent); }

.catalog-sidebar__divider { font-size: 10px; color: var(--sb-text-muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 8px 2px 10px; margin-top: 2px; }

.catalog-sidebar__sale {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 6px 10px; padding: 8px 12px;
  background: var(--sb-sale-bg); border: 1px solid var(--sb-sale-border);
  border-radius: 6px; color: var(--sb-sale); font-size: 12.5px; font-weight: 600;
  text-decoration: none; transition: background 0.15s, border-color 0.15s; flex-shrink: 0;
}
.catalog-sidebar__sale:hover { background: rgba(232,93,43,0.1); border-color: rgba(232,93,43,0.2); }
.catalog-sidebar__sale svg { flex-shrink: 0; }

.catalog-sidebar__all-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 10px; font-size: 12px;
  color: var(--sb-link); text-decoration: none; font-weight: 500;
}
.catalog-sidebar__all-link:hover { text-decoration: underline; }


/* ═══ SIDEBAR HIDDEN (страницы товаров) ═══
   Sidebar скрыт по умолчанию, main на всю ширину.
   Кнопка «Каталог» открывает sidebar поверх контента (overlay).
   JS: all_menu.js v5.9 использует openSidebar()/closeSidebar(). */

.page-layout--sidebar-hidden > main {
  margin-left: 0;
}
@media (min-width: 1281px) {
  .page-layout--sidebar-hidden > .catalog-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
    overflow: hidden;
  }
  .page-layout--sidebar-hidden > .catalog-sidebar.is-open {
    transform: translateX(0);
  }
  .page-layout--sidebar-hidden > .catalog-sidebar .catalog-sidebar__close {
    display: flex;
  }
  .page-layout--sidebar-hidden .catalog-sidebar-overlay {
    display: block;
  }
}


/* ═══ КНОПКА «ВВЕРХ» ═══ */
.up-button {
  position: fixed; right: 24px; bottom: 28px; z-index: 1030;
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: var(--sb-accent); color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transform: translateY(16px) scale(0.85);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
}
.up-button--visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.up-button:hover { background: var(--sb-link); box-shadow: 0 4px 16px rgba(0,0,0,0.2); transform: translateY(-2px) scale(1.05); }
.up-button:active { transform: translateY(0) scale(0.97); }
.up-button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .up-button { background: #334155; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
[data-theme="dark"] .up-button:hover { background: #475569; }


/* ═══ ЛОГОТИП — hover ═══ */
.header__logo { transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.header__logo:hover { transform: scale(1.03); }
.header__logo-img { transition: filter 0.4s ease, transform 0.4s ease; }
.header__logo:hover .header__logo-img {
  filter: drop-shadow(0 0 8px rgba(30,64,175,0.35)) brightness(1.05);
  transform: rotate(-2deg) scale(1.08);
}
[data-theme="dark"] .header__logo:hover .header__logo-img {
  filter: drop-shadow(0 0 12px rgba(94,154,255,0.4)) brightness(1.15);
}
/* Совместимость — старый класс .logo */
.logo { transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.logo:hover { transform: scale(1.03); }
.logo__picture { transition: filter 0.4s ease, transform 0.4s ease; }
.logo:hover .logo__picture {
  filter: drop-shadow(0 0 8px rgba(30,64,175,0.35)) brightness(1.05);
  transform: rotate(-2deg) scale(1.08);
}


/* ═══ STICKY «ФИЛЬТРЫ» — кнопка видна при прокрутке ═══ */
@media (max-width: 820px) {
  .sidebar-toggle {
    position: sticky;
    top: var(--header-h, 60px);
    z-index: 10;
  }
}


/* ═══ MOBILE ≤ 1280px ═══ */
@media (max-width: 1280px) {
  .page-layout { display: block; }
  .catalog-sidebar--hidden {
    width: 290px; opacity: 1; pointer-events: auto;
    border-right: 1px solid var(--sb-border);
  }
  .catalog-sidebar {
    position: fixed; top: 0; left: 0;
    height: 100vh; width: 290px; z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s;
    overflow: hidden;
  }
  .catalog-sidebar.is-open { transform: translateX(0); }
  .catalog-sidebar-overlay { display: block; }
  .catalog-sidebar__close { display: flex; }
  .up-button { right: 16px; bottom: 20px; width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .catalog-sidebar { width: 100vw; max-width: 100vw; }
}

/* ═══ Reduced Motion ═══ */
@media (prefers-reduced-motion: reduce) {
  .catalog-sidebar, .catalog-sidebar-overlay, .catalog-sidebar__group-btn,
  .catalog-sidebar__link, .catalog-sidebar__arrow, .up-button,
  .header__logo, .header__logo-img, .logo, .logo__picture,
  .header--compact .menu-organization, .organization-information {
    transition: none !important;
  }
}
