@import "template.scss";

.nav {
  display: flex;
  gap: 20px;
  color: $base-color;
  padding: 15px 45px;
  background: rgba($light-grey, 0.65);
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 62px;
  box-sizing: border-box;
  z-index: 1;
  backdrop-filter: blur(8px);
  font-size: 18px;
  align-items: center;
}

.navMobile {
  display: none;
}

.itemsLeft {
  display: flex;
  gap: 30px;
  flex-grow: 1;
}

.menuLink {
  color: inherit;
  text-decoration: none;
  transition: opacity 100ms ease-in;
  cursor: pointer;
}

.menuLink:hover {
  opacity: 0.7;
}

.itemsRight {
  display: flex;
  gap: 20px;
  align-items: baseline;
}

.button {
  padding: 10px;
  border-radius: 10px;
  border: none;
  color: inherit;
  text-decoration: none;
  background-color: #EEEEEE;
  transition: background-color 0.1s ease-in-out;
  font-family: inherit;
}

.button:hover {
  background-color: $highlight-color;
  cursor: pointer;
}

.logoLink {
  height: 30px;
}

.megaMenu {
  position: fixed;
  top: 62px;
  left: 0;
  width: 100%;
  z-index: 8;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.megaMenuActive {
  max-height: 800px;
}

.search {
  display: flex;
  align-items: center;
}

.searchInput {
  width: 0;
  padding: 0;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
  box-sizing: border-box;
  transition: width 0.3s ease-in-out, padding 0.3s ease-in-out, border-color 0.3s ease-in-out;

  &::-webkit-search-cancel-button {
    -webkit-appearance: none;
  }
}

.search:hover .searchInput,
.search:focus-within .searchInput {
  width: 180px;
  padding: 4px 8px;
  border-bottom-color: $shade1;
}

.searchButton {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: inherit;
}

@media screen and (max-width: 1100px) {
  .nav {
    flex-direction: column;
    padding: 15px 15px;
    align-items: inherit;
    font-size: 20px;
  }

  .megaMenu {
    position: inherit;
  }

  .megaMenuActive {
    max-height: 1500px;
  }

  .navMobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .itemsLeft {
    padding-bottom: 15px;
    border-bottom: 1px solid $border-color-light;
  }

  .itemsLeft, .itemsRight {
    gap: 10px;
    flex-direction: column;
  }

  .hide {
    display: none;
  }

  .full {
    height: 100vh;
    overflow: scroll;
  }

  .search {
    width: 100%;
  }

  .searchInput,
  .search:hover .searchInput,
  .search:focus-within .searchInput {
    width: 100%;
    padding: 8px;
    border-bottom-color: $border-color-light;
  }
}
