/**
 * @file
 * The header components.
 *
 * It includes styles for the header itself and their
 * component as the logotype or the main menu.
 */

/**
 * Global header rules
 */

.header {
  max-width: 1320px;
  background-color: var(--color-white);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index:50;
  padding: 1rem 2rem;
}
@media all and (min-width: 1100px) {
  .header {
    display: flex;
    position: relative;
    top: inherit;
    left: inherit;
    right: inherit;
    box-shadow: none;
    padding: 0;
    height: 92px;
    gap: 0.5rem;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
    gap: 2rem;
  }
}
@media all and (min-width: 1350px) {
  .header {
    gap: 4rem;
  }
}

/**
 * Site Brand
 */

.header__brand {
  position: relative;
  display: flex;
  align-items: center;
}
.header__brand .site-logo {
  display: inline-block;
  max-width: 110px;
}
@media all and (min-width: 1100px) {
  .header__brand,
  .region-header,
  .header__brand .block-system-branding-block,
  .header__brand .site-logo {
    height: 100%;
  }
  .header__brand .site-logo {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
  }
  .header__brand .site-logo img {
    max-height: 100%;
  }
}
@media all and (min-width: 1350px) {
  .header__brand {
    min-width: 100px;
  }
  .header__brand .site-logo {
    max-width: 143px;
  }
}

/**
 * Menu
 */

.header__menu {
  position: fixed;
  right: 100%;
  left: 0;
  top: 93px;
  bottom: 0;
  transition: 0.3s ease;
  z-index: 10;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
}
.user-logged-in .header__menu {
  top: 132px;
}
.header.js-active .header__menu {
  right: 0;
}
.header__menu ul.menu {
  margin: 0;
}
.header__menu .menu--level-0 {
  padding: 1.5rem 1.5rem 2.5rem;
  background: var(--color-secondary--2);
}
.header__menu .menu__link {
  width: 100%;
  padding: 0.5rem;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  font-size: 1rem;
  position: relative;
  cursor: pointer;
  margin-bottom: 0.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
  user-select: none;

}
.header__menu .menu__link:hover {
  text-decoration: none;
}
.menu__main .menu__item--expanded .menu__link::after {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url('../../images/header/arrow.svg');
}
.menu__main .menu__item--expanded > .menu__link::after {
  transform: rotate(90deg);
}
.menu__main li.menu__item--expanded.js-active + li.menu__item--level-0 > .menu__link {
  margin-top: .625rem;
}
.menu__main li.menu__item--expanded.js-active + li.menu__item--level-0 > .menu__link.cta {
  margin-top: 2rem;
}
.menu__main .menu__item--level-0 > a.cta {
  width: fit-content;
  border: 1px solid var(--color-primary--1);
  padding: .5rem 1.25rem;
  color: var(--color-primary--2);
  margin-top: 1rem;
}
.menu__main .menu__item--level-0 > a.cta:hover {
  color: var(--color-white);
}
@media all and (min-width: 1100px) {
  .menu__main li.menu__item--expanded.js-active + li.menu__item--level-0 > .menu__link,
  .menu__main li.menu__item--expanded.js-active + li.menu__item--level-0 > .menu__link.cta {
    margin-top: 0;
  }
  .header__menu {
    width: fit-content;
    display: block;
    flex-direction: column;
  }
  .menu__main .menu__item--level-0 > a.cta {
    margin-left: 2rem;
    margin-top: 0;
  }
}

/* Expended */

.header__menu ul.menu .menu--level-1 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: max-content;
  max-height: 0;
  overflow: hidden;
  margin-left: 1rem;
  transition: all ease .15s;
}
.header__menu ul.menu .menu--level-1 .menu__item {
  border-bottom: 1px solid #D9D9D9;
}
.menu__main .menu__item--expanded.js-active .menu--level-1 {
  gap: 0.625rem;
  max-height: 600px;
  transition: all ease .15s;
}
.header__menu .menu--level-0 > .menu__item:not(:has(.cta)) > a.menu__link {
  text-transform: uppercase;
}
.header__menu .menu--level-0 > .menu__item > a.menu__link {
  font-weight: 700;
  line-height: 150%;
}
@media all and (min-width: 975px) {
  .user-logged-in .header__menu {
    top: 168px;
  }
}
@media all and (min-width: 1100px) {
  .header__menu .menu--level-0 > .menu__item:not(:has(.cta)) > a.menu__link::before {
    width: 0;
    height: 2px;
    background-color: var(--color-primary--2);
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transition: all 200ms ease-in-out;
  }
  .header__menu .menu--level-0 > .menu__item:not(:has(.cta)) > a.menu__link:hover::before {
    width: 100%;
  }
  .header__menu,
  .menu__main,
  .region-header-menu,
  .menu--main,
  .header__menu .menu--level-0,
  .header__menu .menu__item {
    height: 100%;
  }
  .header__menu {
    display: flex;
    justify-content: space-between;
    position: relative;
    right: inherit;
    left: inherit;
    bottom: inherit;
    transition: none;
    background: inherit;
    overflow-y: inherit;
    top: inherit;
    gap: 1rem;
    justify-content: space-between;
  }
  .user-logged-in .header__menu {
    top: inherit;
  }
  .header.js-active .header__menu {
    transform: none;
  }
  .header__menu .menu--level-0 {
    display: flex;
    align-items: center;
    padding: 0;
    background: none;
    gap: 1rem;
  }
  .header__menu .menu__item {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
  }
  .header__menu .menu__link {
    padding: 0 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0;
  }
  .menu__main .menu__link:after {
    content: none;
  }
  .header__menu .menu--level-0 > .menu__item:not(:has(.cta)) > a.menu__link {
    cursor: pointer;
    padding: 0;
    align-items: flex-start;
  }


  /* Expended */
  .header__menu ul.menu .menu--level-1 {
    margin: 0;
  }
  .menu__main .menu--level-1 {
    display: none;
    position: absolute;
    top: 80px;
    left: -2rem;
    width: 340px;
    height: max-content;
    background-color: var(--color-secondary--2);
  }
  .menu__main .menu__item--expanded.js-active .menu--level-1 {
    z-index: 10;
  }
  .menu__main .menu__item--expanded:hover .menu--level-1 {
    display: flex;
  }
  .menu__main .menu--level-1 .menu__link {
    padding: 0.5rem;
    margin-bottom: .625rem;
  }
  .menu__main .menu--level-1 .menu__item--level-1:first-child .menu__link {
    margin-top: .625rem;
  }
  .menu__main .menu--level-1 .menu__link:after {
    content: '';
    transition: 0.2s;
  }
  .menu__main .menu--level-1 .menu__link:hover:after {
    transform: translateX(5px);
  }
}
@media all and (min-width: 1350px) {
  .header__menu {
    gap: 2rem;
  }
  .header__menu .menu__link {
    font-size: 1rem;
  }
  .header__menu .menu--level-0 {
    gap: 2rem;
  }
}
@media all and (min-width: 1350px) {
  .header__menu .menu__link {
    padding: 0 1rem;
  }
}

/**
 * Mobile menu button
 */
.menu-toggle{
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 22px;
  height: 16px;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
}
.menu-toggle__button{
  border: none;
  width: 22px;
  height: 16px;
  padding: 0;
  text-indent: 100px;
  background-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  z-index:1;
  position: absolute;
  left:0;
  top:0;
}
.menu-toggle span {
  position: absolute;
  left: 1px;
  display: block;
  width: 20px;
  height: 2px;
  background-color:#000;
  transition: all ease .25s;
  -webkit-transition: all ease .25s;
  -moz-transition: all ease .25s;
  -ms-transition: all ease .25s;
  -o-transition: all ease .25s;
  border-radius: 0px;
  -webkit-border-radius: 0px;
  -moz-border-radius: 0px;
  -ms-border-radius: 0px;
  -o-border-radius: 0px;
}
.menu-toggle span:nth-child(1) {
  top: 1px;
}
.menu-toggle span:nth-child(2) {
  top: 7px;
}
.menu-toggle span:nth-child(3) {
  top: 13px;
}
.menu-toggle:hover span:nth-child(1),
.header.js-active .menu-toggle span:nth-child(1),
.menu-toggle:hover span:nth-child(3),
.header.js-active .menu-toggle span:nth-child(3){
  width: 20px;
}
.header.js-active .menu-toggle span:nth-child(1) {
  top: 7px;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}
.header.js-active .menu-toggle span:nth-child(2) {
  width: 0;
  left: 22px;
}
.header.js-active .menu-toggle span:nth-child(3) {
  top: 7px;
  -webkit-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
}
@media all and (min-width: 1100px) {
  .menu-toggle{
    display: none;
  }
}


/**
 * Pre Header
 */
.pre-header {
  background-color :var(--color-neutral--1);
  display: none;
  justify-content: end;
  padding: .375rem 4.25rem .375rem 0;
  gap: 2.813rem;
}
.pre-header .menu-secondary {
  display: flex;
}
.pre-header .menu--secondary-menu ul.menu--level-0 {
  display: flex;
  gap: 2.813rem;
  margin: 0;
  padding: 0;
}
.pre-header .menu--secondary-menu ul.menu--level-0 .menu__link {
  color: var(--color-white);
  font-size: var(--content-size);
}
@media all and (min-width: 1100px) {
  .pre-header {
    display: flex;
  }
}


/**
 * Search
 */

.pre-header__search-trigger {
  color: var(--color-white);
  font-size: var(--content-size);
  display: flex;
  gap: .625rem;
  align-items: center;
  cursor: pointer;
}
.pre-header__search-trigger::before {
  content: "";
  width: 17.58px;
  height: 17.58px;
  background-image: url('../../images/header/search.svg');
  display: block;
}
.pre-header__search-modal {
  display: none;
}
.pre-header__search-modal.js-active {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 34px;
  background-color: var(--color-neutral--1);
  color: var(--color-white);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.pre-header__search-modal .block-search {
  width: 100%;
}
.pre-header__search-modal .block-search .block-search__title {
  width: 100%;
  text-align: center;
  text-transform: uppercase;
  font-size: var(--heading-size--xl);
}
.pre-header__search-modal .block-search .form-type-search {
  display: block;
}
.pre-header__search-modal .pre-header__search-modal-close {
  width: 28px;
  height: 30px;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url(../../images/header/close.svg);
  position: absolute;
  right: 65px;
  top: 45px;
  cursor: pointer;
}
.pre-header__search-modal .block-search input.form-search {
  background-color: unset;
  padding: 20px 28px 20px 20px;
  border: 1px solid var(--color-white);
  border-radius: 5px;
  width: 100%;
  color: var(--color-white);
}
.pre-header__search-modal .block-search input.form-submit {
  all: unset;
  display: flex;
  justify-content: center;
  align-items: center;
  text-indent: -9999px;
  overflow: hidden;
  width: 18px;
  height: 18px;
  background-image: url('../../images/header/search.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}
.pre-header__search-modal form {
  position: relative;
}
.pre-header__search-modal .js-form-wrapper {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
@media all and (min-width: 1000px){
  .pre-header__search-modal {
    position: fixed;
    display: block;
    transform: translateY(-100%);
    visibility: hidden;
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 34px;
    background-color: var(--color-neutral--1);
    color: var(--color-white);
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transition: ease-in-out all 400ms;
  }
  .pre-header__search-modal.js-active {
    position: fixed;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    z-index: 999;
    transition: ease-in-out all 400ms;
  }
  .pre-header__search-modal form {
    max-width: 400px;
    margin: auto;
  }
}


/**
 * Mobile secondary menu
 */
.header__menu-secondary-mobile {
  background-color :var(--color-neutral--1);
  color: #fff;
  flex: 1;
}
.header__menu-secondary-mobile .menu--level-0 {
  background-color: unset;
  padding: 1rem 1.5rem;
}
.header__menu-secondary-mobile  .menu--level-0 > .menu__item > a.menu__link {
  font-size: 14px;
  font-weight: 400;
}
.header__menu-secondary-mobile .pre-header__search {
  padding: 0 1.5rem;
}
.header__menu-secondary-mobile ul.menu a.is-active {
  color: #fff;
}
@media all and (min-width: 1000px){
  .header__menu-secondary-mobile {
    display: none;
  }
}
