/* Fixed desktop navigation; the mobile header keeps its existing sticky behavior. */
.sticky-desktop-header { display: none; }
@media (min-width: 761px) {
  .sticky-desktop-header {
    display: block; position: fixed; inset: 0 0 auto; z-index: 900;
    width: 100%; line-height: 0; background: #fff;
    box-shadow: 0 3px 14px rgba(0,0,0,.08);
  }
  .sticky-desktop-header svg {
    display: block; width: 100%; height: auto; aspect-ratio: 1440 / 74; overflow: visible;
  }
}
@media (max-width: 760px) { .sticky-desktop-header { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .sticky-desktop-header { scroll-behavior: auto; } }

.sticky-html-header {
  min-height: clamp(54px, 5.15vw, 74px);
  box-sizing: border-box;
  padding: 0 clamp(16px, 4.2vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  white-space: nowrap;
  line-height: 1.2;
  font-family: Inter, Arial, sans-serif;
}
.sticky-html-header a {
  color: #393939;
  text-decoration: none;
  font-size: clamp(12px, 1.12vw, 16px);
  flex: 0 0 auto;
}
.sticky-html-header > a:first-child {
  font-family: Onest, Inter, Arial, sans-serif;
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 700;
  border-bottom: 3px solid #ff5800;
  padding-bottom: 5px;
}
.sticky-html-header nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 28px);
  min-width: 0;
}
.sticky-html-header > a:nth-of-type(2) {
  border: 1px solid #939393;
  border-radius: 22px;
  padding: 12px 16px;
}
.sticky-html-cart {
  flex: 0 0 auto;
  min-height: 43px;
  border: 0;
  border-radius: 24px;
  padding: 0 22px;
  color: #fff;
  background: #ff5800;
  font: 500 14px Onest, Inter, Arial, sans-serif;
  cursor: pointer;
}
@media (max-width: 1050px) {
  .sticky-html-header { gap: 10px; padding-inline: 16px; }
  .sticky-html-header nav { gap: 10px; }
  .sticky-html-header nav a:last-child { display: none; }
  .sticky-html-header > a:nth-of-type(2) { display: none; }
  .sticky-html-cart { padding-inline: 14px; }
}
@media (max-width: 820px) {
  .sticky-html-header nav a:nth-child(3),
  .sticky-html-header nav a:nth-child(4) { display: none; }
}

/* Desktop navigation hover: visual feedback only; keep all hit areas and handlers. */
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .sticky-desktop-header > svg > a,
  .sticky-desktop-header > svg > a > rect {
    cursor: pointer;
  }
  .sticky-html-header nav a {
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .22s ease, box-shadow .22s ease;
  }
  .sticky-html-header nav a:hover {
    background-color: rgba(255, 88, 0, .11);
    box-shadow: 0 0 0 5px rgba(255, 88, 0, .11);
  }
}
@media (min-width: 761px) {
  .sticky-desktop-header > svg > rect[aria-label="Открыть корзину"] {
    cursor: pointer;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-desktop-header > svg > a > rect,
  .sticky-html-header nav a {
    transition: none !important;
  }
}

/* Compact hover decoration, independent of the original clickable rectangle. */
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .sticky-desktop-header > svg > a > rect:not(.nav-hover-pill),
  .sticky-desktop-header > svg > a:hover > rect:not(.nav-hover-pill) {
    fill: transparent;
    rx: 0;
    ry: 0;
  }
  .sticky-desktop-header > svg > a > .nav-hover-pill {
    fill: #ff5800;
    opacity: 0;
    rx: 17px;
    ry: 17px;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .sticky-desktop-header > svg > a:hover > .nav-hover-pill {
    fill: #ff5800;
    opacity: .08;
  }
  .sticky-html-header nav a:hover {
    background-color: rgba(255, 88, 0, .08);
    box-shadow: 0 0 0 5px rgba(255, 88, 0, .08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-desktop-header > svg > a > .nav-hover-pill { transition: none; }
}

/* Match the existing outlined phone button, without changing its link. */
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .sticky-desktop-header > svg > a[aria-label="Позвонить нам"] > rect:not(.nav-hover-pill) {
    rx: 21.5px;
    ry: 21.5px;
    transition: fill .22s ease;
  }
  .sticky-desktop-header > svg > a[aria-label="Позвонить нам"]:hover > rect:not(.nav-hover-pill) {
    fill: rgba(255, 88, 0, .08);
    rx: 21px;
    ry: 21px;
  }
  .sticky-html-header > a[href^="tel:"] {
    cursor: pointer;
    transition: background-color .22s ease;
  }
  .sticky-html-header > a[href^="tel:"]:hover {
    background-color: rgba(255, 88, 0, .08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-html-header > a[href^="tel:"] { transition: none; }
}

/* Legacy SVG header hit areas must not flash square hover fills. */
@media (min-width: 761px) {
  svg.design > .hit[y="8"], svg.design > .hit[y="15"][x="972"],
  svg.design > a.nav-link > rect[y="8"] { rx: 22px; ry: 22px; }
  body:has(.sticky-desktop-header) svg.design > .hit[y="8"],
  body:has(.sticky-desktop-header) svg.design > .hit[y="15"][x="972"],
  body:has(.sticky-desktop-header) svg.design > a.nav-link:has(> rect[y="8"]) { display: none; }
}
