/* ===========================
   Рядок розділів у шапці (десктоп): "Всі категорії" + топ-розділи з випадайками + пілюлі
   =========================== */
/* рядок лишається центрованим (як і раніше в navbar.css); пілюлі просто відділені відступом */
.categories-navbar .nav-pill--hot { margin-left: 10px; }

.categories-navbar .all-categories-btn {
  background: linear-gradient(120deg, #667eea, #764ba2);
  color: #fff;
  border-radius: 10px;
  margin: 6px 6px 6px 0;
  padding: 8px 16px;
  font-weight: 700;
}
.categories-navbar .all-categories-btn:hover { color: #fff; filter: brightness(1.05); }

/* розділ */
.sec-link { border-radius: 10px; margin: 4px 0; padding: 8px 12px; font-weight: 600; white-space: nowrap; }
.sec-item:hover > .sec-link,
.sec-item:focus-within > .sec-link { background: rgba(102, 126, 234, .1); color: #764ba2; }
.sec-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  flex-shrink: 0;
}
.sec-chevron { display: none; }

/* випадайка розділу */
.sec-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1050;
  width: 520px;
  max-width: calc(100vw - 48px);
  background: #fff;
  border: 1px solid #e6e8f0;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(30, 20, 80, .18);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
/* "місток", щоб випадайка не закривалась, поки курсор іде до неї */
.sec-dropdown::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.sec-item:hover > .sec-dropdown,
.sec-item:focus-within > .sec-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
/* останні розділи праворуч — випадайку вирівнюємо по правому краю, щоб не вилазила за екран */
.sec-item:nth-last-child(-n+6) > .sec-dropdown { left: auto; right: 0; }

.sec-dropdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 4px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid #eef0f6;
}
.sec-dropdown-head b { font-size: 15px; color: #1f2133; }
.sec-dropdown-head a { font-size: 13px; color: #667eea; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sec-dropdown-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.sec-dropdown-cat {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  color: #1f2133;
  text-decoration: none;
  font-size: 13.5px;
  min-width: 0;
}
.sec-dropdown-cat:hover { background: rgba(102, 126, 234, .08); color: #764ba2; text-decoration: none; }
.sec-dropdown-cat img,
.sec-dropdown-noimg {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: contain;
  background: #f4f5fb;
}
.sec-dropdown-noimg { display: grid; place-items: center; color: #b4b8cc; }
.sec-dropdown-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sec-dropdown-count { font-size: 12px; color: #8a8ea6; font-variant-numeric: tabular-nums; }

/* пілюлі праворуч */
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  margin: 0 3px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}
.nav-pill:hover { text-decoration: none; transform: translateY(-1px); }
.nav-pill--hot { color: #fff; background: linear-gradient(120deg, #ff5f6d, #c2185b); box-shadow: 0 4px 12px rgba(229, 72, 77, .3); }
.nav-pill--hot:hover { color: #fff; box-shadow: 0 6px 16px rgba(229, 72, 77, .4); }
.nav-pill--new { color: #0f6b52; background: #d7f5ea; }
.nav-pill--new:hover { color: #0f6b52; }

.sec-link:focus-visible,
.nav-pill:focus-visible,
.sec-dropdown a:focus-visible { outline: 3px solid #667eea; outline-offset: 2px; }

/* вужчі десктопи (контейнер ~960px): без іконок і без "Новинок", щоб рядок вміщався */
@media (max-width: 1199px) {
  .sec-link { padding: 8px 9px; }
  .sec-ico { display: none; }
  .nav-pill--new { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sec-dropdown, .nav-pill, .sec-chevron { transition: none; }
}
