/* Fixed top bar: layouts/partials/header/_flat and _home */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;
  width: 100%;
  white-space: nowrap;
}

.flat-menu {
  display: flex;
  padding: 1em;
  text-align: center;
  background: white;

  @media (min-width: 48em) {
    text-align: left;
  }

  a {
    color: var(--atlas-heading);
  }

  li a:hover,
  li a:focus {
    border-bottom: 1px solid currentColor;
  }

  .brand,
  .tagline,
  .nav-links a {
    margin: 0.5em 1em;
    padding: 0;
  }

  .brand {
    display: block;
    font-size: 120%;
    font-weight: 400;
    text-transform: uppercase;
  }

  .tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: auto;
    color: white;
    letter-spacing: 0.05em;
    opacity: 0.8;
    text-transform: uppercase;
  }
}

.nav-links {
  display: inline-block;
  margin: 0 30px 0 0;
  padding: 0;
  list-style: none;

  @media (max-width: 500px) {
    margin-left: auto;
    margin-right: 0;
  }

  li {
    position: relative;
    display: inline-block;
    height: 100%;
    vertical-align: middle;
  }

  a {
    display: block;
    white-space: nowrap;
  }
}

/* Red dot next to the user's name when the cart has items */
.cart-span {
  position: absolute;
  top: 53%;
  right: 0.8em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: red;
}

/* -- Search -- */

.header-search {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;

  i {
    margin-right: 10px;
    font-size: 20px;
    color: rgba(0, 0, 0, 0.4);
  }

  input {
    width: 170px;
    height: 46px;
    border: none;
    font-size: 14px;
    outline: none;
    transition: all 0.5s;

    &:hover,
    &:focus,
    &.focused {
      width: 300px;
      border-bottom: 1px solid #e2e2e2;
    }

    @media (max-width: 480px) {
      width: 45px;
      height: 33px;
      margin-right: 4px;

      &:hover,
      &:focus,
      &.focused {
        width: 150px;
      }
    }

    @media (max-width: 374px) {
      &:hover,
      &:focus,
      &.focused {
        width: 125px;
      }
    }
  }
}

/* -- Mobile dropdowns (menu and filters) -- */

.flat-menu .btn.btn-primary.dropdown-toggle {
  padding: 6px 8px;

  &,
  &:hover,
  &:focus,
  &:active,
  &.show {
    border-color: white;
    background-color: white;
    color: #000;
    opacity: 0.6;
  }
}

#mobile-drop-menu,
#mobile-drop-filter {
  &.dropdown-menu {
    right: 0;
    left: initial;
    max-width: 300px;
    padding: 0;
    border-radius: 0;
    background-color: white;
    color: #000;

    > li > a {
      color: var(--atlas-heading);

      &:hover,
      &:focus {
        border-color: white;
        background-color: white;
        color: #000;
        opacity: 0.6;
      }
    }

    li.scrollable {
      height: 80vh;
      overflow-y: scroll;
    }
  }
}

#mobile-drop-filter.dropdown-menu {
  min-width: 300px;
}

#mobile-drop-menu.dropdown-menu {
  li {
    display: flex;
    align-content: center;
    padding: 4px 10px;
    border-top: 1px solid rgba(160, 160, 160, 0.2);

    a {
      width: 100%;
      padding: 3px;
    }

    &.name {
      padding-top: 16px;
      color: rgba(0, 0, 0, 0.5);
    }
  }

  .fa {
    display: flex;
    align-items: center;
    width: 24px;
    opacity: 0.6;
  }
}
