/* ToyOptom — шапка (18.10.2026): перенесено из чанка header-page-test без изменений, чтобы браузер запоминал файл. */
:root { --nh-tx:var(--tn-ink,#232830); --nh-mut:var(--tn-mut,#6B7078); --nh-or:var(--tn-acc,#7468FF); --nh-or-d:var(--tn-acc-h,#5F52F0); --nh-cream:var(--tn-acc-soft,#ECEAFF); --nh-soft:var(--tn-bg,#F4F4F2); --nh-line:var(--tn-line,#E4E2DC); --nh-dark:var(--tn-ink,#232830); --nh-ok:var(--tn-ok,#1FA55B); --nh-tab:58px; }
html.nh-on body { height:auto; min-height:100vh; }
.nh, .nh-bar, .nh-tab, .nh-shade { font-family:'Manrope', Arial, sans-serif; color:var(--nh-tx); line-height:1.3; box-sizing:border-box; }
.nh *, .nh-bar *, .nh-tab * { box-sizing:border-box; }
.nh a, .nh-bar a, .nh-tab a { color:inherit; text-decoration:none; }
.nh button, .nh-bar button, .nh-tab button { font:inherit; color:inherit; cursor:pointer; margin:0; }
.nh ul, .nh li, .nh-bar ul, .nh-bar li { list-style:none; margin:0; padding:0; }
.nh-w { max-width:1320px; margin:0 auto; padding:0 24px; }
.nh-i { width:22px; height:22px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.nh-old { display:none !important; }
/* старое мобильное меню и старый каталог: не показываем и не даём попасть в них с клавиатуры */
#mainmenu0001, .catalog_block { display:none !important; }

/* тонкая полоска */
.nh-bar { background:var(--nh-soft); font-size:13px; color:var(--nh-mut); }
.nh-bar .nh-w { display:flex; align-items:center; gap:22px; height:36px; }
.nh-links, .nh-links ul { display:flex; align-items:center; gap:22px; }
.nh-bar a:hover { color:var(--nh-tx); }
.nh-links .nh-price { color:var(--nh-tx); font-weight:600; }
.nh-cont { margin-left:auto; display:flex; align-items:center; gap:18px; white-space:nowrap; }
.nh-cont .nh-tel { color:var(--nh-tx); font-weight:700; font-size:14px; }
.nh-sh { display:none; }
.nh-cont .nh-soc { display:inline-flex; align-items:center; gap:8px; }
.nh-cont .nh-soc i { font-size:20px; line-height:1; color:var(--nh-tx); }
.nh-cont .nh-soc:hover i { color:var(--nh-or); }
.nh-cont .nh-soc span { display:none; }
.nh-cont { gap:14px; }

/* основная линия */
.nh { position:sticky; top:0; z-index:500; background:#fff; border-bottom:1px solid var(--nh-line); }
.nh-main { display:flex; align-items:center; gap:16px; height:72px; }
.nh-logo { display:flex; align-items:center; gap:9px; flex:none; font-size:23px; font-weight:800; letter-spacing:-.5px; color:var(--nh-tx) !important; white-space:nowrap; }
.nh-logo svg { display:block; flex:none; }
.nh-logo .nh-mk { width:36px; height:36px; }
.nh-logo .nh-wm { width:auto; height:20px; }
.nh-burger, .nh-call { display:none; }
.nh-cat { display:flex; align-items:center; gap:9px; flex:none; height:44px; padding:0 18px; border:0; border-radius:8px; background:var(--nh-dark); color:#fff !important; font-size:15px; font-weight:600; }
.nh-cat:hover { background:#000; }
.nh-cat .nh-i-m { width:18px; height:18px; fill:currentColor; stroke:none; } /* значок каталога: 4 залитых квадрата, легче контурных */
.nh-cat .nh-i-x { display:none; }
.nh.nh-open .nh-cat .nh-i-x { display:block; }
.nh.nh-open .nh-cat .nh-i-m { display:none; }
.nh-sw { flex:1 1 0; min-width:0; }
.nh-s { display:flex; align-items:center; height:44px; margin:0; padding:0 3px 0 14px; background:var(--nh-soft); border:1px solid transparent; border-radius:8px; box-sizing:border-box; }
.nh-s:focus-within { background:#fff; border-color:var(--nh-or); }
.nh-s-l { color:var(--nh-mut); }
.nh-s input[type="text"] { flex:1 1 0; min-width:0; height:36px; margin:0; padding:0 10px; border:0; outline:0; background:none; font:inherit; font-size:16px; color:var(--nh-tx); border-radius:0; }
.nh-s input::placeholder { color:var(--tn-pale,#858B94); }
.nh-s-x { display:none; flex:none; width:34px; height:36px; padding:0; border:0; background:none; font-size:24px; line-height:1; color:var(--nh-mut) !important; }
.nh-s.has-v .nh-s-x { display:block; }
.nh-s-go { flex:none; height:36px; padding:0 20px; border:0; border-radius:6px; background:var(--nh-or); color:#fff !important; font-size:15px; font-weight:700; }
.nh-s-go:hover { background:var(--nh-or-d); }
.nh-acts { display:flex; align-items:center; gap:4px; flex:none; margin-right:-10px; } /* последняя кнопка (корзина) встаёт текстом на правый край */
.nh-ic { position:relative; display:flex; align-items:center; gap:8px; height:44px; padding:0 10px; border-radius:8px; font-size:14px; font-weight:600; white-space:nowrap; }
.nh-ic:hover { background:var(--nh-soft); }
.nh-ic-t { max-width:120px; overflow:hidden; text-overflow:ellipsis; }
.nh-prof { color:var(--nh-mut) !important; }
.nh-prof.is-in { color:var(--nh-tx) !important; }
.nh-prof.is-in .nh-i { stroke:var(--nh-or); fill:var(--nh-or); }
.nh-prof.is-in::after { content:""; position:absolute; left:25px; top:9px; width:9px; height:9px; border-radius:50%; background:var(--nh-ok); border:2px solid #fff; }
.nh-n { font-style:normal; min-width:20px; height:20px; padding:0 5px; border-radius:999px; background:var(--nh-or); color:#fff; font-size:12px; font-weight:800; display:inline-flex; align-items:center; justify-content:center; }
.nh-cart.is-empty .nh-sum, .nh-cart.is-empty .nh-n, .nh-n:empty { display:none; }
/* избранное в шапке: на узком компьютере только значок с числом */
@media (max-width:1199px) { .nh-fav .nh-ic-t { display:none; } }

/* каталог */
.nh-shade { display:none; position:fixed; left:0; top:0; right:0; bottom:0; z-index:490; background:rgba(0,0,0,.35); }
.nh-shade.on { display:block; }
.nh-drop { display:none; position:absolute; left:0; right:0; top:100%; background:#fff; border-top:1px solid var(--nh-line); box-shadow:0 18px 30px rgba(0,0,0,.14); padding:18px 0 24px; max-height:calc(100vh - 120px); overflow-y:auto; }
.nh.nh-open .nh-drop { display:block; }
.nh-cl { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:4px 16px; }
.nh-c a { display:flex; align-items:center; gap:12px; padding:6px 8px; border-radius:6px; font-size:15px; font-weight:500; line-height:1.25; }
.nh-c a:hover { background:var(--nh-soft); }
.nh-c img { flex:none; width:52px; height:39px; border-radius:4px; object-fit:cover; background:var(--nh-soft); }
.nh-c30 { order:-1; }
.nh-c30 a { background:var(--nh-cream); font-weight:800; }
.nh-c30 a:hover { background:var(--nh-cream); }
.nh-c1044 { order:99; }
.nh-c1044 a { color:var(--nh-mut); }

/* подсказки поиска */
.ui-autocomplete.ui-menu { z-index:600 !important; background:#fff !important; border:1px solid var(--nh-line) !important; border-radius:8px; box-shadow:0 14px 34px rgba(0,0,0,.16); padding:6px !important; height:auto !important; max-height:calc(100vh - 150px) !important; overflow-y:auto !important; overflow-x:hidden; scrollbar-width:thin; scrollbar-color:#d0cec8 transparent !important; font-family:'Manrope', Arial, sans-serif; box-sizing:border-box; }
.ui-autocomplete.ui-menu::-webkit-scrollbar { width:6px; }
.ui-autocomplete.ui-menu::-webkit-scrollbar-thumb { background:#d0cec8; border-radius:3px; }
.ui-autocomplete .mse2-ac-wrapper { font-size:14px; list-style:none; margin:0; }
.ui-autocomplete .mse2-ac-link, .ui-autocomplete .mse2-ac-link.ui-state-active { display:block; margin:0 !important; padding:0 !important; border:0 !important; border-radius:6px; background:none; color:var(--nh-tx); font-weight:500; }
.ui-autocomplete .mse2-ac-link.ui-state-active { background:var(--nh-soft); }
.ui-autocomplete .mse2-ac-item { display:flex; align-items:center; gap:12px; margin:0; padding:7px 8px; background:none !important; transition:none; }
.ui-autocomplete .mse2-ac-item > i { color:var(--nh-mut) !important; margin:0; }
.nh-ac-i { flex:none; width:48px; height:48px; border-radius:4px; object-fit:contain; background:#fff; border:1px solid var(--nh-line); }
.nh-ac-b { flex:1 1 0; min-width:0; display:flex; flex-direction:column; gap:2px; }
.nh-ac-t { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.3; }
.nh-ac-t b { font-weight:800; color:var(--nh-or-d); }
.nh-ac-a { font-size:12px; color:var(--nh-mut); }
.nh-ac-p { flex:none; font-size:15px; font-weight:800; white-space:nowrap; }
.ui-autocomplete .nh-ac-cat .mse2-ac-link, .ui-autocomplete .nh-ac-all .mse2-ac-link { padding:10px 8px !important; font-weight:600; cursor:pointer; }
.nh-ac-cat small { font-size:12px; font-weight:500; color:var(--nh-mut); margin-right:8px; }
.ui-autocomplete .nh-ac-all { position:sticky; bottom:-6px; z-index:1; margin-top:4px; border-top:1px solid var(--nh-line); padding-top:4px; padding-bottom:6px; background:#fff; }
.ui-autocomplete .nh-ac-all .mse2-ac-link { color:var(--nh-or-d); }

/* нижняя панель: только телефон */
.nh-tab { display:none; }

/* страница под новой шапкой */
.nh ~ .category-tvr { margin-top:0; }
.nh ~ .category-tvr:not(.tkp) { padding-top:26px; }
.coockie { left:16px !important; right:16px; bottom:16px !important; width:auto !important; max-width:560px; margin:0 auto; padding:10px 12px 10px 16px !important; background:var(--nh-dark) !important; color:#fff; border-radius:8px; font-size:13px !important; display:flex; align-items:center; gap:12px; box-sizing:border-box; }
.coockie.hidden { display:none; }
.coockie > div { flex:1 1 0; }
.coockie .btn-cookies { flex:none; margin:0; height:36px; padding:0 14px; border:0; border-radius:4px; background:#fff; color:var(--nh-dark); font-size:13px; font-weight:800; }
.coockie .decline-cookies { display:none; }

@media (max-width:991px) {
  html.nh-on body { padding-bottom:calc(var(--nh-tab) + env(safe-area-inset-bottom)); }
  html.nh-lock, html.nh-lock body { overflow:hidden; }
  .nh-w { padding:0 14px; }
  .nh { transition:top .22s ease; }
  .nh.nh-up { top:-52px; }
  .nh.nh-open { top:0; z-index:1200; }
  .nh-main { flex-wrap:wrap; height:auto; gap:0 6px; padding-bottom:10px; }
  .nh-burger, .nh-call { display:flex; align-items:center; justify-content:center; flex:none; width:44px; height:52px; padding:0; border:0; background:none; color:var(--nh-tx) !important; }
  .nh .nh-burger { margin-left:-11px; } /* три полоски по левому краю поиска (раньше отступ сбрасывался общим правилом для кнопок) */
  .nh-call { margin-right:-10px; }
  .nh-logo { flex:1 1 0; min-width:0; height:52px; }
  .nh-logo { font-size:21px; }
  .nh-logo .nh-mk { width:30px; height:30px; }
  .nh-logo .nh-wm { height:16px; }
  .nh-cat, .nh-acts, .nh-s-go { display:none; }
  .nh-sw { flex:1 1 100%; }
  .nh-s { height:46px; padding:0 6px 0 12px; }

  /* каталог на весь экран */
  .nh-drop { position:fixed; left:0; top:0; right:0; bottom:calc(var(--nh-tab) + env(safe-area-inset-bottom)); max-height:none; padding:0 0 24px; border:0; box-shadow:none; z-index:10; }
  .nh-cl { grid-template-columns:minmax(0, 1fr); gap:0; }
  .nh-c a { padding:9px 2px; border-radius:0; border-bottom:1px solid var(--nh-line); font-size:16px; }
  .nh-c30 a { padding-left:10px; padding-right:10px; border-radius:6px; border-bottom:0; }
  .nh-shade { display:none !important; }

  /* шапка листа: заголовок и крестик */
  .nh-sh { display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:2; height:56px; margin:0 0 8px; background:#fff; font-size:20px; font-weight:800; color:var(--nh-tx); }
  .nh-sh button { width:44px; height:44px; margin-right:-8px; padding:0; border:0; border-radius:6px; background:var(--nh-soft); font-size:26px; line-height:1; }

  /* меню: та же полоска, но листом на весь экран */
  .nh-bar { position:fixed; left:0; top:0; right:0; bottom:0; z-index:1200; background:#fff; overflow-y:auto; font-size:16px; color:var(--nh-tx); transform:translateX(-100%); visibility:hidden; transition:transform .22s ease, visibility 0s .22s; padding-bottom:calc(24px + env(safe-area-inset-bottom)); }
  .nh-bar.on { transform:none; visibility:visible; transition:transform .22s ease; }
  .nh-bar .nh-w { display:flex; flex-direction:column; align-items:stretch; gap:0; height:auto; }
  .nh-cont { order:1; margin:0 0 14px; display:grid; grid-template-columns:1fr 1fr; gap:8px; white-space:normal; }
  .nh-cont a { display:flex; align-items:center; justify-content:center; height:50px; border-radius:6px; background:var(--nh-soft); font-weight:700; font-size:15px; }
  .nh-cont .nh-soc { gap:10px; }
  .nh-cont .nh-soc span { display:inline; }
  .nh-cont .nh-tel { grid-column:1 / -1; background:var(--nh-or); color:#fff !important; font-weight:800; font-size:17px; }
  .nh-links { order:2; }
  .nh-links, .nh-links ul { flex-direction:column; align-items:stretch; gap:0; }
  .nh-links a { display:block; padding:15px 2px; border-bottom:1px solid var(--nh-line); font-weight:600; }

  /* нижняя панель */
  .nh-tab { display:grid; grid-template-columns:repeat(5, 1fr); position:fixed; left:0; right:0; bottom:0; z-index:450; background:#fff; border-top:1px solid var(--nh-line); padding:0 4px env(safe-area-inset-bottom); }
  .nh-tab a, .nh-tab button { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; height:var(--nh-tab); padding:0 2px; border:0; background:none; font-size:11px; font-weight:600; color:var(--nh-mut); min-width:0; }
  .nh-tab .on { color:var(--nh-tx); }
  .nh-tab span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .nh-tab .nh-n { position:absolute; top:5px; left:50%; margin-left:5px; min-width:18px; height:18px; font-size:11px; }
  .nh-tab .is-in { color:var(--nh-tx); }
  .nh-tab .is-in .nh-i { stroke:var(--nh-or); fill:var(--nh-or); }
  .nh-tab .is-in::after { content:""; position:absolute; top:8px; left:50%; margin-left:5px; width:9px; height:9px; border-radius:50%; background:var(--nh-ok); border:2px solid #fff; }

  .ui-autocomplete.ui-menu { max-height:55vh !important; }
  .nh ~ .category-tvr:not(.tkp) { padding-top:18px; }
  .coockie { bottom:calc(var(--nh-tab) + 10px + env(safe-area-inset-bottom)) !important; left:10px !important; right:10px; }
  #back-top-wrapper { right:14px !important; bottom:calc(var(--nh-tab) + 14px + env(safe-area-inset-bottom)) !important; width:44px !important; height:44px !important; }
  /* карточка товара: полоса покупки встаёт над панелью */
  .tkp .tkp-buy { bottom:calc(var(--nh-tab) + env(safe-area-inset-bottom)) !important; padding-bottom:8px !important; }
  .tkp { padding-bottom:90px !important; }
  .tkp ~ #back-top-wrapper, #back-top-wrapper.nh-hi { bottom:calc(var(--nh-tab) + 84px + env(safe-area-inset-bottom)) !important; }
}
/* каталог: квадратные картинки целиком, на компьютере плитками */
#nh .nh-c img { width:52px; height:52px; object-fit:contain; background:none; border-radius:0; transition:transform .18s ease; }
@media (min-width:992px) {
  #nh .nh-drop { padding:20px 0 26px; }
  #nh .nh-cl { grid-template-columns:repeat(7, minmax(0, 1fr)); grid-auto-rows:1fr; gap:10px; } /* все плитки одной высоты */
  #nh .nh-c a { flex-direction:column; justify-content:flex-start; text-align:center; gap:8px; height:100%; padding:14px 8px 12px; border:1px solid var(--nh-line); border-radius:10px; font-size:14px; font-weight:600; line-height:1.25; transition:border-color .15s, box-shadow .15s, transform .15s; }
  #nh .nh-c a:hover { background:#fff; border-color:var(--nh-or); box-shadow:0 8px 18px rgba(0,0,0,.09); transform:translateY(-2px); }
  #nh .nh-c a:hover img { transform:scale(1.08); }
  #nh .nh-c img { width:92px; height:92px; }
  #nh .nh-c30 a { background:var(--nh-cream); border-color:var(--nh-cream); }
  #nh .nh-c30 a:hover { background:var(--nh-cream); border-color:var(--nh-or); }
}
/* логотип: у значка внутри картинки есть прозрачный край ~3px — сдвигаем, чтобы край значка встал на линию с заголовком и меню */
@media (min-width:992px) {
  .nh-logo .nh-mk { margin-left:-3px; }
}
@media (min-width:992px) and (max-width:1199px) {
  #nh .nh-cl { grid-template-columns:repeat(5, minmax(0, 1fr)); }
}
