$campus-menu-height: 40;

@mixin cwui-top-bar {
  @include foundation-top-bar;

  .campus-menu-wrap {
    @include breakpoint(xlarge) {
      margin-bottom: rem-calc(10);
    }
  }

  .top-bar {
    display: block;
    height: $campus-menu-height * 1px;
    // overflow: hidden;
    padding: 0;
    position: relative;
    width: 100%;

    @include breakpoint(xlarge) {
      height: auto;
      overflow: initial;
      padding: 0 1rem;
    }

    .menu a,
    .dropdown.menu > li > a {
      background: #6f695d;
      color: #fff;
      font-size: rem-calc(14);

      @include breakpoint(xlarge) {
        background: transparent;
        color: #0a0a0a;
      }
    }

    .menu .active > a {
      background: initial;
      color: #fff;
      font-weight: bold;

      @include breakpoint(xlarge) {
        color: #0a0a0a;
      }
    }

    [data-whatinput="mouse"] & a:hover,
    [data-whatinput="mouse"] & .dropdown.menu a:hover,
    .dropdown.menu .is-active > a {
      background: #b45201;
      color: #fff;
    }


    .is-drilldown-submenu-parent > a::after {
      border-color: transparent transparent transparent currentColor;
    }

    .submenu {
      background: #6f695d; // [1]

      a,
      .active > a {
        color: #fff;
      }
    }

    .submenu .submenu {
      background: #433f38;
    }

    .is-dropdown-submenu {
      border: 0;
    }

    .js-drilldown-back > a {
      background: #4e4a41;

      &::before {
        border-color: transparent currentColor transparent transparent;
      }
    }
  }

  .top-bar.campus-menu {

    &.is-expanded {
      height: auto;
    }


    .top-bar-left > ul > li > a {
      border-right: 1px solid #bdb4a2;
    }

    // override Foundation's arrow styles
    .dropdown.menu > li.is-dropdown-submenu-parent > a::after {
      border: 5px inset;
      border-color: rgba(0, 0, 0, .4) transparent transparent;
      margin-right: rem-calc(10);
      right: 0;
    }
  }


  .top-bar__mobile-menu {
    display: flex;
    font-size: rem-calc(14);
    justify-content: space-between;
    padding: rem-calc(0 15);

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

    a {
      background: #e7e2d9;
      color: #000;
      display: block;
      height: $campus-menu-height * 1px;
      line-height: $campus-menu-height * 1px;
      padding: rem-calc(0 14);
      text-decoration: none;

    }

    .toggle-topbar {
      left: 0;
      padding-right: rem-calc(26);
      position: relative;

      .is-expanded & {
        background: #b45201;
        color: #fff;
      }
    }

    .toggle-topbar::after {
      @include css-triangle(5px, currentColor, down);
      margin-top: -2px;
      position: absolute;
      right: rem-calc(10);
      top: 50%;
      transition: transform .3s;

      .is-expanded & {
        transform: rotate(180deg);
      }
    }

    .toggle-task-nav {
      color: #6d695f;

      .fa-search {
        font-size: 1.5em;
      }
    }
  }


  //
  // 1. Unsets the inline styles set by Foundation's JS to allow
  // the menu to expand to full-width.
  //

  .top-bar__mobile-submenu {
    display: none;
    position: absolute;
    top: 100%;
    width: 100%;
    z-index: 4;

    @include breakpoint(xlarge) {
      display: block;
      position: inherit;
      top: unset;
    }

    > .is-drilldown {
      max-width: unset !important; // [1]
    }

    .is-expanded & {
      border-top: 4px solid #b45206;
      display: block;
      width: 100%;

      @include breakpoint(xlarge) {
        border: 0;
      }
    }
  }
}
