@use "sass:math";

@import "@/styles/variables.scss";
@import "@/styles/mixins";

$logo-padding: 1.8rem;

.header {
  width: 100%;
  max-width: 100%;
  background: transparent !important;
  position: absolute !important;
  height: 5.5rem;

  :global(.navbar) {
    background: transparent !important;
    z-index: 1;
  }

  .logo {
    display: flex;
    align-items: center;
    padding: $logo-padding;
  }

  a {
    color: $white;
  }

  .icon {
    cursor: pointer;
    color: $white;
    @include flex(space-between, center);
    i {
      font-size: $font-h3;
    }
  }

  .iconLabel {
    margin-left: 0.5rem;
  }

  .navItem {
    cursor: pointer;
    &:hover {
      color: rgba($white, 0.6);
    }
  }

  .langSelector {
    .trigger {
      color: $white;
      @include flex(flex-start, center);
      .icon {
        font-size: $font-h3;
      }
      &:hover {
        .icon {
          color: rgba($white, 0.6);
        }
        color: rgba($white, 0.6);
      }
    }
    .menu {
      min-width: 8.571rem;
      padding-top: 2.143rem;
      transform: translate(-25%, 0);
      &::before {
        content: " ";
        position: absolute;
        left: 50%;
        top: 2.143rem;
        width: 1rem;
        height: 1rem;
        background-color: $blue-dark;
        transform: translate(-50%, -50%) rotate(45deg);
      }
      .dropdownContent {
        background: $blue-dark;
        border-radius: 0;
        padding: 1rem 0;
      }
      .item {
        line-height: 3.143rem;
        padding: 0;
        text-align: center;
        &:hover {
          background: $blue-dark;
          color: rgba($white, 0.6);
        }
      }
    }
  }

  .desktopMenu {
    display: flex;
    .navbarEndContent {
      .searchWrapper {
        align-items: center;
        display: flex;
        padding: 0.5rem 1.5rem;
        flex-grow: 0;
        flex-shrink: 0;
        line-height: 1.5;

        .searchPanel {
          position: absolute;
          top: 100%;
          left: 0;
          right: 0;
          height: 0;
          line-height: 1.75;
          background-color: $blue-dark;
          box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.1);
          transition: all 0.1s linear;
        }
        .searchPanel.searchOpen {
          height: 11.25rem;
        }
      }
      .searchWrapper.searchOpen {
        background-color: $blue-dark;
        box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.1);
      }
    }
  }

  .burger {
    display: none;
  }
}

$navbar-end-icon-padding: 28px;
.navbarEndItem {
  padding: 0 math.div($navbar-end-icon-padding, 2) !important;
}

.useFree:global(.button.is-white) {
  color: $blue-dark;
  min-width: 7rem;
  margin-right: calc(#{$logo-padding} - #{math.div($navbar-end-icon-padding, 2)});
}

@media screen and (max-width: $wide) {
  .header {
    height: 4rem;
    .desktopMenu {
      display: none;
    }
    .logo {
      padding: 0 1rem;
    }
    .burger {
      min-height: 4rem;
      @include flex(center, center);
    }
    .icon {
      font-size: $font-h2;
    }
    .opened {
      position: fixed;
      left: 0;
      top: 0;
    }
    .mobileNavBar {
      width: 100%;
      background: rgba($blue-dark, 0);
      @include flex(space-between, center);
      &.opened {
        background: rgba($blue-dark, 1);
      }
      &End {
        @include flex(space-between, center);
      }
    }
  }
}
