header {
  margin: 0;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
  transition: transform 0.3s ease-out;
  background-color: rgba(2, 4, 78, 0.9);
}

header a {
  color: white;
  padding: 15px 15px;
  text-decoration: none;
  font-size: 17px;
}

header a:hover {
  text-decoration: underline;
}

.topnav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.hidden {
  transform: translateY(-100%);
}

#nav-links {
  padding-left: 0;
  margin-left: 1rem;
  margin-top: auto;
  margin-bottom: auto;
}

#nav-links a {
  padding-right: 0;
}

#nav-links .desktop,
#nav-links .mobile,
#nav-actions {
  margin-top: auto;
  margin-bottom: auto;
}

#nav-links .mobile,
.menu-expanded #hamburger-trigger,
#close-trigger {
  display: none;
}

.menu-expanded #close-trigger,
.menu-expanded .nav-links-expanded {
  display: block;
}

header:not(.menu-expanded) .nav-links-expanded {
  animation: header-shrink 0.2s ease-in-out forwards;
  overflow: hidden;
}

.menu-expanded .nav-links-expanded {
  animation: header-grow 0.2s ease-in-out forwards;
}

@keyframes header-grow {
  0% {
    max-height: 0;
  }
  100% {
    max-height: 223px;
  }
}

@keyframes header-shrink {
  0% {
    max-height: 223px;
  }
  100% {
    max-height: 0;
  }
}

.nav-links-expanded a {
  display: block;
  padding-bottom: 1rem;
  padding-top: 1rem;
  padding-left: 2rem;
  border-bottom: 1px solid #ffffff88;
}

.nav-links-expanded a:last-child {
  border-bottom: 0;
}

#logo {
  display: flex;
  align-items: center;
}

#nav-actions {
  margin-left: auto;
  margin-right: 1rem;
  position: relative;
}

.cart-icon {
  position: relative;
}

/*https://www.solodev.com/blog/web-design/how-to-show-the-total-number-of-items-in-customer-shopping-carts.stml*/
.cart-count {
  position: absolute;
  top: -5px;
  left: 15px;
  background-color: red;
  color: white;
  font-size: 0.75rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

@media only screen and (max-width: 900px) {
  #nav-links .mobile {
    display: block;
    padding-left: 0;
  }
  #shopping-cart {
    padding-right: 0;
    display: flex;
    align-items: center;
  }
  #nav-links .desktop {
    display: none;
  }
}
