/* Новая шапка по образцу stan-torgi.ru (new-header).
   Фиксированная, поверх контента: тёмная верхняя полоса с контактами +
   основная навигация. На страницах со светлым фоном используется модификатор
   .new-header-solid (постоянная тёмная подложка), контенту нужен отступ
   сверху - класс .nh-offset на body. */

.new-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; font-family: 'Gilroy', 'Inter Tight', sans-serif; color: #fff; pointer-events: none; }
.new-header * { box-sizing: border-box; }
.new-header a, .new-header button { pointer-events: auto; }
.new-header a { text-decoration: none; color: inherit; }
.new-header img, .new-header svg { display: block; }

/* ---------- Верхняя полоса ---------- */
.new-header-top { width: min(1280px, calc(100% - 40px)); margin: 10px auto 0; background-color: #303030; border-radius: 5px; transition: opacity .25s ease, transform .25s ease; }
.new-header.is-scrolled .new-header-top { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.new-header-top-container { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 20px; }
.new-header-top-text { margin: 0; color: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 500; }
.new-header-top-contacts { display: flex; align-items: center; gap: 20px; }
.new-header-contact-label { color: rgba(255, 255, 255, .7); font-size: 14px; }
.new-header-contact-link, .new-header-mobile-contacts a, .new-header-mobile-contacts button { display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #fff; text-decoration: none; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 0; }
.new-header-contact-icon-wrapper, .new-header-scroll-contact { width: 46px; height: 24px; border: 1px solid currentColor; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: transparent; padding: 0; cursor: pointer; }
.new-header-contact-icon, .new-header-scroll-contact img { max-width: 20px; max-height: 16px; }

/* ---------- Основная полоса ---------- */
.new-header-main { width: 100%; display: flex; height: 64px; align-items: flex-end; transition: transform .25s ease; }
.new-header-main-container { width: min(1280px, calc(100% - 40px)); min-height: 50px; margin: 0 auto; display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); padding: 0 20px; border-radius: 5px; transition: background-color .25s ease, border-radius .25s ease, min-height .25s ease; }
.new-header.is-scrolled .new-header-main { transform: translateY(-63px); }
.new-header.is-scrolled .new-header-main-container { min-height: 50px; background-color: #4F4F4F; border-radius: 5px; }
/* Светлые страницы: подложка всегда тёмная, чтобы белый логотип и текст читались. */
.new-header-solid .new-header-main-container { background-color: #4F4F4F; border-radius: 5px; }

.new-header-logo { display: flex; align-items: center; flex-shrink: 0; }
.new-header-logo img { width: 204px; height: auto; }
.new-header.is-scrolled .new-header-logo { display: none; }
.new-header-solid.is-scrolled .new-header-logo { display: flex; }
.new-header-solid.is-scrolled .new-header-logo img { width: 162px; }

/* ---------- Навигация ---------- */
.new-header-desktop-nav { display: flex; align-items: center; gap: clamp(16px, 1.8vw, 28px); }
.new-header-nav-item { position: relative; }
.new-header-nav-button { background: none; border: 0; color: #fff; padding: 8px 0; font-family: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.new-header-nav-button:hover { color: #F8C700; }
.new-header-nav-dropdown { position: absolute; top: 100%; left: 0; margin-top: 14px; min-width: 220px; background: #303030; border-radius: 5px; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease, visibility .2s ease; box-shadow: 0 4px 12px rgba(0, 0, 0, .22); overflow: hidden; }
.new-header-nav-item:hover .new-header-nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
/* Мостик, чтобы дропдаун не закрывался в зазоре между кнопкой и меню. */
.new-header-nav-item:hover::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
.new-header-dropdown-link { display: block; width: 100%; padding: 15px 20px; background: transparent; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .2); color: #fff; font-size: 14px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; }
.new-header-dropdown-link:last-child { border-bottom: 0; }
.new-header-dropdown-link:hover { background: #F8C700; color: #4F4F4F; }

/* ---------- Правый блок ---------- */
.new-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 24px; flex: 1; min-width: 150px; }
.new-header-scroll-contacts, .new-header-mobile-scroll-contacts { display: none; align-items: center; gap: 10px; }
.new-header.is-scrolled .new-header-scroll-contacts { display: flex; }
.new-header-scroll-contact { color: #fff; }
.new-header-auth { display: flex; align-items: center; gap: 10px; }
.new-header-auth-link { border: 0; background: transparent; color: rgba(255, 255, 255, .7); font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; padding: 0; white-space: nowrap; }
.new-header-auth-link:hover { color: #F8C700; }
.new-header-auth-divider { color: rgba(255, 255, 255, .7); }
.new-header-user-icon-link, .new-header-mobile-user-icon-link { width: 28px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #F8C700; cursor: pointer; padding: 0; margin-left: 5px; }
.new-header-mobile-user-icon-link { color: #fff; margin-left: 0; }
.new-header-user-icon { width: 23px; height: 24px; fill: currentColor; }
.new-header.is-scrolled .new-header-user-icon-link { color: #fff; margin-left: 10px; }

/* ---------- Мобильная навигация в шапке ---------- */
.new-header-mobile-nav { display: none; margin-left: auto; }
.new-header-burger { width: 30px; height: 20px; display: inline-flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.new-header-burger span { display: block; width: 30px; border: 1px solid #fff; }

/* ---------- Мобильное меню (оверлей) ---------- */
.new-header-mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2000; background: #fff; transform: translateX(100%); transition: transform .3s ease; overflow-y: auto; padding: 10px 20px 30px; font-family: 'Gilroy', 'Inter Tight', sans-serif; }
.new-header-mobile-menu * { box-sizing: border-box; }
.new-header-mobile-menu a { text-decoration: none; }
.new-header-mobile-menu.is-open { transform: translateX(0); }
.new-header-mobile-menu-header { height: 50px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.new-header-mobile-logo { display: inline-flex; background: #303030; border-radius: 5px; padding: 8px 12px; }
.new-header-mobile-logo img { display: block; width: 162px; max-width: 60vw; height: auto; }
.new-header-close { border: 0; background: transparent; cursor: pointer; padding: 0; color: #4F4F4F; }
.new-header-mobile-auth { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.new-header-mobile-auth-outline, .new-header-mobile-auth-filled { height: 50px; flex: 1; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.new-header-mobile-auth-outline { border: 1px solid #4F4F4F; background: #fff; color: #4F4F4F; }
.new-header-mobile-auth-filled { border: 1px solid #F8C700; background: #F8C700; color: #4F4F4F; box-shadow: 0 1px 4px .3px rgba(79, 79, 79, .4); }
.new-header-mobile-menu-nav { border-bottom: 1px solid #E5E5E5; padding-bottom: 30px; margin-bottom: 30px; }
.new-header-mobile-menu-item { margin-bottom: 30px; }
.new-header-mobile-menu-item:last-child { margin-bottom: 0; }
.new-header-mobile-menu-button { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; color: #4F4F4F; font-family: inherit; font-size: 20px; line-height: 25px; font-weight: 600; text-decoration: none; cursor: pointer; padding: 0; }
.new-header-accordion-arrow { width: 7px; height: 7px; border-right: 2px solid #4F4F4F; border-bottom: 2px solid #4F4F4F; transform: translateY(-2.5px) rotate(45deg); transition: transform .2s ease; }
.new-header-mobile-menu-item.is-open .new-header-accordion-arrow { transform: translateY(2.5px) rotate(225deg); }
.new-header-mobile-submenu { display: grid; grid-template-rows: 0fr 0fr 0fr; transition: grid-template-rows .25s ease; }
.new-header-mobile-menu-item.is-open .new-header-mobile-submenu { grid-template-rows: 1fr 1fr 1fr; }
.new-header-mobile-submenu > * { overflow: hidden; }
.new-header-mobile-submenu-link { display: block; margin-top: 0; color: #4F4F4F; font-size: 16px; font-weight: 500; text-decoration: none; }
.new-header-mobile-menu-item.is-open .new-header-mobile-submenu-link { padding-top: 20px; }
.new-header-mobile-contacts { color: #4F4F4F; }
.new-header-mobile-contacts p { margin: 0 0 20px; color: rgba(79, 79, 79, .7); font-size: 16px; }
.new-header-mobile-contacts a, .new-header-mobile-contacts button { color: #4F4F4F; display: flex; margin-top: 20px; font-size: 20px; }

/* ---------- Тултип «Адрес скопирован» у кнопок почты ---------- */
.nh-copy-email { position: relative; }
.nh-copy-email::after { content: 'Адрес скопирован'; position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(4px); background: #303030; color: #fff; font-size: 12px; font-weight: 500; line-height: 1; padding: 8px 12px; border-radius: 5px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .22); opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility .2s ease; pointer-events: none; z-index: 10; }
.nh-copy-email.is-copied::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
/* В верхней полосе кнопка у правого края - прижимаем тултип вправо, чтобы не резался. */
.new-header-top-contacts .nh-copy-email::after { left: auto; right: 0; transform: translateY(4px); }
.new-header-top-contacts .nh-copy-email.is-copied::after { transform: translateY(0); }
/* В мобильном меню тултип на светлом фоне. */
.new-header-mobile-contacts .nh-copy-email::after { left: 0; transform: translateY(4px); }
.new-header-mobile-contacts .nh-copy-email.is-copied::after { transform: translateY(0); }

/* ---------- Отступ контента под фиксированной шапкой ---------- */
.nh-offset { padding-top: 137px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1280px) {
    .new-header-desktop-nav { gap: 14px; }
    .new-header-nav-button, .new-header-auth-link { font-size: 14px; }
    .new-header-main-container { gap: 16px; }
    .new-header-actions { gap: 14px; min-width: 0; }
    .new-header-logo img { width: 176px; }
}

@media (max-width: 1120px) {
    .new-header-top { display: none; }
    .new-header-main { height: 50px; transform: none; }
    .new-header-main-container { width: 100%; min-height: auto; height: 40px; border-radius: 5px; padding: 0 10px; margin: 10px 10px 0; }
    .new-header.is-scrolled .new-header-main { transform: none; height: 50px; }
    .new-header.is-scrolled .new-header-main-container { min-height: auto; border-radius: 5px; width: 100%; padding: 0 10px; margin: 10px 10px 0; height: 40px; }
    .new-header-logo, .new-header.is-scrolled .new-header-logo { display: flex; }
    .new-header-logo img, .new-header-solid.is-scrolled .new-header-logo img { width: 162px; }
    .new-header-desktop-nav, .new-header-actions { display: none; }
    .new-header-mobile-nav { display: flex; align-items: center; gap: 30px; }
    .new-header.is-scrolled .new-header-mobile-scroll-contacts { display: flex; }
    .nh-offset { padding-top: 62px; }
    .new-header-logo img { width: 162px; }
}

@media (max-width: 430px) {
    .new-header-mobile-scroll-contacts { display: none !important; }
}

/* ---------- Текстовый логотип «Торги 102» ----------
   Заменил st-logo.svg: в SVG надпись переведена в кривые, поэтому название
   набирается текстом тем же Gilroy. Цифры — жёлтым акцентом макета (#F8C700). */
.new-header-logo .brand-wordmark,
.new-header-mobile-logo .brand-wordmark {
    font-family: 'Gilroy', 'Inter Tight', sans-serif;
    font-weight: 800; font-size: 30px; line-height: 1;
    letter-spacing: .01em; white-space: nowrap; color: #FFFFFF;
}
.new-header-logo .brand-wordmark-num,
.new-header-mobile-logo .brand-wordmark-num { color: #F8C700; margin-left: .28em; }

/* Панель мобильного меню — на белом фоне, там знак тёмный. */
.new-header-mobile-logo .brand-wordmark { color: #4F4F4F; font-size: 26px; }

.new-header.is-scrolled .new-header-logo .brand-wordmark,
.new-header-solid.is-scrolled .new-header-logo .brand-wordmark { font-size: 24px; }

@media (max-width: 1100px) { .new-header-logo .brand-wordmark { font-size: 24px; } }
