@import '@/styles/variables';
@import '@/styles/font-styles';

.header {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 40px 0;
  z-index: 100;
  transition: transform 1s cubic-bezier(.19,1,.22,1);
  transform: translateY(-100px);

  &.show {
    transform: translateY(0);
  }

  &.header-one {

    .header-logo {
      color: $black;
    }

    .header-menu a {
      color: $gray-003;

      &:hover,
      &:active {
        color: $black;
      }
    }

    .header-menu .link-selected {
      color: $black;
    }

    .header-mobile-menu span {
      background-color: $gray-004;
    }
  }

  &.header-two {
    .header-logo {
      color: $white;
    }

    .header-menu a {
      color: $black;

      &:hover,
      &:active {
        color: $white;
      }
    }

    .header-menu .link-selected {
      color: $white;
    }

    .header-mobile-menu span {
      background-color: $white;
    }
  }

  @include tablet-only {
    padding: 24px 24px 0;
  }

  @include mobile {
    padding: 24px 24px 0;
  }
}

.header-logo {
  display: block;
  font-size: 18px;
  font-weight: 600;
  line-height: 30px;
  text-decoration: none;
  text-transform: uppercase;
}

.header-menu {
  display: flex;
  justify-content: right;

  a {
    @extend .navigation;

    margin-right: 40px;
    text-decoration: none;
    transition: color 0.2s linear;
    cursor: pointer;

    &:last-child {
      margin-right: 0;
    }
  }

  @include tablet-only {
    display: none;
  }

  @include mobile {
    display: none;
  }
}

.header-mobile-menu {
  position: relative;
  display: none;
  width: 30px;
  z-index: 2;

  span {
    display: block;
    height: 2px;
    width: 100%;
    margin-bottom: 7px;

    &:first-child {
      transform-origin: center center;
    }

    &:last-child {
      transform-origin: center center;
      margin-bottom: 0;
    }
  }

  &.open {
    span {
      background-color: $white!important;
    }

    span:first-child {
      animation: firstBar 0.25s linear;
      animation-fill-mode: forwards;
    }

    .center {
      opacity: 0;
    }

    span:last-child {
      animation: thirdBar 0.25s linear;
      animation-fill-mode: forwards;
    }
  }

  &.close {
    span:first-child {
      animation: firstBarOut 0.25s linear;
      animation-fill-mode: forwards;
    }

    .center {
      opacity: 1;
    }

    span:last-child {
      animation: thirdBarOut 0.25s linear;
      animation-fill-mode: forwards;
    }
  }

  @include tablet-only {
    display: block;
  }

  @include mobile {
    display: block;
  }
}

.header-mobile-menu-list {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: $gray-004;
  z-index: 1;
  transform: translateY(-100%);
  transition: transform 0.25s linear;
  overflow: auto;

  & > div {
    position: relative;
    height: 90vh;
    min-height: 450px;
  }

  @include tablet-only {
    display: block;
  }

  @include mobile {
    display: block;
  }
}

.header-mobile-menu.open + .header-mobile-menu-list {
  transform: translateY(0);
}

.header-mobile-menu.close + .header-mobile-menu-list {
  transform: translateY(-100%);
}

.header-mobile-menu-text {
  @extend .body-regular;

  position: absolute;
  top: 27px;
  left: 20px;
  color: $gray-002;

  @include tablet-only {
    font-size: 24px!important;
    line-height: 24px!important;
  }
}

.header-mobile-menu-links {
  padding: 108px 12px 0;

  a {
    display: block;
    font-weight: 600;
    font-style: normal;
    font-size: 52px;
    line-height: 52px;
    letter-spacing: -3px;
    text-transform: uppercase;
    color: $gray-001;
    text-decoration: none;
  }

  @include tablet-only {
    display: flex;
    padding-left: 100px;

    a {
      font-size: 60px;
      line-height: 60px;
    }
  }
}

.header-mobile-menu-social-media {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 40px;

  span {
    @extend .body-regular;

    display: block;
    color: $gray-002;
    text-align: center;
    margin-bottom: 15px;
  }

  & > div {
    display: flex;
    justify-content: center;

    a {
      margin-right: 30px;

      &:last-child {
        margin-right: 0;
      }
    }
  }
}

@keyframes firstBar {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(9px);
  }

  75% {
    transform: translateY(9px);
  }

  100% {
    transform: translateY(9px) rotate(45deg);
  }
}

@keyframes firstBarOut {
  0% {
    transform: translateY(9px) rotate(45deg);
  }

  50% {
    transform: translateY(9px) rotate(0);
  }

  75% {
    transform: translateY(9px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes thirdBar {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-9px);
  }

  75% {
    transform: translateY(-9px);
  }

  100% {
    transform: translateY(-9px) rotate(-45deg);
  }
}

@keyframes thirdBarOut {
  0% {
    transform: translateY(-9px) rotate(-45deg);
  }

  50% {
    transform: translateY(-9px) rotate(0);
  }

  75% {
    transform: translateY(-9px);
  }

  100% {
    transform: translateY(0);
  }
}