/* =========================================================================
   Б2БТАРА — ВЫПАДАЮЩЕЕ МЕНЮ (мега-меню «Каталог» + дропдауны Толщина/Объём/Цвет)
   Подключается ПОСЛЕ styles.css. Всё под .bt-root, префикс .bt-nd / .bt-mm —
   0 конфликтов с темой Woodmart. Цвета/шрифты/радиусы/тени — из токенов styles.css.
   ========================================================================= */

/* --- контейнер навигации: точка отсчёта для мега-панели на всю ширину --- */
.bt-root .hnav{position:relative;z-index:40}

/* --- обёртка пункта с выпадашкой (аналог .menu-item-has-children у Woodmart) --- */
.bt-root .bt-nd{position:relative;height:100%;display:flex;align-items:center}

/* стрелка-шеврон крутится, когда меню раскрыто */
.bt-root .bt-nd > a.nav svg{transition:transform .2s ease}
.bt-root .bt-nd.is-open > a.nav svg,
.bt-root .bt-nd:hover > a.nav svg,
.bt-root .bt-nd:focus-within > a.nav svg{transform:rotate(180deg);color:var(--red)}

/* активная (раскрытая) вкладка подсвечивается как ссылка меню */
.bt-root .bt-nd.is-open > a.nav,
.bt-root .bt-nd:hover > a.nav,
.bt-root .bt-nd:focus-within > a.nav{color:var(--red)}

/* ===================== ПАНЕЛЬ (общий каркас) ===================== */
.bt-root .bt-nd__panel{
  position:absolute;top:100%;left:0;margin-top:0;
  background:var(--panel);border:1px solid var(--line);
  border-radius:0 0 var(--r-lg) var(--r-lg);box-shadow:var(--sh-2);
  padding:18px;z-index:60;
  /* по умолчанию скрыта: гасим и делаем некликабельной, плавно проявляем */
  opacity:0;visibility:hidden;transform:translateY(6px);pointer-events:none;
  transition:opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
/* красная волосяная линия сверху панели — фирменный «скальпель» */
.bt-root .bt-nd__panel::before{
  content:"";position:absolute;top:-1px;left:16px;right:16px;height:2px;
  background:var(--red);border-radius:2px}

/* раскрытие: hover, focus-within (клавиатура) или класс .is-open (JS/тап) */
.bt-root .bt-nd:hover > .bt-nd__panel,
.bt-root .bt-nd:focus-within > .bt-nd__panel,
.bt-root .bt-nd.is-open > .bt-nd__panel{
  opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto;
  transition:opacity .18s ease, transform .18s ease, visibility 0s;
}
/* «мостик» под пунктом, чтобы курсор не терял панель на зазоре nav↔панель.
   position:relative на ссылке обязателен: иначе у мега-пункта (.bt-nd--mega{position:static})
   мостик привязался бы к .hnav и растянулся на всю ширину экрана, самопроизвольно
   раскрывая мега-меню при наведении в любой точке под навбаром. */
.bt-root .bt-nd > a.nav{position:relative}
.bt-root .bt-nd > a.nav::after{content:"";position:absolute;left:0;right:0;top:100%;height:10px}

/* ===================== КОЛОНКИ ССЫЛОК (общее для панелей) ===================== */
.bt-root .bt-mm__col{min-width:170px}
.bt-root .bt-mm__h{
  font-family:'Onest';font-weight:700;font-size:12px;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);margin:0 0 10px;padding-bottom:9px;border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:8px}
.bt-root .bt-mm__h::before{content:"";width:12px;height:2px;background:var(--red);flex:0 0 auto}

.bt-root .bt-mm__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.bt-root .bt-mm__list a{
  display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:8px;
  font:600 14px 'Onest';color:var(--ink);line-height:1.2;white-space:nowrap;transition:background .15s,color .15s}
.bt-root .bt-mm__list a small{font:500 12px 'Golos';color:var(--muted);margin-left:auto;padding-left:12px}
.bt-root .bt-mm__list a:hover{background:var(--red-050);color:var(--red)}
.bt-root .bt-mm__list a:hover small{color:var(--red)}
/* ссылка «Смотреть все …» с красной стрелкой */
.bt-root .bt-mm__all{margin-top:6px;font:700 13.5px 'Onest';color:var(--red);display:inline-flex;align-items:center;gap:6px;padding:7px 9px}
.bt-root .bt-mm__all svg{width:15px;height:15px}
.bt-root .bt-mm__all:hover{text-decoration:underline}

/* ===================== МЕГА-МЕНЮ «КАТАЛОГ» (во всю ширину) ===================== */
.bt-root .bt-nd--mega{position:static}                 /* якорим панель к .hnav, а не к пункту */
.bt-root .bt-nd--mega > .bt-nd__panel{
  left:0;right:0;width:auto;
  display:grid;grid-template-columns:1fr 1fr 1fr minmax(240px,.9fr);gap:26px;padding:24px 28px}

/* промо-карточка справа в меге */
.bt-root .bt-mm__promo{
  background:var(--graphite);color:#fff;border-radius:var(--r);padding:20px;
  display:flex;flex-direction:column;gap:12px;position:relative;overflow:hidden}
.bt-root .bt-mm__promo::after{content:"";position:absolute;right:-40px;top:-40px;width:150px;height:150px;
  background:radial-gradient(circle,rgba(207,0,13,.35),transparent 70%)}
.bt-root .bt-mm__promo .eb{font:600 11px 'Onest';letter-spacing:.09em;text-transform:uppercase;color:#FF6A72}
.bt-root .bt-mm__promo h4{font-family:'Onest';font-weight:800;font-size:19px;line-height:1.15;color:#fff;margin:0}
.bt-root .bt-mm__promo p{font-size:13px;color:#C7CCD3;margin:0;line-height:1.5}
.bt-root .bt-mm__promo .btn{margin-top:auto}

/* ===================== ДРОПДАУН «ОБЪЁМ» — сетка чипов ===================== */
.bt-root .bt-nd__panel--vol{min-width:300px}
.bt-root .bt-mm__chips{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:2px}
.bt-root .bt-mm__chips a{
  display:flex;align-items:center;justify-content:center;padding:9px 4px;border-radius:8px;
  border:1.5px solid var(--line);font:700 13.5px 'Onest';color:var(--ink);
  font-variant-numeric:tabular-nums;transition:.15s}
.bt-root .bt-mm__chips a:hover{border-color:var(--red);color:var(--red);background:var(--red-050)}

/* ===================== ДРОПДАУН «ЦВЕТ» — образцы цвета ===================== */
.bt-root .bt-nd__panel--color{min-width:230px}
.bt-root .bt-mm__list a .dot{width:16px;height:16px;border-radius:5px;flex:0 0 auto;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}

/* ===================== КОМПАКТНЫЕ ДРОПДАУНЫ (Толщина/Цвет) ===================== */
.bt-root .bt-nd__panel--simple{min-width:250px;padding:14px}
.bt-root .bt-nd__panel--simple .bt-mm__h{margin-top:2px}

/* ===================== МОБИЛЬНЫЙ АККОРДЕОН (внутри бургер-меню) ===================== */
/* строка-заголовок с раскрытием */
.bt-root .bt-macc{border-bottom:1px solid var(--line)}
.bt-root .bt-macc__t{
  display:flex;align-items:center;justify-content:space-between;width:100%;
  padding:13px 4px;font:600 16px 'Onest';color:var(--ink);background:none;border:0;cursor:pointer;text-align:left}
.bt-root .bt-macc__t svg{width:20px;height:20px;color:var(--muted);transition:transform .2s}
.bt-root .bt-macc.is-open .bt-macc__t{color:var(--red)}
.bt-root .bt-macc.is-open .bt-macc__t svg{transform:rotate(180deg);color:var(--red)}
/* тело: свёрнуто по умолчанию, раскрывается по .is-open */
.bt-root .bt-macc__b{display:none;padding:2px 4px 12px}
.bt-root .bt-macc.is-open .bt-macc__b{display:block}
.bt-root .bt-macc__b a{
  display:block;padding:9px 12px !important;font:600 14.5px 'Onest' !important;color:var(--body) !important;
  border:0 !important;border-radius:8px}
.bt-root .bt-macc__b a:hover{background:var(--red-050);color:var(--red) !important}
.bt-root .bt-macc__grp{font:700 11px 'Onest';letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:10px 12px 3px}
.bt-root .bt-macc__b .dot{display:inline-block;width:13px;height:13px;border-radius:4px;margin-right:8px;vertical-align:-1px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}

/* ===================== АДАПТИВ МЕГА-ПАНЕЛИ ===================== */
@media(max-width:1180px){
  .bt-root .bt-nd--mega > .bt-nd__panel{grid-template-columns:1fr 1fr minmax(220px,.9fr)}
  .bt-root .bt-nd--mega .bt-mm__col--vol{display:none}   /* объём есть отдельным пунктом меню */
}
/* ниже 1100px десктоп-навигация скрыта (styles.css) → работает аккордеон в бургере,
   десктоп-панели не показываются, спец-правил не требуется */
