/* ==========================
   Global header
   ========================== */

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

@media screen and (min-width: 1000px) {
    .header {
        background-color: unset;
    }
}

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

.header__brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    transition: padding 0.3s ease;
}

/* ==========================
   Lg header desktop
   ========================== */

.header__brand .header__logo {
    margin-right: 10px;
    opacity: 100%!important;
    display: block;
    overflow: hidden;
    text-indent: -9999px;
    white-space: nowrap;
    width: 50px;
    height: 50px;
    transition: width 0.3s ease, height 0.3s ease;
}

.header__brand .header__logo::before {
    opacity: 100%!important;
    content: '';
    display: block;
    background-image: url('../../images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 50px;
    height: 50px;
}

@media screen and (min-width: 999px) {
  .header__brand {
    display: none;
  }

}

/* ==========================
   Burger menu
   ========================== */

.menu-toggle {
    display: block;
}

.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);
}

/* ==========================
   Global menu
   ========================== */

.header__menu {
    display: none !important;
    padding: 8px 0 20px;
}

.header.js-active .header__menu {
    display: block !important;
    animation: menuSlideDown 0.3s ease forwards;
}

@keyframes menuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================
   Mobile menu
   ========================== */
@media (max-width: 999px) {

    /* Cache le premier item logo */
    .menu--level-0 > .menu__item:first-child {
        display: none !important;
    }

    .menu--level-0 {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        align-items: center;
        background-color: var(--color-primary--1);
        border-radius: 16px;
        padding: 12px;
        list-style: none;
        margin: 0;
    }

    .menu--level-0 > .menu__item > a {
        display: block;
        padding: 8px 12px;
        color: var(--color-system--4);
        text-decoration: none;
        font-family: var(--font-lexend);
        font-size: clamp(13px, 3.5vw, 15px);
        border-radius: 8px;
    }

    .menu--level-0 > .menu__item > a.cta--outlined {
        color: #fff;
        font-family: var(--font-lexend);
        font-weight: 700;
        display: flex;
        padding: 12px 16px;
        align-items: center;
        border-radius: 40px;
        border: 1px solid #e6e83e;
    }

    .menu--level-0 > .menu__item > a.cta--full {
        color: var(--Neutral, #27222b);
        font-family: var(--font-lexend);
        font-weight: 700;
        display: flex;
        padding: 12px 16px;
        align-items: center;
        border-radius: 40px;
        background: var(--color-primary--2);
    }
}

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

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

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

    .header__brand {
        flex-shrink: 0;
    }

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

    .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-lexend);
        color: var(--color-system--4);
        text-decoration: none;
    }

    .menu--main > .menu--level-0 > .menu__item > a.cta--outlined {
        color: #fff;
        font-family: var(--font-lexend);
        font-size: 16px;
        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-lexend);
        font-size: 16px;
        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 lv1
   ========================== */

.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);
    }
}

/* ==========================
   Nolink parent (span)
   ========================== */

  .menu--level-0 > .menu__item > span.menu__link {
      display: block;
      padding: 8px 12px;
      color: var(--color-system--4);
      text-decoration: none;
      font-family: var(--font-lexend);
      font-size: clamp(13px, 3.5vw, 15px);
      border-radius: 8px;
      cursor: pointer;
  }

  .menu__item--level-0 > span.menu__link:hover {
      text-decoration: underline;
  }

  @media (min-width: 1000px) {
      .menu--main > .menu--level-0 > .menu__item > span.menu__link {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 0;
          font-size: inherit;
          border-radius: 0;
      }
  }

/* Hover (les deux tailles) */
.menu__item--level-0 > span.menu__link:hover {
    text-decoration: underline;
}

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

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;
}

a.is-active {
  color: white!important;
  opacity: 85%!important;
}

a.header__logo {
  opacity: 100%!important;
}
