/* =====================================================================
   HEADER.CSS — шапка artmetalgroup.ru (ART METAL GROUP)
   ---------------------------------------------------------------------
   Один HTML для всех устройств (см. header.php), разница — только
   в этом файле через медиазапросы (брейкпоинт 992px).

   Палитра — фирменная зелёная AMG (из logo.png):
     #60c300 — основной зелёный (круг, «AMG»)
     #003300 — тёмно-зелёный («ART METAL GROUP»)

   Мобильный UX (компактная иконочная строка → выезжающая панель с
   цветным блоком контактов → отдельный полноэкранный список каталога
   → полноэкранный поиск) сделан по референсу, который прислал клиент.
   ===================================================================== */

:root{
  --c-bg:             #ffffff;
  --c-primary:        #60c300;
  --c-primary-dark:   #3f8a00;
  --c-primary-darker: #398d00;
  --c-primary-tint:   #eef8e4;
  --c-dark:           #003300;
  --c-dark-soft:      #0a4d0a;
  --c-text:           #16210f;
  --c-text-soft:      #66755f;
  --c-border:         #e0e8d8;
  --c-border-soft:    #eef2ea;
  --c-gradient-brand: linear-gradient(135deg, #70b11f 0%, #639c2b 55%, #2c7300 100%);
  --c-gradient-dark: linear-gradient(135deg, #187318 0%, #007b00 70%, #007000 100%);
  --c-promo:          #ffb020;
  --c-panel-shadow:   0 20px 48px rgba(0,45,0,.14), 0 4px 14px rgba(0,45,0,.06);
  --card-shadow:      0 2px 10px rgba(0,45,0,.06);
  --radius:           10px;
  --radius-sm:        8px;
  --radius-pill:      999px;
  --transition:       .2s ease;
  --header-z:         900;
  --font-brand:       "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

/* ───────────────────────── Базовый сброс ───────────────────────── */
.header, .header *, .header *::before, .header *::after{ box-sizing: border-box; }
.header{
  position: sticky;
  top: 0;
  z-index: var(--header-z);
  background: var(--c-bg);
  font-family: inherit;
}
.header ul{ list-style: none; margin: 0; padding: 0; }
.header a{ text-decoration: none; color: inherit; }
.header button{ font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.header img{ max-width: 100%; display: block; }
body.hdr-nav-open{ overflow: hidden; }

.header .container{max-width: 1400px;margin: 0 auto;padding: 0 10px;}
.header .clearfix::after{ content:""; display:table; clear:both; }

/* ───────────────────────── Иконки без SVG (border/pseudo-элементы) ─────────────────────────
   На случай, если где-то в общем style.css сайта есть глобальное правило,
   гасящее инлайновые <svg> — эти значки полностью на CSS и не зависят от него. */
.header .hdr-x-icon{
  position: relative;
  display: inline-block;
  width: 16px; height: 16px;
  flex: 0 0 auto;
}
.header .hdr-x-icon::before, .header .hdr-x-icon::after{
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.header .hdr-x-icon::before{ transform: translate(-50%,-50%) rotate(45deg); }
.header .hdr-x-icon::after{ transform: translate(-50%,-50%) rotate(-45deg); }

.header .hdr-chevron-icon, .header .hdr-back-icon{
  display: inline-block;
  width: 9px; height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
}
.header .hdr-chevron-icon{ transform: rotate(-45deg); }
.header .hdr-back-icon{ transform: rotate(135deg); }


/* ═════════════════════════ ВЕРХНЯЯ СТРОКА ═════════════════════════ */
.header .header_top_center{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 22px;
  padding: 14px 0;
  border-bottom: none;
}

/* Фиксированные по содержимому блоки — не сжимаются, поиск (единственный
   тянущийся элемент) сжимается первым, а при нехватке места переносится
   на новую строку, а не превращается в нечитаемую полоску */
.header .logo_right,
.header .contact_i,
.header .icon-btns-row,
.header .head_pofile,
.header .header-login,
.header .hvr-bounce-in{ flex-shrink: 0; }

/* ── Логотип ── */
.header .logo_right{ display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.header .logo_right .header__logo img{display: block;height: 59px;width: auto;object-fit: contain;}
.header .logo_right .mobile77{font-size: 14px;color: var(--c-text);}
.header .logo_right .mobile77 b{}

/* ── Иконки моб. строки: звонок / поиск / бургер (скрыты на десктопе) ── */
.header .hdr-call-btn,
.header .hdr-burger,
.header .hdr-search-toggle,
.header .hdr-drawer-contacts{ display: none; }

/* ── Контакты: телефон / мессенджеры / «Заказать звонок» (вертикальный стек) ── */
.header .contact_i{ display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.header .watviber{ display: none; } /* отдельная крупная кнопка WhatsApp не нужна — есть иконка в общем ряду мессенджеров */

.header .ph_verev{display: flex;flex-direction: column;align-items: center;gap: 5px;}
.header .phonn a{font-weight: 700;font-size: 18px;color: var(--c-text);white-space: nowrap;transition: color var(--transition);}
.header .phonn a:hover{ color: var(--c-primary-dark); }
.header .card_p_w_v{ display: flex; align-items: center; gap: 8px; }
.header .card_p_w_v .grel{
}
.header .card_p_w_v .grel:hover{/* background: var(--c-primary); *//* transform: translateY(-1px); */}
.header .card_p_w_v .grel img{width: 18px;height: 18px;object-fit: contain;}

.header .ph_verev .head_call{
  background: none;
  border: none;
  padding: 0;
  color: var(--c-primary-darker);
  font-size: 13px;
  font-family: var(--font-brand);
  text-decoration: underline;
  box-shadow: none;
  transition: color var(--transition);
}
.header .ph_verev .head_call:hover{ color: var(--c-primary-dark); }
.header .ph_verev .head_call:active{ transform: none; }

/* ── Значки приложений ── */
.header .icon-btns-row{display: flex;gap: 7px;flex: 0 0 auto;flex-wrap: wrap;flex-direction: column;}
.header .icon-btns-row .icon-btn{ display: flex; flex-direction: column; align-items: flex-start; gap: 2px; opacity: .95; transition: opacity var(--transition); }
.header .icon-btns-row .icon-btn:hover{ opacity: 1; }
.header .icon-btns-row .icon-btn__caption{}
.header .icon-btns-row .icon-btn img{ height: 20px; width: auto; }

/* ── Поиск ── */
.header .header-search.search_bar{
  position: relative;
  display: flex !important;
  align-items: center;
  flex: 1 1 260px;
  min-width: 220px;
  height: 46px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.header .header-search.search_bar:focus-within{ border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-tint); }
.header .hdr-search-row{ display: flex; align-items: center; flex: 1 1 auto; min-width: 0; width: 100%; height: 100%; }
.header .header-search .search_input{ flex: 1 1 auto; min-width: 0; height: 100%; border: none; outline: none; background: transparent; padding: 0 4px 0 20px; font-size: 14px; color: var(--c-text); }
.header .search_input::placeholder{ color: #9aa89a; }
.header .hdr-search-back{ display: none; }

.header .header-search__voice-btn,
.header .header-search__search-submit-btn,
.header .search-catalog__btn--clear{ flex: 0 0 auto; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0 15px; color: var(--c-text-soft); transition: color var(--transition); }
.header .header-search__voice-btn img{ width: 19px; height: 19px; opacity: .55; }
.header .header-search__voice-btn:hover img{ opacity: .9; }
.header .header-search__search-submit-btn{ background: none; padding: 0 18px; }
.header .header-search__search-submit-btn .search-icn img{ width: 18px; height: 18px; opacity: .6; }
.header .search-catalog__btn--clear{ position: relative; width: 34px; padding: 0; }
.header .search-catalog__btn--clear::before, .header .search-catalog__btn--clear::after{ content:""; position: absolute; width: 12px; height: 2px; background: var(--c-text-soft); top: 50%; left: 50%; border-radius: 2px; }
.header .search-catalog__btn--clear::before{ transform: translate(-50%,-50%) rotate(45deg); }
.header .search-catalog__btn--clear::after{ transform: translate(-50%,-50%) rotate(-45deg); }
.header .search-catalog__btn--clear:hover::before, .header .search-catalog__btn--clear:hover::after{ background: var(--c-text); }

.header .search_five_res{ position: absolute; top: calc(100% + 10px); left: 0; right: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--c-panel-shadow); max-height: 70vh; overflow-y: auto; z-index: 60; }
.header .search_five_res:empty{ display: none; }

/* ── Профиль / вход: серая пилюля с шевроном ── */
.header .head_pofile, .header .header-login{ position: relative; flex: 0 0 auto; }
.header .head_pofile .account_block,
.header .house_category_title_login p{
}
.header .house_category_title_login p::after{
}
.header .head_pofile .account:hover .account_block,
.header .house_category_title_login:hover p{/* background: var(--c-primary-tint); *//* color: var(--c-primary-dark); */}
.header .head_pofile img{ width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; }
.header .head_pofile .bas{ font-size: 14px; }

.header .house_category_content_login{ position: absolute; top: calc(100% + 12px); right: 0; width: 320px; max-width: 90vw; background: #fff; border-radius: var(--radius); box-shadow: var(--c-panel-shadow); padding: 22px; z-index: 70; }
.header .house_category_title_login{ position: relative; }
.header .hdr-profile-sheet__close{ display: none; }
.header .log_head_title{ font-weight: 700; font-family: var(--font-brand); font-size: 16px; margin-bottom: 8px; color: var(--c-dark); }
.header .rate_website_title, .header .rate_website_title_ukazat{ font-size: 12.5px; color: var(--c-text-soft); margin-bottom: 8px; line-height: 1.45; }
.header .login-element{ margin-bottom: 10px; }
.header .login-element .inp{ width: 100%; padding: 11px 14px; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); font-size: 14px; outline: none; transition: border-color var(--transition); }
.header .login-element .inp:focus{ border-color: var(--c-primary); }
.header .login-element small{ color: var(--c-text-soft); font-size: 11.5px; }
.header .login-button{width: 100%;background: var(--c-gradient-brand);color: #fff;padding: 12px;border-radius: var(--radius-pill);transition: filter var(--transition);}
.header .login-button:hover{ filter: brightness(1.05); }
.header .sign-in-page__public{ font-size: 11px; color: var(--c-text-soft); margin-top: 8px; line-height: 1.4; }
.header .sign-in-page__public a{ text-decoration: underline; color: var(--c-primary-dark); }
.header ._29-a1{ display: flex; gap: 8px; align-items: flex-start; background: #fff4e5; border-radius: var(--radius-sm); padding: 10px; margin-top: 10px; }
.header .input-note{ font-size: 12px; color: var(--c-text-soft); margin-top: 8px; }
.header .agayn_send{ color: var(--c-primary-dark); cursor: pointer; text-decoration: underline; margin-top: 4px; }

/* ── Корзина: сплошная зелёная кнопка с суммой ── */
.header .basket.shopping-cart .cart{
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--c-primary);
  color: #fff;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-brand);
  white-space: nowrap;
  transition: background var(--transition);
}
.header .basket.shopping-cart .cart:hover{ background: var(--c-primary-dark); }
.header .hdr-cart-icon{ flex: 0 0 auto; color: #fff; }
.header .basket.shopping-cart .cart .bas{ font-size: 14px; font-weight: 700; display: block; }
.header .basket.shopping-cart .totalSum{ font-size: 12px; opacity: .9; display: block; }
.header .basket.shopping-cart .totalCount{ background: #fff; color: var(--c-primary-dark); border-radius: var(--radius-pill); min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; padding: 0 5px; }
.header .basket.shopping-cart .totalCount:empty{ display: none; }

/* ═════════════════════════ МЕНЮ КАТАЛОГА И РАЗДЕЛОВ ═════════════════════════ */
.header .header_menu{background: var(--c-primary-darker);}
.header .header_menu_center{ max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.header .header-nav{ display: flex; align-items: stretch; flex-wrap: wrap; }
.header .header-nav__first-level, .header .header-nav__menu-level{ display: flex; align-items: stretch; }

.header .header-nav__item{ position: relative; }
.header .header-nav__link{display: flex;align-items: center;gap: 8px;padding: 14px 16px;color: #fff;font-size: 14px;white-space: nowrap;transition: color var(--transition), background var(--transition);}
.header .spec155 .header-nav__link{background: var(--c-dark);}
.header .spec155 .header-nav__link:hover{ background: #012400; }
.header .spec155 .header-nav__link[aria-expanded="true"]{ background: #012400; }
.header .header-nav__item .hvr-underline-from-center{ position: relative; }
.header .header-nav__item .hvr-underline-from-center::after{content:"";position: absolute;left: 16px;right: 16px;bottom: 8px;height: 2px;background: var(--c-primary);transform: scaleX(0);transition: transform var(--transition);}
.header .header-nav__item:hover > .hvr-underline-from-center::after, .header .header-nav__item:focus-within > .hvr-underline-from-center::after{ transform: scaleX(1); }
.header .hdr-percent-icon{
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 5px;
  background: var(--c-promo);
  color: #fff;
  font-size: 11px; font-weight: 700; font-style: normal;
}
.header .header-nav__item bdi{
  position: absolute;
  top: -2px; right: 4px;
  background: #e8342a;
  color: #fff;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.5;
}

/* ── Иконки кнопки «Каталог»: гамбургер ↔ крестик ── */
.header .hdr-catalog-icon{ flex: 0 0 auto; }
.header .hdr-catalog-icon--close{ display: none; }
.header #hdrCatalogToggle[aria-expanded="true"] .hdr-catalog-icon--open{ display: none; }
.header #hdrCatalogToggle[aria-expanded="true"] .hdr-catalog-icon--close{ display: block; }

/* ── Мега-меню каталога (десктоп: по клику, все пункты видны сразу,
     без наведения — многоколоночная раскладка на всю ширину) ── */
.submenu{
  display: none;
  position: fixed;
  top: var(--hdr-height, 120px); left: 0; right: 0;
  width: auto; max-width: none; min-width: 0;
  background: #fff; color: var(--c-text);
  max-height: calc(100vh - var(--hdr-height, 120px));
  overflow-y: auto;
  box-shadow: var(--c-panel-shadow);
  z-index: 200;
  padding: 28px 24px;
  columns: 4 260px;
  column-gap: 36px;
}
.submenu.is-open{ display: block; }
.hdr-catalog-bar{ display: none; }

.submenu_item{break-inside: avoid;display: block;/* margin-bottom: 22px; */}
.submenu_item > a{ display: flex; align-items: center; gap: 10px; padding: 0 0 10px; font-size: 15px; font-weight: 700; font-family: var(--font-brand); color: var(--c-text); border-bottom: 1px solid var(--c-border-soft); margin-bottom: 8px; transition: color var(--transition); }
.submenu_item > a img{ width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.submenu_item:hover > a, .submenu_item:focus-within > a{ color: var(--c-primary-dark); }
.submenu_item__toggle{ display: none; }

.subsubmenu-panel{ display: block; position: static; background: none; min-width: 0; max-height: none; overflow: visible; box-shadow: none; border-radius: 0; padding: 0; }
.hdr-catalog-bar--sub{ display: none; }
.subsubsubmenu_item a{ display: block; padding: 5px 0; font-size: 13.5px; color: var(--c-text-soft); transition: color var(--transition); }
.subsubsubmenu_item a:hover{ color: var(--c-primary-dark); }


/* ═════════════════════════ МОБИЛЬНАЯ АДАПТАЦИЯ (<992px) ═════════════════════════ */
@media (max-width: 991px){

  .header{ box-shadow: 0 1px 8px rgba(0,45,0,.06); }
  .header .header_top_center{padding: 5px 0;gap: 10px 12px;border-bottom: none;flex-wrap: nowrap;}

  /* ── Компактная иконочная строка: логотип слева, звонок/поиск/бургер справа ── */
  .header .logo_right{ order: 1; flex-shrink: 0; }
  .header .logo_right .header__logo img{width: 100px;height: 40px;}
  .header .logo_right .mobile77{ display: none; }

  .header .contact_i,
  .header .icon-btns-row,
  .header .head_pofile,
  .header .hvr-bounce-in{ display: none; } /* переезжают в выезжающую панель и нижнюю мобильную навигацию — не дублируем пустыми кнопками */

  .header .hdr-call-btn,
  .header .hdr-search-toggle,
  .header .hdr-burger{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
  }
  .header .hdr-call-btn{order: 3;background: #60c200;color: #fff;box-shadow: 0 3px 10px rgba(37,211,102,.35);margin-left: auto;}
  .header .hdr-call-btn:active{ transform: scale(.94); }
  .header .hdr-search-toggle{ order: 4; background: var(--c-primary-tint); color: var(--c-primary-dark); }
  .header .hdr-search-toggle img{ width: 19px; height: 19px; }
  .header .hdr-burger{ order: 5; background: var(--c-primary-tint); color: var(--c-primary-dark); flex-direction: column; gap: 4px; }
  .header .hdr-burger span{ display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .22s ease, opacity .22s ease; }
  .header .hdr-burger[aria-expanded="true"], .header .hdr-search-toggle[aria-expanded="true"]{ background: var(--c-primary); color: #fff; }
  .header .hdr-burger[aria-expanded="true"] span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
  .header .hdr-burger[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
  .header .hdr-burger[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

  /* ── Поиск: полноэкранный оверлей (как в референсе) ──
     !important на позиционировании — чтобы десктопное правило
     (у него тоже есть display:flex !important) ни при каких
     условиях не могло взять верх на мобильной ширине. ── */
  .header .header-search.search_bar{
    order: 10;
    position: fixed !important;
    inset: 0 !important;
    max-width: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border: 0;
    border-radius: 0;
    padding: calc(env(safe-area-inset-top,0px) + 14px) 14px 14px;
    background: #fff;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform .28s cubic-bezier(.25,.46,.45,.94), opacity .28s ease, visibility .28s;
    z-index: 1300;
  }
  .header .header-search.search_bar.is-open{ transform: translateY(0); opacity: 1; pointer-events: auto; visibility: visible; }
  .header .hdr-search-row{ display: flex !important; align-items: center !important; flex: 0 0 auto; width: 100%; gap: 8px; }
  .header .hdr-search-back{ display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; color: var(--c-text); }
  .header .header-search .search_input{ padding-left: 6px; }
  .header .header-search__voice-btn{ padding: 0 10px; }
  .header .header-search__search-submit-btn{ padding: 0 10px; }
  .header .search_five_res{
    position: static !important;
    width: 100%;
    flex: 1 1 auto;
    margin-top: 8px;
    border-radius: 0;
    box-shadow: none;
    max-height: none;
    overflow-y: auto;
  }

  /* ═══ Выезжающая панель (каталог + разделы): справа, под шапкой ═══ */
  .header .header_menu{
    position: fixed;
    top: var(--hdr-height, 52px);
    right: 0;
    left: auto;
    width: min(380px, 90vw);
    height: calc(100% - var(--hdr-height, 64px));
    background: #fff;
    color: var(--c-text);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.25,.46,.45,.94);
    z-index: 1100;
    box-shadow: var(--c-panel-shadow);
    display: flex;
    flex-direction: column;
  }
  .header .header_menu.is-open{ transform: translateX(0); }
  .header .header_menu_center{padding: 0;max-width: none;width: 100%;}

  /* ── Цветной блок контактов вверху панели (как в референсе) ── */
  .header .hdr-drawer-contacts{
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px 22px;
    background: #2d3039;
    flex: 0 0 auto;
  }
  .header .hdr-drawer-contacts__phone{font-size: 20px;font-weight: 700;color: #fff;}
  .header .hdr-drawer-contacts__messengers{ display: flex; align-items: center; gap: 10px; }
  .header .hdr-drawer-contacts__messengers a{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
  }
  .header .hdr-drawer-contacts__messengers a:hover{ background: rgba(255,255,255,.24); }
  .header .hdr-drawer-contacts__messengers img{width: 26px;height: 26px;object-fit: contain;}
  .header .hdr-drawer-contacts__address{ display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; color: #bcd9ac; }
  .header .hdr-drawer-contacts__address svg{ flex: 0 0 auto; margin-top: 1px; }
  .header .hdr-drawer-contacts__cta{
    margin-top: 6px; padding: 12px; border: none; border-radius: var(--radius-sm);
    background: #ffffff; color: var(--c-dark);
    font-family: var(--font-brand); font-weight: 700; font-size: 13.5px;
    transition: background var(--transition);
  }
  .header .hdr-drawer-contacts__cta:hover{ background: var(--c-primary-tint); }

  .header .header-nav{ flex-direction: column; flex-wrap: nowrap; }
  .header .header-nav__first-level, .header .header-nav__menu-level{ flex-direction: column; width: 100%; }

  .header .header-nav__link{ color: var(--c-text); padding: 15px 22px; width: 100%; justify-content: space-between; border-bottom: 1px solid var(--c-border-soft); }
  .header .spec155 .header-nav__link{ background: var(--c-primary-tint); color: var(--c-primary-dark); font-weight: 700; }
  .header .spec155 .header-nav__link:hover{ background: var(--c-primary-tint); }
  .header .header-nav__link::after{ content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--transition); flex-shrink: 0; opacity: .6; }
  .header .header-nav__link[aria-expanded="true"]::after{ transform: rotate(45deg); }
  .header .header-nav__item .hvr-underline-from-center::after{ display: none; }
  .header .header-nav__menu-level .header-nav__link{ color: var(--c-text); font-weight: 400; }
  .header .header-nav__menu-level .header-nav__link::after{ display: none; }
  .header .hdr-nav-account-item .header-nav__link{ color: var(--c-primary-dark); font-weight: 600; border-bottom: none; }

  /* ── Каталог: собственный полноэкранный список (не выпадашка) ── */
  .submenu{
    display: none;
    position: fixed; inset: 0;
    box-shadow: none; min-width: 0; max-height: none; border-radius: 0;
    background: #fff;
    z-index: 1150;
    overflow-y: auto;
    flex-direction: column;
    columns: unset;
    column-gap: normal;
    padding: 0;
  }
  .submenu.is-open{ display: flex; }

  .hdr-catalog-bar{ display: flex; position: sticky; top: 0; z-index: 2; background: var(--c-primary-tint); }
  .hdr-catalog-bar__close{
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 16px 20px;
    color: var(--c-primary-darker); font-size: 15px; font-weight: 600; font-family: var(--font-brand);
    justify-content: space-between;
  }

  .submenu_item{ display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 0; }
  .submenu_item > a{ flex: 1; display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--c-border-soft); margin-bottom: 0; font-size: 15px; font-weight: 400; }
  .submenu_item > a img{ width: 26px; height: 26px; }
  .submenu_item--leaf > a{ padding-right: 20px; }
  .submenu_item__toggle{ display: flex; align-items: center; justify-content: center; width: 48px; align-self: stretch; border-bottom: 1px solid var(--c-border-soft); color: var(--c-text-soft); flex-shrink: 0; }
  .submenu_item__toggle .hdr-chevron-icon{ transition: transform var(--transition); }
  .submenu_item__toggle[aria-expanded="true"] .hdr-chevron-icon{ transform: rotate(45deg); }
  .submenu_item:hover, .submenu_item:focus-within{ background: transparent; }

  .subsubmenu-panel{
    display: block;
    position: fixed; inset: 0;
    z-index: 1180;
    background: #fff;
    box-shadow: none; min-width: 0; max-height: none; border-radius: 0; padding: 0;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.25,.46,.45,.94);
    display: flex;
    flex-direction: column;
  }
  .submenu_item.is-open > .subsubmenu-panel{ transform: translateX(0); }

  .hdr-catalog-bar--sub{
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 2;
    background: var(--c-primary-tint);
    flex: 0 0 auto;
  }
  .hdr-catalog-bar__back{
    display: flex; align-items: center; gap: 10px;
    flex: 1 1 auto; min-width: 0;
    padding: 16px 16px;
    color: var(--c-primary-darker); font-size: 15px; font-weight: 600; font-family: var(--font-brand);
  }
  .hdr-catalog-bar__back span{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hdr-catalog-bar__x{
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 52px; height: 52px;
    border-left: 1px solid rgba(0,0,0,.06);
    color: var(--c-primary-darker);
  }

  .subsubmenu{ flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fafcf8; }
  .submenu_item.is-open .subsubmenu{ display: block; }
  .subsubsubmenu_item a{ padding: 14px 20px; border-bottom: 1px solid var(--c-border-soft); font-size: 15px; }

  /* затемнение фона при открытой панели */
  .header .hdr-overlay{ position: fixed; top: var(--hdr-height, 64px); left: 0; right: 0; bottom: 0; background: rgba(0,20,0,.45); opacity: 0; pointer-events: none; transition: opacity var(--transition); z-index: 1050; }
  .header .hdr-overlay.is-open{ opacity: 1; pointer-events: auto; }

  /* ═══ Профиль (гость): та же форма входа, что и на десктопе,
     но на мобиле показывается как шторка снизу вверх ═══ */
  .header .header-login{ display: block; }
  .header .house_category_title_login{ display: none; }
  .header .house_category_content_login{
    display: flex !important;
    flex-direction: column;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: auto; width: auto; max-width: none;
    border-radius: 18px 18px 0 0;
    padding: 20px 22px calc(env(safe-area-inset-bottom,0px) + 22px);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.25,.46,.45,.94);
    z-index: 1250;
    box-shadow: 0 -20px 48px rgba(0,45,0,.2);
  }
  .header .house_category_content_login.is-open{ transform: translateY(0); }
  .header .hdr-profile-sheet__close{
    display: flex;
    align-items: center; justify-content: center;
    position: absolute; top: 14px; right: 14px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--c-border-soft);
    color: var(--c-text-soft);
  }

  /* ═══ Нижняя мобильная панель: Главная / Каталог / Корзина / Профиль / Меню ═══ */
  body{ padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .hdr-bottom-nav{
    display: flex;
    align-items: stretch;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid var(--c-border-soft);
    box-shadow: 0 -6px 20px rgba(0,45,0,.08);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .hdr-bottom-nav__item{
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px 0;
    color: var(--c-text-soft);
    font-size: 10.5px;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .hdr-bottom-nav__item:hover, .hdr-bottom-nav__item:active{ color: var(--c-primary-dark); }
  .hdr-bottom-nav__item--cart{ color: var(--c-primary-dark); font-weight: 600; }
  .hdr-bottom-nav__cart-circle{
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    margin-top: -20px;
    border-radius: 50%;
    background: var(--c-gradient-brand);
    box-shadow: 0 8px 18px rgba(96,195,0,.38), 0 0 0 4px #fff;
    transition: transform .15s ease;
  }
  .hdr-bottom-nav__item--cart:active .hdr-bottom-nav__cart-circle{ transform: scale(.93); }
  .hdr-bottom-nav__badge{
    position: absolute;
    top: -3px; right: -3px;
    min-width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    border-radius: var(--radius-pill);
    background: var(--c-dark);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    box-shadow: 0 0 0 2px #fff;
  }
  .hdr-bottom-nav__badge:empty{ display: none; }
}

@media (min-width: 992px){
  .hdr-bottom-nav{ display: none !important; }
}

@media (min-width: 992px){
  .header .hdr-overlay,
  .header .hdr-call-btn,
  .header .hdr-search-toggle,
  .header .hdr-search-back,
  .hdr-catalog-bar,
  .header .hdr-nav-account-item{ display: none !important; }
}

/* ── Совсем узкие экраны ── */
@media (max-width: 380px){
  .header .logo_right .header__logo img{ width: 96px; height: 33px; }
  .header .header_menu{ width: 100vw; }
}

/* ───────────────────────── Доступность ───────────────────────── */
.header a:focus-visible, .header button:focus-visible, .header input:focus-visible{ outline: 2px solid var(--c-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce){
  .header, .header *{ transition-duration: .001ms !important; animation-duration: .001ms !important; }
}