.main-nav-tablet {
  display: none;

  @include tablet {
    display: block;
  }

  @include sm {
    display: none;
  }

  &__contact {
    position: fixed;
    bottom: 18px;
    left: 18px;
    display: block;
    width: 48px;
    height: 48px;
    padding: 12px;
    background-color: $medium-color;
    border: 2px solid hsla(0,0%,93.3%,.25);
    border-radius: 22px;

    .projects-detail & {
      right: 15px;
      bottom: 170px;
    }

    path {
      fill: #fff;
    }
  }

  &__lang-menu {
    position: fixed;
    right: 0;
    top: $header-height;
    width: 100%;
    height: calc(100vh - #{$header-height});
    text-align: left;
    pointer-events: none;
    overflow: hidden;
    z-index: 9;

    ul {
      background-color: #fff;
      height: 100%;
      padding: 15px 22px 0;
      margin: 0;
      opacity: 0;
      transform: translateY(-100%);
      transition: all 0.3s linear;

      a {
        padding: 20px 0;
        display: block;
        font-size: 1.8rem;
        line-height: 2rem;
        box-shadow: inset 0 -1px 0 0 $gray-bluish;
      }
    }

    &.js-open {
      pointer-events: all;

      ul {
        opacity: 1;
        transform: translateY(0);
      }
    }
  }

  &__menu-holder {
    position: fixed;
    top: $header-height;
    left: 0;
    width: 100%;
    height: calc(100vh - #{$header-height});
    pointer-events: none;
    overflow: hidden;
  }

  &__menu-wrapper {
    background-color: $white;
    width: 200%;
    height: 100%;
    opacity: 0;
    overflow: hidden;
    transform: translate3d(0, -50%, 0);
    pointer-events: all;
    transition: all 350ms ease-out;

    .js-menu-open & {
      pointer-events: all;
      opacity: 1;
      transform: translate3d(0, 0, 0);
    }

    .js-tablet-sub-open & {
      transform: translate3d(-50%, 0, 0);
    }
  }

  &__menu {
    position: absolute;
    height: 100%;
    width: 50%;
    margin: 0 auto;
    padding: 15px 22px;
    overflow-y: auto;
  }

  &__sub-menus {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    pointer-events: none;
    overflow-y: auto;

    .js-tablet-sub-open & {
      pointer-events: all;
    }
  }

  .header-menu {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;

    .js-menu-open & {
      opacity: 1;
      transform: translateY(0);

      @for $i from 1 through 20 {
        &:nth-child(#{$i}) {
          transition-delay: $i * 0.1s;
        }
      }
    }
  }

  .header-menu__sub-menu {
    display: none;
    padding: 0 32px;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;

    &.js-active {
      display: flex;
    }
  }

  .header-menu__sub-menu-container {
    display: flex;
    transition: all 0.3s ease-out;
    transition-delay: 500ms;

    .js-tablet-subsub-open & {
      transition-delay: 0ms;
    }
  }

  .header-menu__sub-menu-left {
    width: 60%;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;

    nav {
      padding: 32px 32px 0 0;
    }
  }

  .header-menu__sub-menu-right {
    width: 40%;
  }

  .header-menu > a,
  .header-menu__sub-menu-back {
    font-family: var(--font-heading);
    position: relative;
    font-size: 2.1rem;
    line-height: 120%;
    font-weight: 600;
    padding: 20px 0;
    display: block;
    box-shadow: inset 0 -1px 0 0 $gray-bluish;
    color: $medium-color;
  }

  .header-menu__sub-menu-back {
    padding: 24px 32px 24px 40px;
    box-shadow: unset;

    &::after {
      content: "";
      display: block;
      position: absolute;
      pointer-events: none;
      left: 5px;
      top: calc(50% - 8px);
      width: 24px;
      height: 25px;
      transform: rotate(-180deg);
      background: url(../../assets/img/svg/icon-arrow-right.svg) no-repeat center 4px;
      transition: all 0.2s linear;
    }
  }

  .header-menu.header-menu--secondary a {
    font-family: $font-heading;
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 120%;
    padding-left: 26px;
    color: $primary-color;

    &:before {
      position: absolute;
      top: 23px;
      left: 1px;
      content: "";
      display: block;
      width: 18px;
      height: 18px;
      background: url(../../assets/img/svg/external.svg) no-repeat center;
      background-size: contain;
    }
  }

  &__submenu-back {
    font-family: $font-heading;
    padding-left: 40px;
    font-size: 2.1rem;
    line-height: 120%;
    font-weight: 600;
    padding: 20px 0;
    display: block;
    color: $medium-color;
    position: relative;

    &::after {
      content: "";
      display: block;
      position: absolute;
      left: 5px;
      top: calc(50% - 8px);
      width: 24px;
      height: 25px;
      transform: rotate(-180deg);
      background: url(../../assets/img/svg/icon-arrow-right.svg) no-repeat center 4px;
    }
  }

  [data-role="submenuTablet"] {
    display: block;
    pointer-events: none;
    position: absolute;
    width: 100%;
    left: 100%;
    top: 0;
    background: $white;
    opacity: 1;
    transition: all 0.3s ease;

    &.js-active {
      pointer-events: all;
      opacity: 1;
      left: 0;
    }
  }

  .tablet-sub-bt {
    transition: all 0.2s linear;

    span {
      pointer-events: none;
    }
    &::after {
      content: "";
      display: block;
      position: absolute;
      pointer-events: none;
      right: 5px;
      top: calc(50% - 8px);
      margin-top: -7px;
      width: 24px;
      height: 25px;
      background: url(../../assets/img/svg/icon-arrow-right.svg) no-repeat center 4px;
      transition: all 0.2s linear;
    }

    &:focus {
      background-color: $gray-bluish-light;
      border-radius: 4px;
      padding: 20px 16px;

      &::after {
        right: calc(5px + 16px);
      }
    }
  }

  &__btn {
    font-family: $font-heading;
    position: relative;
    width: 40px;
    height: 40px;
    padding: 10px;
    margin-left: 2px;
    font-size: 1.8rem;
    font-weight: 500;
    text-transform: uppercase;
    line-height: 100%;
  }

  &__lang::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    display: block;
    width: 100%;
    height: 3px;
    background-color: $medium-color;
    pointer-events: none;
    opacity: 0;
    transform: translateY(3px);
    transition: all 200ms ease-out;

    .js-lang-open & {
      opacity: 1;
      transform: translateY(0);
    }
  }

  &__menu-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: $white;
    border-radius: 100%;
    transition: all 0.3s ease-out;

    .menu-icon {
      position: relative;
      width: 20px;
      height: 14px;

      &__line {
        position: absolute;
        width: 100%;
        height: 1px;
        background-color: $primary-color;
        transition: all 0.3s ease;

        &:nth-child(1) {
          top: 0;
        }

        &:nth-child(2) {
          top: 6px;
        }

        &:nth-child(3) {
          top: 12px;
          width: 70%;
        }
      }
    }

    .js-menu-open & {
      background-color: $gray-bluish;
      .menu-icon {
        &__line {
          &:nth-child(1) {
            transform: translateY(6px) rotate(45deg);
          }

          &:nth-child(2) {
            opacity: 0;
          }

          &:nth-child(3) {
            transform: translateY(-6px) rotate(-45deg);
            width: 100%;
          }
        }
      }
    }
  }

  &__col {
    box-shadow: inset 0 -1px 0 0 $gray-bluish;
  }

  &__col-heading {
    color: $medium-color;
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 0.1px;
    font-family: $font-default;
    line-height: 150%;
    letter-spacing: -0.18px;
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    transition: all 0.2s linear;

    &:focus, &:active {
      background-color: $gray-bluish-light;
      border-radius: 4px;
      padding: 16px;
    }

    a {
      width: 100%;
      color: $medium-color;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
  }

  &__col-heading-icon {
    display: inline-block;
    margin-left: 12px;
    width: 24px;
    height: 24px;

    svg {
      width: 100%;
      height: 100%;
    }
  }

  &__menu-item {
    font-family: $font-default;
    font-size: 1.8rem;
    font-style: normal;
    font-weight: 500;
    line-height: 150%;
    letter-spacing: -0.18px;
    color: $medium-color;
    padding: 16px 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    box-shadow: inset 0 -1px 0 0 $gray-bluish;
    transition: all 0.3s ease-out;

    &.tm-level2-menu-item {
      color: $primary-color;
      font-size: 1.6rem;
    }

    &.tm-main-menu-item {
      color: $primary-color;
      font-family: $font-default;
      font-size: 1.6rem;
      font-weight: 500;
      line-height: 150%;
      letter-spacing: -0.14px;
      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;
      box-shadow: unset;
    }

    &:focus, &:active {
      background-color: $gray-bluish-light;
      border-radius: 4px;
      padding: 16px !important;
      box-shadow: inset 0 0 0 0 $gray-bluish;
    }
  }

  &__menu-item-icon {
    display: inline-block;
    margin-left: 12px;
    width: 24px;
    height: 24px;

    svg {
      width: 100%;
      height: 100%;
    }

    .tm-main-menu-item & {
      display: none;
    }
  }

  &__menu-item,
  &__col-footer a {
    display: block;
    font-size: 1.8rem;
    line-height: 2rem;
    padding: 12px 0;
    width: 100%;
  }

  &__banner-item {
    margin: 0 -32px;
    background-color: $medium-color;
    padding: 16px 32px;
    display: flex;

    img {
      width: 40px;
      height: auto;
      margin-right: 16px;
      flex-shrink: 0;
      object-fit: contain;
      object-position: top;
    }
  }

  &__banner-text {
    @include tablet {
      display: flex;
      align-items: center;
      column-gap: 16px;
    }

    @include sm {
      display: block;
    }
  }

  &__banner-label {
    color: $white;
    font-family: $font-heading;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 120%;
    padding: 10px 0;

    @include tablet {
      font-size: 2.1rem;
    }

    @include sm {
      font-size: 1.8rem;
    }
  }

  &__banner-cta {
    color: $white;
    font-family: $font-heading;
    font-size: 1.8rem;
    line-height: 120%;
    margin-top: 15px;
    font-weight: 400;
    display: inline-block;
    margin-right: 20px;
    position: relative;

    @include tablet {
      margin-top: 0;
      margin-right: 0;
      font-size: 2.1rem;
      line-height: 150%;
    }

    @include sm {
      margin-top: 15px;
      margin-right: 20px;
      font-size: 1.8rem;
      line-height: 120%;
    }

    &:after {
      top: 6px;
      background-color: $white;
      width: 24px;
      height: 23px;
    }

    &:hover .link-underline {
      width: calc(100% - 26px);
    }
  }

  &__actions {
    display: flex;
    align-items: center;
    column-gap: 24px;
  }
}

.tablet-search {
  position: fixed;
  left: 0;
  top: $header-height;
  width: 100%;
  background: #fff;
  box-shadow: 0 10px 10px rgba(0,0,0,.1);
  overflow: hidden;
  opacity: 0;
  height: 0;
  transition: height .2s ease-in, opacity .2s ease-in .2s;

  &__wrapper {
    padding: 20px 0;
  }

  &__title {
    font-weight: 700;
    font-size: 14px;
    color: $primary-color;
    margin-top: 35px;
    display: none;
  }

  &.js-open {
    opacity: 1;
    height: 73px;
    transition: height .2s ease-out, opacity .2s ease-out;
  }

  input[type="text"] {
    border: none;
    font-size: 21px;
    line-height: 29px;
    color: $primary-color;
    font-style: italic;
    height: 30px;
    padding: 0 60px 0 20px;
    width: 100%;

    &::placeholder {
      color: $primary-color;
    }
  }

  input[type="submit"] {
    height: 40px;
    width: 40px;
    position: absolute;
    right: 20px;
    top: 15px;
    background: url(../img/svg/Go.svg) no-repeat 50%;
    margin: 0;
    padding: 0;
    border: none;
    display: none;
  }

  .box-close-btn {
    position: absolute;
    top: 25px;
    right: 20px;
  }

  &.js-can-submit {
    input[type="submit"] {
      display: block;
    }

    .box-close-btn {
      display: none;
    }
  }
}
