/* Шапка сайта: верхняя полоса, основная панель, меню, мобильный drawer */
:root {
  --sh-accent: #218dcc;
  --sh-accent-light: #72bfea;
  --sh-text: #1c2733;
  --sh-muted: #6b7a89;
  --sh-line: #e6edf3;
  --sh-bg: #fff;
  --sh-h: 92px;
  --sh-gap: 40px;
  --sh-ease: cubic-bezier(.22, .61, .36, 1);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  margin: 0 0 var(--sh-gap);
  background: var(--sh-bg);
  border-bottom: 1px solid var(--sh-line);
  font-family: 'Open Sans', Arial, sans-serif;
  color: var(--sh-text);
}

.site-header a { text-decoration: none; }
.site-header ul { list-style: none; margin: 0; padding: 0; }

.sh-inner {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3.4vw, 56px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

/* верхняя полоса (схлопывается при прокрутке) */
.sh-top {
  background: none;
  font-size: 13px;
  max-height: 48px;
  overflow: hidden;
  transition: max-height .25s ease, opacity .2s ease;
}
.site-header.is-scrolled .sh-top { max-height: 0; opacity: 0; }
.sh-top .sh-inner { min-height: 44px; }
.sh-top__info, .sh-top__links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 28px; }
.sh-top__item { color: var(--sh-muted); transition: color .25s; }
.sh-top__item .fa { color: var(--sh-accent); margin-right: 4px; }
.sh-top__links a { color: var(--sh-muted); transition: color .25s; }
.sh-top__links a:hover, a.sh-top__item:hover { color: var(--sh-accent); }

/* основная панель */
.sh-main .sh-inner { min-height: var(--sh-h); }
.sh-logo { flex: 0 0 auto; display: block; }
.sh-logo img { max-width: none; }
.sh-logo img { display: block; height: 56px; width: auto; }

/* меню */
.sh-nav { flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-width: 0; }
.sh-nav__head, .sh-nav__quick, .sh-nav__cta { display: none; }
.sh-nav .sh-menu { display: flex; align-items: center; gap: 6px; }
.sh-menu > li { position: relative; }
.sh-menu > li > a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 11px;
  border-radius: 10px;
  color: var(--sh-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.sh-menu > li.menu-item-has-children > a::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}
.sh-menu > li:hover > a,
.sh-menu > li:focus-within > a,
.sh-menu > li.current-menu-item > a { background: #eaf5fc; color: var(--sh-accent); }
.sh-menu > li.menu-item-has-children:hover > a::after { transform: rotate(-135deg) translateY(-2px); }

.sh-menu .sub-menu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 260px;
  margin-top: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--sh-line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(20, 50, 80, .12);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility 0s linear .18s;
}
/* "мостик", чтобы меню не закрывалось при движении курсора вниз */
.sh-menu .sub-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.sh-menu > li:hover > .sub-menu,
.sh-menu > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.sh-menu .sub-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--sh-text);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.sh-menu .sub-menu a:hover { background: #eaf5fc; color: var(--sh-accent); }

/* телефон, кнопка, бургер */
.sh-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 20px; }
.sh-phone { display: flex; align-items: center; gap: 10px; color: var(--sh-text); }
.sh-phone .fa {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #eaf5fc;
  color: var(--sh-accent);
  font-size: 20px;
}
.sh-phone span { display: flex; flex-direction: column; line-height: 1.15; }
.sh-phone b { font-size: 17px; font-weight: 700; white-space: nowrap; transition: color .25s; }
.sh-phone small { display: none; }
.sh-phone:hover b { color: var(--sh-accent); }

.sh-cta {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 8px;
  background: #1b7fbf;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: none;
  transition: background .2s ease;
}
.sh-cta:hover { background: #166ca4; color: #fff; }

.sh-burger {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #eaf5fc;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.sh-burger span {
  position: absolute;
  left: 11px; right: 11px;
  height: 2px;
  border-radius: 2px;
  background: var(--sh-accent);
  transition: transform .25s ease, opacity .2s ease, top .25s ease;
}
.sh-burger span:nth-child(1) { top: 14px; }
.sh-burger span:nth-child(2) { top: 21px; }
.sh-burger span:nth-child(3) { top: 28px; }

.sh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 45, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
  z-index: 1001;
}

/* планшеты и телефоны: меню в выезжающей панели */
@media (max-width: 1400px) {
  :root { --sh-h: 64px; --sh-gap: 18px; }
  .sh-top { display: none; }
  .sh-logo img { height: 42px; }
  .sh-burger { display: block; }
  .sh-actions > .sh-cta { display: none; }
  .sh-phone span { display: none; }
  .sh-actions { gap: 10px; }

  .site-header.is-open .sh-burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
  .site-header.is-open .sh-burger span:nth-child(2) { opacity: 0; }
  .site-header.is-open .sh-burger span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

  .sh-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(380px, 88vw);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0 0 28px;
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(104%);
    visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
    z-index: 1002;
    box-shadow: -10px 0 40px rgba(0, 0, 0, .15);
  }
  .site-header.is-open .sh-nav { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  .site-header.is-open .sh-overlay { opacity: 1; visibility: visible; transition-delay: 0s; }

  .sh-nav__head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fff;
    border-bottom: 1px solid var(--sh-line);
    font-size: 18px;
    font-weight: 700;
  }
  .sh-close {
    width: 40px; height: 40px;
    border: 0;
    border-radius: 12px;
    background: #eaf5fc;
    color: var(--sh-accent);
    font-size: 20px;
    cursor: pointer;
  }

  .sh-nav .menu-new-container { width: 100%; }
  .sh-nav .sh-menu { flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 12px; }
  .sh-menu > li > a { padding: 14px 12px; font-size: 16px; justify-content: space-between; }
  .sh-menu > li:hover > a, .sh-menu > li:focus-within > a { background: transparent; color: var(--sh-text); }
  .sh-menu > li.is-expanded > a,
  .sh-menu > li.current-menu-item > a { background: #eaf5fc; color: var(--sh-accent); }
  .sh-menu > li.menu-item-has-children:hover > a::after { transform: rotate(45deg) translateY(-2px); }
  .sh-menu > li.is-expanded > a::after { transform: rotate(-135deg) translateY(-2px); }

  .sh-menu .sub-menu {
    position: static;
    min-width: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0 0 0 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    visibility: visible;
    transform: none;
    transition: max-height .3s ease, opacity .2s ease, padding .3s ease;
  }
  .sh-menu .sub-menu::before { display: none; }
  .sh-menu > li:hover > .sub-menu, .sh-menu > li:focus-within > .sub-menu { opacity: 0; transform: none; }
  .sh-menu > li.is-expanded > .sub-menu { opacity: 1; padding: 4px 0 8px 12px; }
  .sh-menu .sub-menu a { padding: 12px; font-size: 15px; }
  .sh-menu .sub-menu a:hover { padding-left: 12px; }

  .sh-nav__quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 8px 20px 0;
    padding-top: 18px;
    border-top: 1px solid var(--sh-line);
  }
  .sh-nav__quick a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 12px;
    background: #f3f8fc;
    color: var(--sh-text);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
  }
  .sh-nav__quick .fa { font-size: 22px; color: var(--sh-accent); }

  .sh-nav__cta { display: flex; flex-direction: column; gap: 10px; margin: 18px 20px 0; }
  .sh-nav__cta .sh-cta { display: flex; justify-content: center; padding: 14px 20px; font-size: 15px; }
  .sh-nav__tel {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--sh-line);
    color: var(--sh-text);
    font-size: 18px;
    font-weight: 700;
  }
  .sh-nav__tel .fa { color: var(--sh-accent); }
}

@media (max-width: 480px) {
  .sh-inner { padding: 0 12px; gap: 10px; }
  :root { --sh-gap: 14px; }
  .sh-logo img { height: 36px; }
  .sh-phone .fa, .sh-burger { width: 42px; height: 42px; }
}

body.nav-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header * { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

.sh-top__links a.is-current { color: var(--sh-accent); font-weight: 600; }
