/* Тема New: шапка нового дизайна (design_handoff README «Шапка — компьютер», 3 уровня). */
.header.header-layout { position: relative; z-index: 120; margin: 0 auto 24px; padding: 0; background: transparent; }
html.ps-v2 .header.header-layout { margin-bottom: 12px; border-bottom: 1px solid transparent; }
.main:has(.header.header-layout) { padding-top: 10px; }
@media (min-width: 1024px) { .main:has(.header.header-layout) { padding-top: 0; } } /* компьютер: верхняя строка от края, как в образце (текст 5–29px) */
.header-layout > .main-container { position: relative; background: transparent; }
.header-layout__top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: clamp(14px, 2vw, 26px); height: 34px; padding: 0; font-size: 13.5px; }
.header-layout__top::after, .header-layout .header-catalog-directions::before { content: ''; position: absolute; left: 50%; width: 100vw; height: 1px; transform: translateX(-50%); background: var(--line); pointer-events: none; }
.header-layout__top::after { bottom: 0; }
.header-layout .header-catalog-directions::before { top: 0; }
.header-layout__links ul { display: flex; align-items: center; gap: 6px; margin: 0 0 0 -4px; padding: 0; list-style: none; }
.header-layout__links a, .header-layout__auth a { padding: 3px 11px; color: var(--ink2); font-size: 13.5px; font-weight: 400; white-space: nowrap; text-decoration: none; transition: color .18s; }
.header-layout__links a:hover, .header-layout__links a.active, .header-layout__auth a:hover { color: var(--accent); }
.header-layout__settings { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink2); font-size: 13.5px; }
.header-layout__settings .theme-switch { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; width: auto; height: 28px; padding: 0 12px; border: 0; background: transparent; border-radius: 9px; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--ink); transition: color .18s; }
.header-layout__settings .theme-switch:hover { color: var(--accent); }
.header-layout__settings .theme-switch svg { flex: 0 0 15px; width: 15px; height: 15px; }
.header-layout__settings .header-preferences--desktop { gap: 10px; flex-direction: row; }
.header-layout__settings .header-preferences__toggle { min-height: 0; padding: 3px 6px; margin: 0 -6px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.header-layout__settings .header-preferences__toggle:hover { background: var(--hover); }
.header-layout__settings .header-preferences__toggle > span:last-child::after { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 1px 3px 8px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); vertical-align: middle; transition: transform .15s; } /* стрелка выбора, как в образце */
.header-layout__settings .header-preferences__toggle[aria-expanded="true"] > span:last-child::after { margin-bottom: 0; transform: rotate(-135deg); }
.header-layout__settings .header-user-label { max-width: 150px; min-height: 0; padding: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.header-layout__balance { white-space: nowrap; color: var(--accent); font-weight: 700; transition: color .15s; }
.header-layout__balance-label { color: var(--ink2); font-weight: 500; }
/* 25.10 владелец: у гостя «Регистрация/Войти» только во втором ряду (иконки), в верхней строке не дублируем — как в новом дизайне. */
.header-layout__auth { display: none; }
.header-layout__bell-top { display: flex; align-items: center; }
/* разделители между блоками верхней строки, как в новом дизайне */
.header-layout .header-layout__settings > * + *, .header-layout__settings .header-preferences--desktop > .header-preferences__group + .header-preferences__group { position: relative; padding-left: 14px; }
.header-layout__settings > * + *::before, .header-layout__settings .header-preferences--desktop > .header-preferences__group + .header-preferences__group::before { content: ''; position: absolute; left: 0; top: 50%; width: 1px; height: 16px; transform: translateY(-50%); background: var(--dash); }
.header-layout__bell-top .client-notification-bell { margin: 0; }
@media (min-width: 1024px) { .header-layout__mobile-tools .client-notification-bell { display: none; } }
.header-layout__main { display: flex; align-items: center; gap: clamp(8px, 1vw, 12px); padding: 10px 0; background: transparent; }
.header-layout__logo { display: flex; flex: none; padding-right: clamp(2px, 0.7vw, 8px); color: var(--ink); }
.header-layout__logo img { width: auto; max-width: 100%; height: 35px; object-fit: contain; object-position: left center; }
.header-layout .header-discovery { flex: 1; min-width: 0; padding: 0; }
.header-layout .header-catalog-toggle, .header-layout .header-search__field { height: 46px; min-height: 46px; border-radius: 13px; }
.header-layout .header-catalog-toggle { gap: 9px; padding: 0 18px; border: 0; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.header-layout .header-catalog-toggle:hover { background: var(--accent-hover); color: #fff; }
.header-layout .header-search__field { padding: 0 16px; background: var(--card); border: 1px solid var(--line); }
.header-layout .header-search input { height: 44px; padding: 0 2px; font-size: 15px; color: var(--ink); }
.header-layout__actions { display: flex; align-items: center; flex: 0 0 auto; gap: 8px; }
.header-layout__action { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; padding: 4px 6px; color: var(--ink2); font-size: 12.5px; text-decoration: none; white-space: nowrap; transition: color .18s; }
.header-layout__action-icon { width: 19px; height: 19px; fill: currentColor; } /* образец: 19px */
.header-layout__action:hover, .header-layout__action.active { color: var(--accent); }
.header-layout__badge { display: inline-flex; justify-content: center; align-items: center; min-width: 17px; height: 17px; padding: 0 4px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 1; }
.header-layout__badge[hidden] { display: none; }
.header-layout__action > .header-layout__badge { position: absolute; top: -5px; right: 8px; }
.header-layout__mobile-tools { display: flex; align-items: center; gap: 12px; }
.header-layout__mobile-tools .header-mobile-menu-toggle { display: none; }
.header-layout__mobile-tools .client-notification-bell { margin: 0; }
.header-layout .header-catalog-directions { position: relative; height: 40px; padding: 0; gap: clamp(14px, 1.8vw, 28px); overflow: visible; justify-content: flex-start; background: transparent; }
.header-layout .header-catalog-directions > button { border-radius: 10px; }
.header-layout .header-catalog-directions > button { background: transparent; color: var(--ink2); }
.header-layout .header-catalog-directions > button:hover, .header-layout .header-catalog-directions > button[aria-expanded="true"] { color: var(--accent); background: transparent; }
.header-layout .header-catalog-directions .header-direction-icon { flex-basis: 18px; width: 18px; height: 18px; color: var(--accent); } /* образец: 18px */
.header-layout:has(.header-search__dropdown:not([hidden])) .header-catalog-directions { z-index: 1; }
.header-layout .header-catalog-toggle__open svg { display: block; width: 16px; height: 16px; }
/* кнопка «Каталог» одного размера в обоих состояниях: значок и крестик в одинаковой коробке 20×20 */
.header-layout .header-catalog-toggle > .header-catalog-toggle__open, .header-layout .header-catalog-toggle[aria-expanded="true"] > .header-catalog-toggle__close { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; font-size: 22px; line-height: 20px; }
.header-layout .header-catalog-toggle[aria-expanded="true"] > .header-catalog-toggle__open { display: none; }
.header-layout .header-catalog-directions > button { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; font-weight: 500; white-space: nowrap; }
.header-layout a:focus-visible, .header-layout button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 1024px) and (max-width: 1240px) {
 .header-layout__top { gap: 10px; padding: 0 8px; }
 .header-layout__links ul { gap: 12px; }
 .header-layout__settings { gap: 8px; font-size: 13px; }
 .header-layout__settings .header-user-label { max-width: 90px; font-size: 13px; }
 .header-layout__balance-label { display: none; }
 .header-layout__logo { flex-basis: 120px; max-width: 120px; }
 .header-layout__main { gap: 12px; padding: 14px 8px; }
 .header-layout__actions { gap: 10px; }
 .header-layout .header-catalog-directions { gap: 10px; justify-content: space-between; } /* направления в одну строку: сжимаются, не переносятся; дальше — мобильная шапка */
 .header-layout .header-catalog-directions > button { font-size: 13px; gap: 5px; padding: 8px 0; white-space: nowrap; }
 .header-layout .header-catalog-directions .header-direction-icon { flex-basis: 16px; width: 16px; height: 16px; }
}
@media (max-width: 1023px) {
 .header.header-layout { margin: 0; } /* телефон: кнопки шапки в 10px от верха, как в прототипе (поле даёт .main) */
 .header-layout > .main-container { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 12px; align-items: center; background: transparent; border-radius: 0; }
 .header-layout__top, .header-layout__settings, .header-layout__main { display: contents; }
 .header-layout__links, .header-layout__auth, .header-layout__actions, .header-layout .header-user-label, .header-layout__bell-top { display: none; }
 .header-layout__settings .theme-switch { position: static; grid-column: 3; grid-row: 1; }
 .header-layout__settings .theme-switch span { display: none; }
 .header-layout__settings .theme-switch .header-spec-theme-light, .header-layout__settings .theme-switch .header-spec-theme-dark { display: none !important; }
 .header-layout__balance { display: none; }
 .header-layout__balance-label { display: none; }
 .header-layout__logo { grid-column: 1; grid-row: 1; width: 120px; max-width: 120px; }
 .header-layout__logo img { height: 28px; }
 .header-layout > .main-container { gap: 8px; padding-top: 0; }
 .header-layout__settings .theme-switch, .header-layout__mobile-tools .header-mobile-menu-toggle, .header-layout__mobile-tools .client-notification-bell { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 13px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink); }
 .header-layout .header-discovery { grid-column: 1 / -1; grid-row: 2; width: 100%; padding: 0 0 12px; }
 .header-layout__mobile-tools { grid-column: 4; grid-row: 1; gap: 8px; }
 .header-layout__mobile-tools .header-mobile-menu-toggle { display: flex; align-items: center; }
 .header-layout .header-mobile-menu-toggle svg { width: 20px; height: 20px; stroke-width: 2; }
 .header-layout .header-catalog-toggle, .header-layout .header-search__field { height: 46px; min-height: 46px; border-radius: 14px; }
 .header-layout .header-search input { height: 44px; font-size: 16px; }
 .header-layout .header-discovery { gap: 8px; padding: 2px 0 6px; }
 .header-layout .header-catalog-toggle { padding: 0 14px; font-size: 15px; gap: 8px; }
 .header-layout .header-catalog-directions { display: none; }
}
@media (max-width: 400px) {
 .header-layout > .main-container { gap: 10px; }
 .header-layout__logo { width: 100px; max-width: 100px; }
 .header-layout__mobile-tools { gap: 10px; }
}
.header-layout__action.active, .header-layout__links a.active { color: var(--site-mark, #fd5a3c); }
.header-spec-theme-light { display: none; }
:root[data-theme="dark"] .header-spec-theme-dark { display: none; }
:root[data-theme="dark"] .header-spec-theme-light { display: inline; }
/* Экран поддержки для гостя: компактная карточка, кнопки как у гостя на главной (жёлтая «Регистрация» + «Войти» с рамкой). */
.guest-support { padding: 16px 0 48px; }
.guest-support__card { max-width: 460px; margin: 0 auto; padding: 32px 28px 28px; background: var(--site-card, #fff); border-radius: 15px; text-align: center; }
.guest-support__icon { display: block; margin: 0 auto 14px; color: var(--site-mark, #fd5a3c); }
.guest-support__title { margin: 0 0 22px; color: var(--site-title, #222); font-size: 18px; font-weight: 600; line-height: 1.4; }
.guest-support__actions { gap: 12px; }
.guest-support__actions .btn { display: block; padding: 13px 15px; color: var(--site-title, #222); font-size: 15px; font-weight: 600; line-height: 18px; text-align: center; text-decoration: none; }
.guest-support__actions .sign-up__link { color: var(--site-on-accent, #222); border-radius: 14px; background: linear-gradient(to bottom, var(--site-accent-softer, #fdcc6e) 0%, var(--site-accent-amber, #fdc861) 50%, var(--site-accent, #ffbe40) 100%); }
.guest-support__actions .sign-in__link { border: 2px solid var(--site-border-mute, #e3e3e3); border-radius: 14px; background: var(--site-card, #fff); padding: 11px 15px; }
@media (max-width: 576px) { .guest-support__card { padding: 24px 18px; } .guest-support__actions { flex-direction: column; } }
/* 25.10 владелец: наведение на элементы верхней строки — акцентный цвет, как у ссылок разделов и колокола. */
.header-layout__settings .theme-switch, .header-layout__settings .header-preferences__toggle, .header-layout__balance, .header-layout__balance *, .header-layout__settings .header-user-label { transition: color .15s; }
.header-layout__settings .theme-switch:hover, .header-layout__settings .header-preferences__toggle:hover, .header-layout__balance:hover, .header-layout__balance:hover *, .header-layout__settings .header-user-label:hover, .header-layout__settings a.header-user-label:hover { color: var(--site-mark, #fd5a3c); cursor: pointer; }
/* 26.10 владелец: на iPhone в альбомной ориентации Safari сам увеличивал шрифт в меню каталога и списках. Запрещаем авто-масштаб текста. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 28.10 — размеры по прототипу (замер вычисленных стилей прототипа на 1440): кнопки действий 92×50 (поля 0 7.2, промежуток 2,
   500/15px), лупа поиска справа 19px, направления — поля 4px 10px со сдвигом −10px, высота 27, промежуток значка 7, скругление 9 */
@media (min-width: 1024px) {
 .header-layout__main { padding: 10px 0 !important; }
 .header-layout__actions { gap: 8px; }
 .header-layout__action { color: var(--ink); flex: 0 0 92px; width: 92px; min-width: 0; height: 50px; justify-content: center; gap: 2px; padding: 0 7.2px; border-radius: 13px; font-weight: 500; line-height: 15px; }
 .header-layout .header-search__field { gap: 10px; }
 .header-layout .header-search__clear { order: 1; }
 .header-layout .header-search__submit { order: 2; flex: none; display: flex; align-items: center; padding: 0; color: var(--muted); }
 .header-layout .header-search__submit svg { width: 19px; height: 19px; }
 .header-layout .header-catalog-toggle__open { width: 16px !important; height: 16px !important; }
 .header-layout .header-catalog-directions > button { gap: 7px; height: auto; margin: 0 -10px; padding: 4px 10px; border-radius: 9px; line-height: normal; }
}
/* прототип: у шапки внутренние поля 0 2px 2px — строки 1202 шириной от x119; направления по центру строки высотой 27 */
@media (min-width: 1024px) {
 .header-layout__top, .header-layout__main, .header-layout .header-catalog-directions { padding-left: 2px !important; padding-right: 2px !important; }
 .header.header-layout { padding-bottom: 2px; }
 .header-layout .header-catalog-directions > button { align-self: center; border: 0; }
}

/* Original five-tab mobile bar. Navigation and real basket updater hooks stay shared. */
html.ps-v2 .ps-mobile-navigation { z-index:50; }
html.ps-v2 .ps-mobile-navigation .mobile-menu__nav { margin:0; padding:0; list-style:none; }
html.ps-v2 .ps-mobile-navigation .nav-link { width:100%; border:0; padding:0; background:transparent; color:var(--ink2); font-family:inherit; cursor:pointer; }
html.ps-v2 .ps-mobile-navigation .nav-link.active,html.ps-v2 .ps-mobile-navigation .nav-link[aria-expanded="true"] { background:var(--sel); color:var(--accent); }
html.ps-v2 .ps-mobile-navigation .ps-mobile-navigation__icon { position:relative; display:flex; }
html.ps-v2 .ps-mobile-navigation svg { display:block; width:22px; height:22px; fill:none; stroke:currentColor; }
html.ps-v2 .ps-mobile-navigation .ps-mobile-navigation__badge { position:absolute; top:-5px; right:-9px; min-width:16px; height:16px; padding:0 4px; box-sizing:border-box; border-radius:999px; background:var(--accent); color:#fff!important; font-size:10px; font-weight:700; line-height:16px; text-align:center; }
html.ps-v2 .ps-mobile-navigation .ps-mobile-navigation__badge>span { font-size:inherit; font-weight:inherit; line-height:inherit; }
html.ps-v2.header-catalog-open .ps-mobile-navigation .nav-link.active { background:transparent; color:var(--ink2); }
@media(max-width:1023px){html.ps-v2 .ps-mobile-navigation{display:block;bottom:calc(8px + env(safe-area-inset-bottom,0px));}}
