/* Compact header shared by the main site, calculator and installation page. */
html {
  scroll-padding-top: 100px;
}

header {
  background: var(--dark);
}

.header-row {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 84px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.header-row > .brand {
  width: 220px;
  flex: 0 0 220px;
  margin: 0;
}

.header-row > .nav {
  display: flex;
  position: static;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  padding: 0;
  border: 0;
}

.header-row > .nav > a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  font-size: .875rem;
}

.header-row > .header-controls {
  position: static;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  width: auto;
}

.header-controls > .languages {
  position: static;
}

.header-controls > .menu {
  display: none;
  margin: 0;
}

@media (max-width: 1180px) {
  html {
    scroll-padding-top: 92px;
  }

  .header-row {
    min-height: 78px;
    gap: 16px;
  }

  .header-row > .brand {
    width: 200px;
    flex-basis: 200px;
  }

  .header-row > .header-controls {
    margin-left: auto;
  }

  .header-controls > .menu {
    display: block;
    order: -1;
  }

  .header-row > .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    margin: 0;
    padding: 12px 24px 20px;
    background: var(--dark);
    border-bottom: 1px solid #697680;
    max-height: calc(100dvh - 78px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
  }

  .header-row > .nav[data-open=true] {
    display: flex;
  }

  .header-row > .nav > a {
    width: 100%;
    min-height: 44px;
    padding: 12px 0;
    font-size: 1rem;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  html {
    scroll-padding-top: 86px;
  }

  .header-row {
    min-height: 72px;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header-row > .brand {
    width: clamp(122px, calc(100vw - 188px), 180px);
    flex-basis: clamp(122px, calc(100vw - 188px), 180px);
  }

  .header-row > .header-controls {
    gap: 8px;
  }

  .header-row > .nav {
    padding-left: 20px;
    padding-right: 20px;
    max-height: calc(100dvh - 72px - env(safe-area-inset-top, 0px));
  }
}
