/* Header styles are isolated from the homepage and footer components. */
html { scroll-padding-top: 116px; }
.site-header {
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid #e3ece6;
    box-shadow: 0 4px 24px rgba(18, 61, 42, .035);
}
.site-header .container { width: min(calc(100% - 64px), 1320px); }
.site-header .header-inner { min-height: 96px; gap: 24px; position: relative; }
.site-header .header-brand { min-width: 0; flex: 0 0 244px; gap: 12px; }
.site-header .brand-logo { width: 66px; height: 68px; max-height: none; object-fit: contain; flex-shrink: 0; display: block; }
.site-header .brand-mark { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px; }
.site-header .brand-mark svg { width: 32px; height: 32px; }
.brand-copy { display: grid; gap: 4px; min-width: 0; }
.site-header .brand-name { font-size: 17px; line-height: 1.2; font-weight: 800; letter-spacing: -.025em; }
.brand-area { font-size: 11px; font-weight: 500; line-height: 1.35; color: #68776e; }
.site-header .nav { display: block; margin-left: auto; min-width: 0; }
.site-header .nav ul { padding: 0; margin: 0; list-style: none; }
.nav-menu { display: flex; align-items: center; gap: 2px; }
.site-header .nav li { list-style: none; position: relative; margin: 0; padding: 0; }
.site-header .nav a { display: flex; align-items: center; gap: 8px; padding: 12px 11px; font-size: 14px; font-weight: 600; line-height: 1.35; color: #46554c; border-radius: 9px; white-space: nowrap; transition: background .18s, color .18s; }
.site-header .nav a:hover { background: #f0f8f3; color: #146a42; }
.site-header .nav a.is-active,
.site-header .nav a[aria-current="page"] { background: #eaf6ee; color: #146a42; }
.site-header .header-actions { gap: 16px; margin-left: 0; flex-shrink: 0; }
.header-phone { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; font-size: 14px; font-weight: 700; color: #234735; white-space: nowrap; }
.header-phone-icon { display: grid; place-items: center; width: 34px; height: 34px; background: #eef7f1; border-radius: 50%; transition: background .18s; }
.header-phone-icon svg { width: 17px; height: 17px; }
.header-phone:hover .header-phone-icon { background: #dbefdf; }
.site-header .header-request { padding: 13px 17px; min-height: 46px; border-radius: 11px; gap: 12px; font-size: 14px; font-weight: 700; line-height: 1.35; white-space: nowrap; box-shadow: 0 4px 12px rgba(21, 151, 93, .13); }
.header-request svg, .nav-mobile-actions svg { width: 17px; height: 17px; flex-shrink: 0; }
.site-header .mobile-toggle, .nav-mobile-actions, .submenu-toggle { display: none; }
.site-header :is(a, button):focus-visible { outline: 3px solid #15975d; outline-offset: 4px; }
.menu-toggle-lines { display: grid; gap: 5px; width: 19px; }
.menu-toggle-lines span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.mobile-toggle[aria-expanded="true"] .menu-toggle-lines span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle[aria-expanded="true"] .menu-toggle-lines span:nth-child(2) { opacity: 0; }
.mobile-toggle[aria-expanded="true"] .menu-toggle-lines span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.site-header .nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; max-width: 320px; padding: 8px; background: #fff; border: 1px solid #e3ece6; border-radius: 13px; box-shadow: 0 14px 36px rgba(18, 61, 42, .12); }
.site-header .nav .sub-menu a { white-space: normal; }
.site-header .nav .sub-menu .sub-menu { left: 100%; top: -8px; }
.site-header .nav li:hover > .sub-menu,
.site-header .nav li:focus-within > .sub-menu { display: block; }
.site-header .menu-item-has-children > a::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); flex-shrink: 0; }
.admin-bar .site-header { top: 32px; }
html:has(body.admin-bar) { scroll-padding-top: 148px; }

@media (max-width: 1240px) {
    html { scroll-padding-top: 100px; }
    html:has(body.admin-bar) { scroll-padding-top: 132px; }
    .site-header .header-inner { min-height: 82px; gap: 16px; flex-wrap: wrap; }
    .site-header .header-brand { flex-basis: 260px; order: 1; }
    .site-header .header-actions { margin-left: auto; order: 2; gap: 12px; }
    .site-header .brand-logo { width: 58px; height: 62px; }
    .site-header .nav { order: 3; flex: 0 0 100%; margin: 0; padding: 12px 0 20px; border-top: 1px solid #e3ece6; }
    .site-header .nav-menu { display: grid; gap: 3px; }
    .site-header .nav a { padding: 13px 14px; font-size: 15px; min-height: 46px; white-space: normal; }
    .site-header.js-navigation .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 12px; border: 1px solid #e3ece6; border-radius: 0 0 18px 18px; background: #fff; box-shadow: 0 18px 30px rgba(18, 61, 42, .12); max-height: calc(100dvh - 170px); overflow-y: auto; overscroll-behavior: contain; }
    .site-header.js-navigation .nav.open { display: block; }
    .site-header.js-navigation .mobile-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: #234735; background: #f5f9f6; border: 1px solid #e0eae3; border-radius: 11px; cursor: pointer; }
    .nav-mobile-actions { display: grid; gap: 14px; margin-top: 12px; padding: 18px 2px 6px; border-top: 1px solid #e3ece6; }
    .nav-mobile-actions .btn { min-height: 48px; border-radius: 11px; font-size: 15px; font-weight: 700; }
    .site-header .nav .nav-mobile-actions .btn-primary { color: #fff; background: var(--green); justify-content: center; }
    .site-header .nav .nav-mobile-actions .btn-primary:hover { background: #0d804c; }
    .site-header .nav .nav-mobile-phone { justify-content: center; font-size: 14px; color: #315e44; }
    .site-header .nav .sub-menu,
    .site-header .nav .sub-menu .sub-menu { display: block; position: static; min-width: 0; max-width: none; border: 0; border-left: 2px solid #dcefe2; border-radius: 0; box-shadow: none; padding: 0 0 0 10px; margin: 4px 0 6px 14px; }
    .site-header.js-navigation .nav li > .sub-menu { display: none; }
    .site-header.js-navigation .nav li.submenu-open > .sub-menu { display: block; }
    .site-header .menu-item-has-children > a::after { display: none; }
    .site-header.js-navigation .menu-item-has-children > a { margin-right: 46px; }
    .site-header .submenu-toggle { display: grid; place-items: center; position: absolute; top: 2px; right: 0; width: 42px; height: 42px; padding: 0; background: #f4f9f5; border: 1px solid #e3ece6; border-radius: 9px; color: #234735; cursor: pointer; }
    .submenu-toggle::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
    .submenu-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
}
@media (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
    html:has(body.admin-bar) { scroll-padding-top: 146px; }
}
@media (max-width: 700px) {
    .site-header .container { width: calc(100% - 28px); }
    .site-header .header-inner { min-height: 78px; gap: 10px; }
    .site-header .header-brand { flex: 1 1 0; gap: 8px; }
    .site-header .brand-logo { width: 48px; height: 52px; }
    .site-header .brand-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
    .site-header .brand-mark svg { width: 26px; height: 26px; }
    .site-header .brand-name { font-size: 14px; max-width: 160px; }
    .brand-area { font-size: 10px; }
    .site-header .header-actions { gap: 8px; }
    .site-header .header-request, .header-phone-number { display: none; }
    .header-phone-icon { width: 44px; height: 44px; border-radius: 11px; }
    .header-phone-icon svg { width: 20px; height: 20px; }
}
@media (max-width: 600px) {
    .admin-bar .site-header { top: 0; }
    html:has(body.admin-bar) { scroll-padding-top: 100px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .site-header :is(a, span) { transition: none; }
    .site-header .btn:hover { transform: none; }
}
