/* ==========================
   Header - Layout
   ========================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-primary--1);
}

@media screen and (min-width: 999px) {

  .header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: unset;
  }

}

.header__container {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.header__brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* ==========================
   Hamburger button
   ========================== */

.menu-toggle__button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.menu-toggle__bar {
  display: block;
  width: 26px;
  height: 2px;
  background-color: var(--color-system--4);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.header.js-active .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header.js-active .menu-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.header.js-active .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================
   Mobile menu
   ========================== */

.header__menu {
  display: none;
  padding: 16px 0 24px;
}

.header.js-active .header__menu {
  display: block;
}

@media (max-width: 999px) {
  .menu--main {
    padding: 0;
  }

  .menu--main > .menu {
    flex-direction: column;
    border-radius: 16px;
    gap: 8px;
  }

  .menu--main > .menu--level-0 > .menu__item > a {
    justify-content: center;
  }

  .menu--main > .menu--level-0 > .menu__item > a.cta--outlined,
  .menu--main > .menu--level-0 > .menu__item > a.cta--full {
    justify-content: center;
    gap: 0;
  }
}

/* ==========================
   Desktop
   ========================== */

@media (min-width: 1000px) {
  .menu-toggle {
    display: none;
  }

  .header__container {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .header__brand {
    flex-shrink: 0;
  }

  .header__menu {
    display: flex;
    padding: 0;
  }

  /* Menu existant desktop */
  .menu--main > .menu {
    display: flex;
    flex-direction: row;
    gap: 30px;
    justify-content: center;
    align-items: center;
    background-color: var(--color-primary--1);
    border-radius: 50px;
    padding: 10px;
  }
  .menu--main > .menu--level-0 > .menu__item > a {
    font-family: var(--font-poppins);
    color: var(--color-system--4);
    text-decoration: none;
  }

  .menu--main > .menu--level-0 > .menu__item > a.cta--outlined {
    color: #FFF;
    font-family: var(--font-poppins);
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 140%;
    display: flex;
    padding: 16px;
    align-items: center;
    gap: 32px;
    border-radius: 40px;
    border: 1px solid #E6E83E;
  }

  .menu--main > .menu--level-0 > .menu__item > a.cta--full {
    color: var(--Neutral, #27222B);
    font-family: var(--font-poppins);
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 140%;
    display: flex;
    padding: 16px;
    align-items: center;
    gap: 32px;
    border-radius: 40px;
    background: var(--color-primary--2);
    margin-right: 30px;
  }
}


/* ==========================
   Submenu level 1
   ========================== */

.menu--level-1 {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  overflow: hidden;

}

.menu__item--expanded.js-active > .menu--level-1 {
  display: block;
}

.menu__item--expanded > .menu__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu__item--expanded > .menu__link::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--color-system--4);
  border-bottom: 2px solid var(--color-system--4);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.menu__item--expanded.js-active > .menu__link::after {
  transform: rotate(-135deg);
}

.menu__item--level-1 > .menu__link {
  display: block;
  padding: 0.5rem 1rem 0.5rem 2rem;
  color: var(--color-system--4);
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 400;
}

.menu__item--level-1 > .menu__link:hover,
.menu__item--level-1 > .menu__link:focus {
  text-decoration: underline;
}

.menu__item--level-1 > .menu__link.is-active {
  font-weight: 700;
  color: white;
  border-left: 3px solid var(--color-primary--2);
  padding-left: calc(2rem - 3px);
}

@media (min-width: 1000px) {
  .menu__item--level-0 {
    position: relative;
  }

  .menu__item--expanded > .menu--level-1 {
    display: none;
  }

  .menu--level-1 {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background-color: var(--color-primary--1);
    border-radius: 0 0 16px 16px;
    z-index: 101;
    padding: 8px 0;
    padding-right: 30%!important;
    margin-left: 60%!important;
  }

  .menu__item--level-0:hover > .menu--level-1,
  .menu__item--level-0:focus-within > .menu--level-1 {
    display: block;
  }

  .menu__item--level-1 > .menu__link {
    padding: 0.5rem 1.25rem;
    white-space: nowrap;
    border-top: none;
  }

  .menu__item--level-1 > .menu__link.is-active {
    padding-left: calc(1.25rem - 3px);
  }
}

a.header__logo {
  margin-right: 10px;
  display: block;
  overflow: hidden;
  text-indent: -9999px;
  white-space: nowrap;
  width: 86px;
  height: 86px;
}

a.header__logo::before {
  content: '';
  display: block;
  background-image: url('../../images/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  width: 86px;
  height: 86px;
  text-indent: 0;
}
