/**
 * @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: 1620px;
  background-color: var(--color-neutral--4);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1rem 2rem;
  box-shadow: 0px 10px 20px -10px rgba(0,0,0,0.05);
}
ul.menu a.is-active {
  color: var(--color-neutral--2);
}
@media all and (min-width: 1000px) {
  .header {
    display: flex;
    position: relative;
    top: inherit;
    left: inherit;
    right: inherit;
    background-color: var(--color-primary--2);
    box-shadow: none;
    padding: 0;
    height: 99px;
    gap: 0.5rem;
    margin: 0 auto;
    width: 82%;
    justify-content: space-between;
    align-items: center;
  }
  .header::before {
    position: absolute;
    content: "";
    right: 0;
    bottom: 0;
    top: 0;
    width: 200vw;
    background-color: var(--color-primary--2);
    z-index: -1;
    left: -100vw;
  }
}
@media all and (min-width: 1200px) {
  .header {
    gap: 1rem;
  }
}

/**
 * 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: 1000px) {
  .header__brand,
  .region-header,
  .header__brand .block-system-branding-block,
  .header__brand .site-logo {
    height: 100%;
  }
  .header__brand {
    margin-left: 1rem;
  }
  .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: 1200px) {
  .header__brand {
    min-width: 100px;
  }
  .header__brand .site-logo {
    max-width: 110px;
  }
}

/**
 * Menu
 */

.header__menu {
  position: fixed;
  right: 100%;
  left: 0;
  top: 67.7px;
  bottom: 0;
  transition: 0.3s ease;
  background: var(--color-neutral--4);
  z-index: 10;
  overflow-y: scroll;
}
.user-logged-in .header__menu {
  top: 113px;
}
.header.js-active .header__menu {
  right: 0;
}
.header__menu ul.menu {
  margin: 0;
}
.header__menu .menu--level-0 {
  padding: 1.5rem 1.5rem 0;
}

.header__menu .menu__link {
  color: var(--color-neutral--2);
  width: 100%;
  font-style: normal;
  font-weight: 700;
  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: 1rem;
  user-select: none;
  text-transform: uppercase;
  font-family: var(--font-europa);
}

.header__menu .menu__link {
  position: relative;
  text-decoration: none;
}



.header__menu .menu--locations-contact::after {
  transition: none;
  width: 0% !important;
}

.menu--locations-contact {
  width: fit-content;
}

body.path-frontpage .header__menu .menu--locations-contact.menu__link {
  color: white;
  padding: 0.5em 1em;
  border-radius: 30px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  border: 1px white solid;
  transition: all 0.3s ease;
  background-color: transparent;
}

body.path-frontpage .header__menu .menu--locations-contact.menu__link::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  background-image: url('../../images/header/icon-location.svg');
  background-size: contain;
  background-repeat: no-repeat;
}

body.path-frontpage .header__menu .menu--locations-contact.menu__link:hover {
  background-color: white;
  color: black;
}

body.path-frontpage .header__menu .menu--locations-contact.menu__link:hover::before {
  filter: invert(1);
}


body:not(.path-frontpage) .header__menu .menu--locations-contact.menu__link {
  color: white;
  background-color: red;
  padding: 0.5em 1em;
  border-radius: 30px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  border: 1px solid red;
  transition: background-color 0.3s ease, color 0.3s ease;
  width: fit-content;
}

body:not(.path-frontpage) .header__menu .menu--locations-contact.menu__link::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  background-image: url('../../images/header/icon-location.svg');
  background-size: contain;
  background-repeat: no-repeat;
  transition: filter 0.3s ease;
}


body:not(.path-frontpage) .header__menu .menu--locations-contact.menu__link:hover {
    background-color: white;
    color: red;
    border-color: red;
}

body:not(.path-frontpage) .header__menu .menu--locations-contact.menu__link:hover::before {
    filter: brightness(0) saturate(100%) invert(17%) sepia(88%) saturate(7468%) brightness(92%) contrast(102%);
}

/* Expended */

.menu__main .menu--level-1 {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 0;
  overflow: hidden;
}
.menu__main .menu__item--expanded.js-active .menu--level-1 {
  gap: 0.3rem;
  height: max-content;
  overflow: unset;
}

.menu__main .menu__item--expanded .menu--level-1 .menu__link {
  color: var(--color-dark);
}

.header__menu .menu--level-1 .menu__link {
  font-weight: 700;
  color: var(--color-primary--2);
}

.menu__main .menu__item--expanded.js-active > .menu__link::after{
  transform: rotate(90deg);
}

.menu__item.menu__item--level-0.menu__item--expanded > .menu__link::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  background-image: url('../../images/header/arrow.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
}

@media all and (min-width: 975px) {
  .user-logged-in .header__menu {
    top: 168px;
  }
}
@media all and (min-width: 1000px) {

  /* .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;

  }
  .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;
    gap: 6rem;
  }
  .header__menu .menu__item {
    display: flex;
    position: relative;
  }
  .header__menu .menu__link {
    font-size: 0.9rem;
    margin-bottom: 0;
    padding: 1rem 0;
  }


  /* Expended */
  .menu__main .menu--level-1 {
    display: none;
    position: absolute;
    top: 3rem;
    left: -2rem;
    width: 270px;
    height: max-content;
    padding: 2rem;
    background-color: var(--color-neutral--4);
  }
  .menu__main .menu__item--expanded:hover .menu--level-1 {
    display: flex;
  }
  .menu__main .menu--level-1 .menu__link {
    padding: 0.5rem;
  }
  .header__menu .menu--level-1 .menu__item:last-child .menu__link::before {
    content: none;
  }

  .menu__item.menu__item--level-0.menu__item--expanded > .menu__link::after {
    display: none;
  }

  .header__menu .menu__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.header__menu .menu__link:hover::after {
  width: 100%;
}
}

@media all and (min-width: 1200px) {

  .header__menu .menu__link {
    font-size: 1rem;
  }
}


/**
 * Custom Element
 */

.menu__link.menu__link-cta {
  display: inline-block;
  padding: 0.5rem 1rem;
  width: fit-content;
  border: 1px solid var(--color-neutral--2);
  color: var(--color-neutral--2);
  font-weight: 700;
  border-radius: 40px;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
}
.menu__link.menu__link-cta:hover {
  background-color: var(--color-primary--4);
}
.menu__link.menu__link-cta::after {
  content: none;
}
.header__menu .menu--level-0 > .menu__item > .menu__link.menu__link-cta {
  cursor: pointer;
}
@media all and (min-width: 1000px) {
  .menu__link.menu__link-cta {
    height: fit-content;
    margin: auto 0 auto 1rem;
  }
}

/**
 * Search
 */

.header__search-button {
  margin: 1rem 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-neutral--2);
  font-weight: 700;
  background-color: transparent;
  border: none;
}
.header__search-button::before {
  content: "";
  width: 24px;
  height: 24px;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url('../../images/header/search-black.svg');
}
@media all and (min-width: 1000px) {
  .header__search-button {
    width: 24px;
    height: 24px;
    text-indent: -9999px;
    overflow: hidden;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url('../../images/header/search-black.svg');
    margin: auto;
  }
  .header__search-button::before {
    content: none;
  }
}
@media all and (min-width: 1200px) {
  .header__search-button {
    width: inherit;
    height: inherit;
    text-indent: 0;
    overflow: inherit;
    background: none;
    margin: auto;
    flex: 1;
  }
  .header__search-button::before {
    content: "";
  }
}
@media all and (min-width: 1550px) {
  .header__search-button {
    transform: translateX(50%);
  }
}
@media all and (min-width: 1800px) {
  .header__search-button {
    transform: translateX(100%);
  }
}

/**
 * Search Trigger Close
 */

.search-tigger-close {
  border-radius: 100%;
  width: 32px;
  height: 32px;
  background-color: var(--color-neutral--4);
  background-position: center;
  background-repeat: no-repeat;
  background-image: url('../../images/header/close.svg');
  border: none;
  text-indent: -999px;
  overflow: hidden;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  display: block;
}

/**
 * Search Bar
 */

.block-search {
  position: fixed;
  right: 0;
  left: 0;
  top: 67.7px;
  background-color: var(--color-neutral--3);
  z-index: 9;
  padding: 2rem;
  color: var(--color-neutral--2);
  transform: translateX(100%);
  transition: 0.2s;
}
.block-search.js-active {
  transform: none;
}
.user-logged-in .block-search {
  top: 113px;
}
.block-search form {
  position: relative;
  max-width: 350px;
}
.block-search .form-type-search {
  display: block;
  margin: 0;
  float: none;
}
.block-search .form-type-search label{
  display: block;
  position: relative !important;
  width: initial;
  height: initial;
  clip: initial;
  font-size: var(--content-size);
  margin-bottom: 0.5rem;
  color: var(--color-neutral--2);
  font-weight: 700;
}
.block-search input.form-search {
  padding: 0.7rem 40px 0.7rem 0.7rem;
  background-color: var(--color-neutral--4);
  color: var(--color-neutral--2);
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  max-width: none;
}
.block-search input.form-submit {
  position: absolute;
  right: 0;
  bottom: 19.8px;
  width: 39.6px;
  height: 39.6px;
  overflow: hidden;
  text-indent: -999px;
  background-color: transparent;
  border: none;
  background-image: url("../../images/header/search-black.svg");
  background-position: center;
  background-repeat: no-repeat;
  transform: translateY(-12.5%);
}
@media all and (min-width: 1000px) {
  .block-search {
    left: 50%;
    top: 123px;
  }
  .user-logged-in .block-search {
    top: 123px;
  }
}
@media all and (min-width: 1200px) {
  .block-search {
    left: 66.666%;
  }

}


/**
 * 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: 1000px) {
  .menu-toggle{
    display: none;
  }
}



/**
 * Special code for homepage header
 */
.header--homepage .site-logo .mobile {
  display: block;
}
.site-logo .desktop {
  display: none;
}
@media all and (min-width: 1000px){
  .header--homepage {
    background-color: transparent;
  }
  .header--homepage::before {
    content: none;
  }
  .header--homepage .site-logo .mobile {
    display: none;
  }
  .header--homepage .site-logo .desktop {
    display: block;
  }
  .header--homepage .header__menu .menu__link {
    color: var(--color-white);
  }
}
