/* Responsive corrections: navigation, decorative overflow and narrow-screen CTAs. */
nav > div:first-child > a { flex-shrink: 0; }
nav > div:first-child { gap: 24px; }
nav > div:nth-child(2) { max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; }
nav button[aria-label="Меню"] { min-width: 44px; min-height: 44px; }
@media (max-width: 1023px) {
  nav > div:first-child > div { display: none !important; }
  nav button[aria-label="Меню"] { display: flex !important; }
  nav > div:nth-child(2) { display: flex !important; }
}
@media (min-width: 1024px) {
  nav > div:first-child { max-width: 1760px; }
  nav > div:first-child > div { gap: 20px; }
  nav > div:first-child > div:nth-of-type(2) { margin-left: 0; padding-left: 20px; }
}
section.relative:has(> .absolute.pointer-events-none) { overflow-x: clip; }
footer > div > div:last-child { flex-wrap: wrap; }
footer > div > div:last-child > div:last-child { flex-wrap: wrap; min-width: 0; row-gap: 12px; }
@media (max-width: 639px) {
  main h1, main h2, main h3 { overflow-wrap: anywhere; }
  main section div { min-width: 0; }
  main a.inline-flex { max-width: 100%; white-space: normal; height: auto; min-height: 48px; padding-top: 12px; padding-bottom: 12px; text-align: center; }
  main a.inline-flex > i { flex-shrink: 0; }
  nav > div:first-child { gap: 16px; }
  nav > div:nth-child(2) a { min-height: 44px; display: flex; align-items: center; }
  nav > div:nth-child(2) > div a { justify-content: center; white-space: normal; }
}
@media (max-width: 639px) {
  main h1[class] { font-size: clamp(26px, 7.5vw, 34px); line-height: 1.15; }
}

/* Keep every desktop navigation item visible; use two rows on small laptops. */
@media (min-width: 1024px) and (max-width: 1439px) {
  nav > div:first-child { display: grid; grid-template-columns: 1fr auto; height: 112px; gap: 0 24px; padding-inline: 24px; }
  nav > div:first-child > a { grid-column: 1; grid-row: 1; justify-self: start; }
  nav > div:first-child > div:nth-of-type(1) { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 12px; min-width: 0; }
  nav > div:first-child > div:nth-of-type(1) > a { font-size: 13px; }
  nav > div:first-child > div:nth-of-type(2) { grid-column: 2; grid-row: 1; }
}
@media (min-width: 1440px) and (max-width: 1599px) {
  nav > div:first-child { padding-inline: 24px; gap: 20px; }
  nav > div:first-child > div:nth-of-type(1) { gap: 16px; }
  nav > div:first-child > div:nth-of-type(1) > a { font-size: 13px; }
}
