/**
* Name: Navbar
* Author: Symbiosys
*/

nav.os-navbar {
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  height: $navbar-height;
  border-bottom: .1rem solid $os-light;
  background: $white;

  &--fixed {
    width: 100%;
    position: fixed;
    top: 0;
  }

  .brand {
    &, & a {
      font-size: 3rem;
      color: $os-dark;
      text-decoration: none;
      display: flex;

      > img {
        height: 4rem;
      }
    }
  }

  .nav-icon {
    display: block;
    font-size: 2rem;
    color: $os-dark;

    @include breakpoint(md) {
      display: none;
    }
  }

  .nav {
    transform: translateY(1rem);
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 100%;
    left: 0;
    padding: 1rem 0;
    top: calc(100% + .1rem);
    background: $white;
    z-index: 200;
    transition: all .3s;

    &.active {
      transform: translateY(0);
      opacity: 1;
      pointer-events: all;
      box-shadow: 0 1rem 2rem rgba($os-dark, .2);
    }

    @include breakpoint(md) {
      transform: translateY(0);
      opacity: 1;
      pointer-events: all;
      padding: 0;
      top: 0;
      position: relative;
      width: auto;
      box-shadow: none !important;
      display: flex;
      align-items: center;
    }

    a {
      display: block;
      width: calc(100% - 4rem);
      margin: 0 auto;

      &:not(.btn) {
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
      }

      @include breakpoint(md) {
        display: inline-block;
        width: auto;
        margin-bottom: 0;
        margin-right: 1rem;

        &:not(.btn) {
          padding-bottom: 0;
          margin-bottom: 0;
        }

        &:last-child {
          margin-right: 0;
        }
      }
    }

    &__item {
      color: $os-dark;
      text-decoration: none;

      &::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 0.1rem;
        background: $os-dark;
        transform: scaleX(0);
        transition: transform .3s;
        transform-origin: right;
      }

      &:hover {
        &::after {
          transform-origin: left;
          transform: scaleX(1);
        }
      }

      &.active {
        color: $os-primary;
        &::after {
          transform: none;
          background: $os-primary;
        }
      }
    }
  }
}
