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

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
  --header-height: 56px;
}

@media all and (min-width: 1000px) {
  :root {
    --header-height: calc(32px + 5.9375rem);
  }
}

/* ==========================================================================
   Phone Menu Toggle
   ========================================================================== */

.menu-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 22px;
  height: 16px;
  transform: translateY(-50%);
  z-index: 101;
}

.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: var(--color-primary--1);
  transition: all ease .25s;
  border-radius: 0;
}

.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),
.menu-toggle:hover span:nth-child(3),
.header.js-active .menu-toggle span:nth-child(1),
.header.js-active .menu-toggle span:nth-child(3) {
  width: 20px;
}

.header.js-active .menu-toggle span:nth-child(1) {
  top: 7px;
  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;
  transform: rotate(-45deg);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

main {
  padding-top: var(--header-height);
}

/* ==========================================================================
   Header Base
   ========================================================================== */

.header {
  height: var(--header-height);
  background-color: var(--color-white);
  z-index: 99;
  max-width: 1920px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

.header.js-active .header-menu {
  width: 100vw;
  opacity: 1;
}

/* ==========================================================================
   Mobile Logo
   ========================================================================== */

.menu--logo--mobile {
  display: block;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.menu--logo--mobile a,
.menu--logo a {
  display: block;
  aspect-ratio: 315 / 55;
  width: 150px;
  background-image: url("../../images/Logo_NETEXIAL.svg");
  background-repeat: no-repeat;
  background-size: contain;
}

/* ==========================================================================
   Side Card
   ========================================================================== */

.header .side_card {
  background-color: var(--color-primary--4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 600px;
}

.header .side_card img {
  max-height: 150px;
  width: 100%;
  object-fit: cover;
}

.header .side_card span {
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  line-height: 150%;
}

/* ==========================================================================
   Menu Item Base
   ========================================================================== */

.menu-item {
  padding: 0;
}

ul.menu a.is-active {
  color: inherit;
}

/* ==========================================================================
   Header Menu
   ========================================================================== */

.header-menu {
  z-index: 100;
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: 0;
  background-color: var(--color-white);
  overflow: hidden;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all ease-in-out 0.3s;
  opacity: 0;
}

/* ==========================================================================
   Menu Main
   ========================================================================== */

.menu-main {
  flex-shrink: 0;
  padding: 2rem var(--px160-percent);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.menu-main .menu--logo {
  display: none;
}

.menu--menu-main .menu {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.menu--menu-main .menu .menu__item {
  height: unset;
}

.menu--menu-main .menu li.menu__item--level-0 {
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
  text-transform: uppercase;
}

/* ==========================================================================
   Menu Dropdown (Mobile)
   ========================================================================== */

.menu__item--expanded .menu-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: all cubic-bezier(0, 1, 0, 1)  500ms;
  opacity: 0;
}

.menu__item--expanded .menu-dropdown ul.menu-level-1 {
  padding: 1rem;
}

.menu__item--expanded .menu-dropdown ::marker {
  content: none;
}

.menu__item--expanded.js-active .menu-dropdown {
  max-height: 2000px;
  opacity: 1;
  transition: all ease-in-out  500ms;
}

/* ==========================================================================
   Menu Levels
   ========================================================================== */

li.menu-icon-grid .menu-level-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding-top: 1rem;
}

li.menu-icon-grid .menu-level-2 a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.menu--menu-main .menu.menu-level-2 {
  padding: 0.5rem 0;
}

.menu-main .menu.menu-level-1 {
  gap: 1rem;
}

.menu-main .menu.menu-level-1 li a {
  font-size: 14px;
}

.menu-main .menu-level-2 > li.menu-item {
  text-transform: none;
  font-weight: 400;
}

/* ==========================================================================
   Menu Contact
   ========================================================================== */

.menu--menu-contact .menu {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 0 0;
}

.menu--menu-contact .menu li.menu__item a {
  box-sizing: border-box;
  flex-shrink: 0;
  border-radius: 15px;
  border: 2px solid var(--color-primary--1);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: ease all 150ms;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 31px;
  padding: 10px 32px;
  height: fit-content;
  text-wrap: nowrap;
  width: fit-content;
}

.menu--menu-contact .menu li.menu__item a:hover {
  background-color: var(--color-secondary--1);
  border-color: var(--color-secondary--1);
  color: var(--color-white);
  text-decoration: none;
}

.menu--menu-contact .menu li.phone_link a {
  background-color: var(--color-primary--1);
  color: var(--color-white);
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.menu--menu-contact .menu li.phone_link a:hover {
  background-color: var(--color-primary--2);
  text-decoration: none;
  border-color: var(--color-primary--2);
}

.menu--menu-contact .menu li.phone_link a::before {
  content: "";
  display: block;
  width: 28px;
  height: 31px;
  background-image: url("../../images/ic_baseline-phone.svg");
}

/* ==========================================================================
   Menu Secondaire
   ========================================================================== */

.menu--menu-secondaire {
  flex-shrink: 0;
  background: var(--color-primary--4);
  padding: 2rem var(--px160-percent);
}

.menu--menu-secondaire .menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
  align-items: start;
  margin: 0;
}

.menu--menu-secondaire .menu .menu__item {
  font-size: 0.9375rem;
  height: 2rem;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.menu--menu-secondaire .menu__item.search_trigger {
  position: relative;
}

.menu--menu-secondaire .menu__item.search_trigger:last-of-type::before {
  content: "";
  position: relative;
  background-image: url("../../images/header/search-black.svg");
  background-repeat: no-repeat;
  background-size: 24px 24px;
  width: 24px;
  height: 24px;
}

/* ==========================================================================
   DESKTOP - min-width: 1000px
   ========================================================================== */

@media all and (min-width: 1000px) {
  main {
    padding-top: unset;
  }

  .menu-toggle {
    display: none;
  }

  .user-logged-in .header {
    top: unset;
  }

  .header {
    position: relative;
    top: unset;
    left: unset;
    right: unset;
    background-color: unset;
    z-index: unset;
  }

  .menu--logo--mobile {
    display: none;
  }

  .header-menu {
    position: relative;
    top: unset;
    left: unset;
    bottom: unset;
    right: unset;
    width: 100%;
    height: fit-content;
    padding: 0;
    flex-direction: column-reverse;
    overflow: unset;
    margin-top: 0;
    opacity: 1;
  }

  .menu-main {
    flex-direction: row;
    gap: unset;
    padding: 0 20px;
    justify-content: space-between;
    align-items: center;
    height: fit-content;
    gap: 1rem;
  }

  .menu-main .menu--logo {
    display: block;
  }

  .menu--menu-main .menu {
    flex-direction: row;
    gap: 1rem;
    height: 5.9375rem;
  }

  .menu__item--expanded .menu-dropdown {
    max-height: unset;
    overflow: visible;
    opacity: 1;
  }

  .menu--menu-main .menu li.menu__item--level-0 {
    text-align: center;
    font-size: 14px;
    height: 100%;
  }

  .menu--menu-main .menu li.menu__item--level-0 a.menu__item {
    height: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }

  /* Mega menu dropdown */
  .menu__item--level-0 > .menu_link_content {
    display: none;
    z-index: 101;
    border-radius: 20px;
    padding-top: 1rem;
    top: var(--header-height);
    background-color: var(--color-primary--1);
    max-width: 1608px;
    margin: auto;
    left: calc((100% - 1608px) / 2);
    height: 0;
    position: absolute;
    align-items: flex-start;
    transition: all 0.2s;
    left: 1rem;
    right: 1rem;
    width: auto;
  }

  .menu__item--level-0:hover > .menu_link_content {
    /* display: flex; */
    display: grid;
    grid-template-columns: 1fr minmax(200px, 341px);
    /* height: 453px; */
    /* height: 60vh; */
  }

  .menu_link_content .menu-level-1 {
    border-radius: 0 0 0 18px;
    flex-grow: 1;
    background-color: var(--color-white);
    height: 100%;
    padding-left: 64px;
    padding-top: 64px;
    padding-right: 60px;
    list-style-type: none;
    gap: 60px;
  }

  .menu_link_content .menu-level-1 > li.menu-item {
    list-style-type: none;
    list-style-image: none;
  }

  .menu_link_content .menu-level-1 > li.menu-item > a {
    position: relative;
    font-family: Oswald;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-transform: uppercase;
    display: flex;
    flex-direction: row;
    gap: 4px;
    justify-content: center;
    align-items: center;
    width: fit-content;
  }

  .menu_link_content .menu-level-1 > li.menu-item > a::before {
    content: "";
    width: 26px;
    height: 24px;
    background-image: url("../../images/header/menu_arrow.svg");
    background-repeat: no-repeat;
    background-size: 26px 24px;
    flex-shrink: 0;
  }

  .menu_link_content .menu-level-1 .menu-level-2 {
    margin-top: 16px;
    margin-left: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: start;
    justify-content: start;
  }

  .menu_link_content .menu-level-1 .menu-level-2 > li.menu-item {
    text-align: center;
    font-family: Roboto;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    text-transform: none;
  }

  /* Menu with icons */
  .menu_link_content .menu-level-1 > li.menu--icons > a {
    margin-left: 90px;
  }

  .menu_link_content .menu-level-1 > li.menu--icons .menu-level-2 {
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 16px;
    column-gap: 25px;
    margin-top: 48px;
    height: 100%;
  }

  .menu_link_content .menu-level-1 > li.menu--icons .menu-level-2 .menu-item {
    padding: 0;
    margin: 0;
  }

  .menu_link_content .menu-level-1 > li.menu--icons .menu-level-2 .menu-item a {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    height: 105px;
    width: 190px;
    padding: 0 20px;
    gap: 8px;
  }

  .menu_link_content .menu-level-1 > li.menu--icons .menu-level-2 .menu-item a img {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .menu_link_content .menu-level-1 > li.menu--icons .menu-level-2 .menu-item a span {
    text-align: center;
    font-family: Roboto;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
  }

  .menu_link_content .menu-level-1:not(:has(.menu--icons)) > li.menu-item {
    width: 341px;
  }

  .menu_link_content .menu-level-1:has(.menu--icons) > li.menu-item > a {
    gap: 16px;
  }

  /* Side card desktop */
  .menu_link_content .side_card {
    height: 100%;
    border-radius: 0 0 18px 0;
    background-color: var(--color-primary--4);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
  }

  .menu_link_content .side_card img {
    max-height: unset;
    width: unset;
    object-fit: unset;
  }

  .menu_link_content .side_card span {
    margin-top: 8px;
    margin-left: 12px;
    padding: 0;
    padding-bottom: 2rem;
    display: block;
    font-family: Roboto;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 140%;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: auto;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
    text-underline-position: from-font;
    text-transform: none;
    text-align: start;
  }

  .menu--menu-main .menu .home_link {
    display: none;
  }

  /* Menu contact desktop */
  .menu--menu-contact .menu {
    margin: 0;
    flex-direction: row;
    gap: 0.5rem;
    height: fit-content;
  }

  .menu--menu-contact .menu li.menu__item {
    height: unset;
    flex-shrink: 0;
  }

  /* Menu secondaire desktop */
  .menu--menu-secondaire {
    padding: 4px 50px;
  }

  .menu--menu-secondaire .menu {
    flex-direction: row;
    gap: 2rem;
    justify-content: flex-end;
    align-items: center;
  }

  .menu--menu-secondaire .menu li.menu__item {
    height: 1.5rem;
  }

  .menu__item--expanded .menu-dropdown ul.menu-level-1 {
    padding: 3rem 2rem;
    flex-wrap: wrap;
  }

    .menu--menu-contact .menu li.menu__item a {
      padding: 10px 12px;
    }
}

/* ==========================================================================
   DESKTOP - min-width: 1200px
   ========================================================================== */

@media all and (min-width: 1200px) {
  .menu-main {
    padding: 0 var(--px160-percent);
  }

  .menu--menu-main .menu {
    gap: 2rem;
  }

  .menu--menu-secondaire {
    padding: 4px var(--px160-percent);
  }
}

/* ==========================================================================
   DESKTOP - min-width: 1400px
   ========================================================================== */

@media all and (min-width: 1400px) {
  .menu--logo a {
    width: 200px;
  }

  .menu--menu-main .menu {
    gap: 3rem;
  }

  .menu--menu-main .menu li.menu__item--level-0 {
    font-size: 16px;
  }

  .menu--menu-contact .menu li.menu__item a {
    padding: 10px 14px;
    font-size: 1.125rem;
    line-height: 31px;
  }

  .menu--menu-contact .menu li.phone_link a {
    gap: 10px;
  }

  .menu--menu-contact .menu li.phone_link a::before {
    width: 28px;
    height: 31px;
  }
}
@media all and (min-width: 1600px) {
  .menu--logo a {
    width: 315px;
  }
}
/* ==========================================================================
   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%;
  }
}
