.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: em(50px);
  background: $white;
  border-bottom: em(1px) solid $light_gray;
  text-align: right;
  font-size: 0;
  z-index: 506;
  overflow: hidden;
  transition: z-index 0s 1s;
  will-change: transform;
  .search_open &, .navigation_open & {
    z-index: 909;
    transition: z-index 0s;
  }
  &.reveal {
    transform: translateY(-100%);
  }
  .cms-toolbar-expanded & {
    top: 46px;
  }
}

.header__navigation {
  position: absolute;
  top: 100%;
  right: em(62px);
  z-index: 2;
  .search_open & {
    display: none;
  }
  @media screen and (max-width: $medium_breakpoint) {
    display: none;
  }
}

.header__logo {
  position: fixed;
  top: 0;
  display: block;
  text-decoration: none;
  background: $green;
  padding: em(12px) em(15px) em(15px) em(15px);
  z-index: 510;
  transition: z-index 0s 1s;
  box-shadow: 0 0 em(15px) rgba($black, 0.05);
  img {
    width: em(100px);
    height: em(100px);
    display: block;
  }
  .search_open &, .navigation_open & {
    z-index: 910;
    transition: z-index 0s;
  }
  &.reveal {
    transform: translateY(-100%);
    opacity: 1;
  }
  .cms-toolbar-expanded & {
    top: 46px;
  }
  @media screen and (max-width: $medium_breakpoint) {
    img {
      width: em(70px);
      height: em(70px);
      display: block;
    }
  }
  @media screen and (max-width: $small_breakpoint) {
    padding: em(8px) em(10px) em(10px) em(10px);
  }
  @media screen and (max-width: $tiny_breakpoint) {
    padding: em(4px) em(5px) em(8px) em(5px);
    img {
      width: em(60px);
      height: em(60px);
    }
  }
}

.header__slogan {
  font-size: em(18px);
  line-height: em(48px);
  height: em(50px);
  background: $white;
  color: $gray;
  font-weight: 300;
  position: absolute;
  margin-left: em(150px);
  top: 0;
  display: block;
  transform: none;
  transition: transform 0.5s;
  @media screen and (max-width: 1060px) {
    .navigation_open & {
      transform: translateY(-100%);
    }
  }
  @media screen and (max-width: $medium_breakpoint) {
    display: block;
    z-index: 10;
    font-size: em(14px);
    margin-left: em(115px);
    transform: translateY(100%);
    .navigation_open & {
      transform: none;
    }
  }
  @media screen and (max-width: $small_breakpoint) {
    margin-left: em(105px);
  }
  @media screen and (max-width: $tiny_breakpoint) {
    margin-left: em(80px);
  }
}

.header__logo, .header__slogan, .footer__login {
  left: 15%;
  .timetable_body & {
    left: em(100px);
  }
  @media screen and (max-width: $huge_breakpoint) {
    left: em(70px) !important;
  }
  @media screen and (max-width: $large_breakpoint) {
    left: em(30px) !important;
  }
  @media screen and (max-width: $small_breakpoint) {
    left: em(15px) !important;
  }
  @media screen and (max-width: $tiny_breakpoint) {
    left: 0 !important;
  }
}

.header__languages {
  vertical-align: top;
  display: inline-block;
  height: 100%;
  padding: 0 em(15px);
  transition: transform 0.5s 0.1s;
  transform: none;
  li {
    display: inline-block;
    height: em(50px);
    &:first-child {
      a:before {
        display: none;
      }
    }
    a {
      color: $dark_gray;
      text-decoration: none;
      font-size: em(14px);
      line-height: em(50px);
      width: em(40px);
      text-transform: uppercase;
      display: block;
      font-weight: 800;
      text-align: center;
      opacity: 0.5;
      transition: opacity 0.2s $easeOutQuad;
      &:before {
        content: '';
        display: block;
        position: absolute;
        top: em(15px);
        bottom: em(15px);
        width: em(1px);
        background: $medium_light_gray;
      }
      &:hover {
        opacity: 1;
      }
    }
    &.active {
      font-weight: bold;
      a {
        opacity: 1;
      }
    }
  }
  .search_open &, .navigation_open & {
    transform: translateY(-100%);
  }
  @media screen and (max-width: $medium_breakpoint) {
    display: none;
  }
}

.header__button {
  height: em(50px);
  vertical-align: top;
  line-height: em(48px);
  display: inline-block;
  border-left: em(1px) solid $light_gray;
  font-size: em(18px);
  font-weight: 800;
  color: $green;
  text-decoration: none;
  padding: 0 em(64px) 0 em(18px);
  position: relative;
  background: $white;
  transition: transform 0.5s, border 0.3s, color 0.3s;
  transform: none;
  @for $i from 0 through 5 {
    &.data_id_#{$i} {
      transition-delay: $i * 0.1s, 0s, 0s;
      .header__button__icon {
        transition: transform 0.5s $i * 0.1s;
      }
    }
  }
  &.header__button--reverse {
    padding: 0 em(18px) 0 em(64px);
  }
  &.header__button--light {
    @media screen and (min-width: $medium_breakpoint + 1) {
      padding: 0 em(15px);
    }
    font-size: em(14px);
    font-weight: 400;
    color: $dark_gray;
  }
  &:last-child {
    border-right: em(1px) solid $light_gray;
  }
  .search_open &, .navigation_open & {
    transform: translateY(em(-50px));
  }
  &.active {
    color: $green;
  }
  @media screen and (max-width: $small_breakpoint) {
    padding: 0 em(54px) 0 em(12px);
    &.header__button--reverse {
      padding: 0 em(12px) 0 em(54px);
    }
  }
}

.header__button--light {
  line-height: em(50px);
  .header__button__icon {
    transition: transform 0.2s 0s !important;
  }
  &:hover {
    color: darken($dark_gray, 20);
    .header__button__icon {
      transform: scale(1.1);
    }
  }
  .search_open & {
    transform: none;
  }
}

.header__button--navigation {
  height: em(100px);
  padding-bottom: em(50px);
  rect {
    transform: none;
    transform-origin: 100% 50%;
    transition: transform 0.3s $easeOutQuart;
    &.line-middle {
      transform: scaleX(0.8);
    }
  }
  &:hover {
    .line-top {
      transform: scaleX(0.8);
    }
    .line-bottom {
      transform: scaleX(0.6);
    }
    .line-middle {
      transform: scaleX(1);
    }
  }
  .search_open &, .navigation_open & {
    border-color: transparent;
    .header__button__icon {
      transform: translateY(em(50px));
    }
    rect {
      transform-origin: 50% 50%;
    }
    .line-top {
      transform: rotate(-45deg) translateY(10px);
    }
    .line-bottom {
      transform: rotate(45deg) translateY(-10px);
    }
    .line-middle {
      transform: scaleX(0);
    }
    &:hover {
      .line-top {
        transform: rotate(-45deg) scaleX(0.8) translateY(10px);
      }
      .line-bottom {
        transform: rotate(45deg) scaleX(0.8) translateY(-10px);
      }
    }
  }
}

.header__button--close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  background: none;
  border: none;
  path {
    transform: none;
    transform-origin: 50% 50%;
    transition: transform 0.3s $easeOutQuart;
  }
  &:hover {
    background: none;
    path {
      transform: rotate(90deg);
    }
  }
  .cms-toolbar-expanded & {
    top: 46px;
  }
}

.header__button--search {
  font-size: 0;
  padding-left: 0;
  .circle {
    transform: none;
    transform-origin: 50% 50%;
    transition: transform 0.3s $easeOutQuart;
  }
  &:hover {
    .circle {
      transform: scale(1.15);
    }
  }
}

@keyframes ring {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(-10deg);
  }
  20% {
    transform: rotate(10deg);
  }
  30% {
    transform: rotate(-10deg);
  }
  40% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(0);
  }
}

.header__button--notification {
  font-size: 0;
  padding-left: 0;
  &.new {
    .header__button__icon {
      transform-origin: 50% 30%;
      animation: ring 2s $easeOutQuad infinite;
    }
  }
  svg {
    transform: none;
    transition: transform 0.3s $easeOutQuart;
  }
  &:hover {
    svg {
      transform: scale(1.12);
    }
  }
}

.header__button__icon {
  width: em(32px);
  height: em(32px);
  position: absolute;
  top: em(9px);
  right: em(16px);
  will-change: transform;
  svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: $green;
    .header__button--light & {
      fill: currentColor;
    }
  }
  .header__button--reverse & {
    right: auto;
    left: em(16px);
  }
  .header__button--light & {
    @media screen and (min-width: $medium_breakpoint + 1) {
      position: relative;
      top: 0;
      right: 0;
      left: 0;
      display: inline-block;
      vertical-align: middle;
      width: auto;
      svg {
        width: auto;
      }
    }
  }
  @media screen and (max-width: $small_breakpoint) {
    right: em(12px);
    .header__button--reverse & {
      right: auto;
      left: em(12px);
    }
  }
}

.header__button__icon__number {
  position: absolute;
  top: em(0.5px);
  will-change: transform;
  left: 0;
  font-size: em(9px);
  background: $green;
  width: em(14px);
  height: em(14px);
  border-radius: 50%;
  line-height: em(14px);
  color: $white;
  font-weight: 900;
  text-align: center;
  z-index: 2;
}