:root {
  /* TODO adjust variables */
  --navi-icon-weight: 2px;
  --navi-icon-spacing: 7px;
  --navi-icon-bar-width: 30px;

  --header-height: 92px;
}

:root.scrolled:not(.navi-active) {
  --header-height: 92px;
}


/* ab 560px */
@media screen and (min-width: 768px) {
  /* TODO check if needed */
  :root {
    --navi-icon-weight: 4px;
    --navi-icon-spacing: 6px;
    --navi-icon-bar-width: 27px;
  }
}

/* ab 1040px */
@media screen and (min-width: 1040px) {
  /* TODO adjust variables */
  :root {
    --header-height: 130px;
  }
}

@media screen and (min-width: 1200px) {
  /* TODO adjust variables */
  :root {
    --header-height: 178px;
  }

  :root.scrolled:not(.navi-active) {
    --header-height: 100px;
  }
}

/*
 * Header
 */

.header-wrapper {
  background: rgb(var(--main-light-color));
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 34;
  pointer-events: none;
  transition: all .3s;
}

.header > * {
  pointer-events: all;
}

.header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  transition: all .3s;
}

.header.grid {
  max-width: 1694px;
}

.navi-logo {
  display: inline-block;
  height: auto;
  margin: 5px 0 0;
  opacity: 1;
  visibility: visible;
  transition: all .4s;
  width: 180px;
}

.navi-logo svg {
  width: 100%;
  height: 100%;
}

.nav-icon {
  background: rgba(var(--sub-light-color), 1);
  cursor: pointer;
  height: 49px;
  margin: 0;
  position: relative;
  text-align: left;
  transition: all .3s;
  width: 49px;
  z-index: 26;
}

.nav-icon > span {
  position: absolute;
  top: 50%;
  left: calc(50% - calc(var(--navi-icon-bar-width) / 2));
  display: block;
  width: var(--navi-icon-bar-width);
  height: var(--navi-icon-weight);
  background-color: rgb(var(--main-dark-color));
  margin-top: calc(0px - var(--navi-icon-weight) / 2);
  transform-origin: 50% 50%;
  transition: all .3s;
}

.nav-icon > span::after,
.nav-icon > span::before {
  content: "";
  position: absolute;
  height: 100%;
  background-color: rgb(var(--main-dark-color));
  transition: all .3s;
}

.nav-icon > span::before {
  width: 100%;
  transform: translateY(calc(0.1px - calc(var(--navi-icon-weight) + var(--navi-icon-spacing))));
}

.nav-icon > span::after {
  width: 100%;
  transform: translateY(calc(var(--navi-icon-spacing) + var(--navi-icon-weight)));
}

.navi-active .nav-icon > span {
  background: transparent !important;
}

.navi-active .nav-icon > span:before {
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}

.navi-active .nav-icon > span:after {
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

.navi-active .nav-icon > span:before,
.navi-active .nav-icon > span:after {
  width: 100%;
}

.navi-active .nav-icon span,
.navi-active .nav-icon > span:before,
.navi-active .nav-icon > span:after {
  background-color: rgb(var(--main-dark-color));
}

.no-topslider .nav-icon span,
.no-topslider .nav-icon > span:before,
.no-topslider .nav-icon > span:after,
.scrolled .nav-icon span,
.scrolled .nav-icon > span:before,
.scrolled .nav-icon > span:after {
  background-color: rgb(var(--main-dark-color));
}

/*
 * Navi General
 */

.nav {
  left: -100%;
  position: fixed;
  top: 0;
  height: 100 lvh;
  width: 100%;
  transition: all .4s;
  font-size: 1.8rem;
  margin: auto;
  background: rgb(var(--main-light-color));
  visibility: hidden;
}

.navi-active .nav {
  left: 0;
  visibility: visible;
}

.nav > ul {
  position: relative;
  list-style-type: none;
  padding: 20vh 0 0;
  width: 77.77%;
  margin: 0 auto;
  height: 100vh;
  overflow-y: auto;
}

.nav > ul li {
  position: relative;
  transition: all .4s;
}

.nav > ul a {
  position: relative;
  display: block;
  text-align: center;
  text-decoration: none;
  color: rgb(var(--main-dark-color));
  font-family: var(--main-font-stack);
  font-size: 1.8rem;
  font-weight: 500;
  width: fit-content;
  hyphens: auto;
  transition: all .4s;
  z-index: 2;
}

.nav > ul a:hover,
.nav > ul a:focus {
  text-decoration: underline;
}

/*
 * Navi Items
 */
.nav > ul > li {
  border-bottom: 3px solid transparent;
}

.nav > ul > li > a {
  padding: 16px 0;
  line-height: 1;
  text-transform: uppercase;
}

.nav > ul > li.is-category.active-cat > a,
.nav > ul > li.current > a {
  color: rgb(var(--main-highlight-color));
}

.nav > ul > li.is-category > a::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 12px;
  top: 50%;
  transform: translateY(-50%);
  right: -20px;
  background-image: url('/images/arrow.svg');
  background-repeat: no-repeat;
  background-size: contain;
}

.nav > ul > li.is-category.current > a {
  font-weight: 700;
}

.nav-contact {
  background: rgba(var(--main-dark-color), 1) url(/images/mail.svg) no-repeat center center;
  color: rgba(var(--main-light-color), 1);
  height: 49px;
  position: absolute;
  right: 60px;
  width: 49px;
  z-index: 1;
}

.nav > ul > li:last-child {
  display: none;
}

/*
 * Navi Subitems
 */

.nav li.active-cat ul {
  display: block;
}

.nav ul ul {
  interpolate-size: allow-keywords;
  height: 0;
  position: relative;
  display: none;
  list-style: none;
  transform: none;
  padding: 10px 20px;
  margin: 0;
  transition: all .4s linear;
}

.nav ul li.active-cat > ul {
  height: auto;
  margin: 0 0 2rem;
  padding: 0;
}

.nav > ul ul > li.current > a span {
  color: rgb(var(--main-highlight-color));
}

.nav li li {
  display: block;
}

.nav li li > a {
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.5;
  padding: 4px 0;
  hyphens: none;
}

/*
 * Header
 */

/* ab 560px */
@media screen and (min-width: 768px) {
  .nav-icon {
    width: 55px;
    height: 55px;
  }
}

/* ab 1040px */
@media screen and (min-width: 1200px) {
  .header-wrapper .header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    padding-top: 40px;
  }

  .scrolled .header-wrapper .header {
    padding-top: 10px;
  }

  .navi-logo {
    width: 297px;
  }

  .scrolled .navi-logo {
    width: 203px;
  }

  .scrolled .nav {
    margin-top: 12px;
  }

  .nav-icon {
    display: none;
  }

  .navi-active .nav-icon {
    transform: none;
  }

  .nav-contact {
    display: none;
  }

  /*
   * Navi General
   */
  .nav {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    background: transparent;
    left: inherit;
    top: inherit;
    width: inherit;
    height: unset;
    padding: 0;
    margin: 28px 0 0;
    overflow: visible;
    visibility: visible;
  }

  .nav > ul {
    display: flex;
    align-items: center;
    background: transparent;
    width: fit-content;
    overflow: visible;
    padding: 0;
    height: unset;
    margin: 0;
    gap: 35px;
  }

  .nav > ul ul li {
    padding-bottom: 10px;
  }

  .no-topslider .nav ul a,
  .scrolled .nav ul a {
    color: rgb(var(--main-dark-color));
  }

  .nav > ul > li.current > a {
    color: rgb(var(--main-highlight-color));
  }

  .nav > ul > li.is-category > a::after {
    display: none;
  }

  /*
   * Navi Itemsg
   */
  .nav > ul > li {
    margin: 0 16px;
  }

  .nav > ul > li > a {
    display: block;
    font-size: 1.7rem;
    position: relative;
  }

  .nav > ul > li > a span {
    padding: 16px 0;
  }

  .nav > ul > li:hover {
  }

  .nav > ul > li:hover > a:after {
    background: rgba(var(--main-highlight-color), 1);
    bottom: 4px;
    content: '';
    display: block;
    height: 3px;
    left: 0;
    position: absolute;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
  }

  .nav > ul > li:hover > a {
    text-decoration: none;
  }

  .nav > ul > li:last-child {
    display: block;
    margin-right: 0;
  }

  .nav > ul > li:last-child > a {
    background: rgba(var(--main-dark-color), 1) url(/images/mail.svg) no-repeat 20px center;
    color: rgba(var(--main-light-color), 1);
    padding-left: 60px;
    padding-right: 20px;
  }

  .nav > ul > li:last-child:hover > a:after {
    display: none;
  }

  /*
   * Navi Subitems
   */
  .nav ul li.active-cat > ul {
    display: initial;
    padding: 10px 20px;
  }

  .nav ul ul {
    background: rgb(var(--main-light-color));
    display: initial;
    left: -16px;
    opacity: 0;
    padding: 40px 20px 10px;
    pointer-events: none;
    position: absolute;
    transition: transform 0.4s;
  }

  .nav ul ul li > a {
    color: rgb(var(--main-dark-color));
    display: inline-block;
    font-size: 2rem;
    text-align: left;
    width: fit-content;
  }

  .nav li:hover > ul,
  .nav li:focus-within > ul {
    /*border-top: 3px solid rgba(var(--main-highlight-color), 1);*/
    height: auto;
    min-width: 440px;
    opacity: 1;
    pointer-events: initial;
  }
}

