.papertrail-navigation {
  background: #04498f;
  position: sticky;
  top: 0;
  height: 65px;
  width: 100%;
  z-index: 502;
  font-family: "Helvetica";
  font-size: 15px;

  .flex,
  .grow {
    height: 100%;
  }

  img {
    width: 100%;
    max-width: 260px;
    height: 51px;
  }

  ul {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;

    li {
      display: flex;
      align-items: center;
      position: relative;
      height: auto;

      &.open > ul.sub-menu {
        display: block !important;
      }

      a {
        color: #fff;
        display: inline-block;
        text-decoration: none;
        flex-grow: 1;
        font-weight: normal;
        padding: 0 16px;

        &:hover {
          text-decoration: underline;
        }
      }
    }

    ul {
      color: #000;

      &.sub-menu {
        display: none !important;
        position: absolute;
        top: 100%;
        width: 240px;
        height: auto;
        text-align: left;
        background: #fff;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 25%);
        border: 1px solid #000;
        z-index: 11;
        padding: 16px;
        top: 43px;
        left: 15px;

        li {
          margin-bottom: 15px;

          a {
            color: #333333;
            padding: 0;
          }
        }

        li:last-child {
          margin-bottom: 0;
        }
      }
    }

    .menu-item-has-children {
      .nav-item-icon {
        padding-bottom: 2px;

        svg {
          width: 9px;
          height: 5px;
          margin-left: 4px;
          fill: #fff;
        }
      }

      & > a {
        cursor: pointer;
        display: flex;
        align-items: center;
      }

      &.open > a .nav-item-icon svg {
        transform: rotate(180deg);
      }
    }

    .btn {
      border: 0;
      padding: 0;
      margin: 0 16px;
      background: transparent;
      box-shadow: none;

      &.btn-first {
        margin-left: 48px;
      }

      &.btn-green {
        background-image: linear-gradient(to bottom, #62c462, #51a351);
        box-shadow:
          inset 0 1px 0 rgba(255, 255, 255, 0.2),
          0 1px 2px rgba(0, 0, 0, 0.05);
      }

      &.btn-blue a {
        padding: 0;

        &:hover {
          text-decoration: underline;
        }
      }

      a {
        padding: 4px 18px;

        &:hover {
          text-decoration: none;
        }
      }
    }

    @media screen and (max-width: 800px) {
      .hide-medium {
        display: none;
      }
    }
  }
}

/* ============================================================
   Papertrail Mobile Navigation (.papertrail-nav-mobile)
   Adapted from sw-global/blocks/sw-global-nav/styles.css
   ============================================================ */

.papertrail-nav-mobile {
  display: none;
  font-family: "Helvetica";

  nav {
    position: relative;
    z-index: 100;
    background: #04498f;

    .wrap {
      display: grid;
      grid-template-columns: 1fr auto auto;
      grid-template-rows: auto auto;
      align-items: center;
      padding: 3px 1rem;
      position: relative;
    }

    .logo {
      grid-column: 1;
      grid-row: 1;
      display: flex;
      align-items: center;
      text-decoration: none;
      width: fit-content;

      img {
        max-height: 51px;
        max-width: 241px;
        width: 100%;
        height: auto;
      }
    }

    .button.cta {
      grid-column: 2;
      grid-row: 1;
      margin-right: 0.75rem;
      padding: 0.4rem 0.85rem;
      border-radius: 4px;
      font-size: 14px;
      font-weight: 600;
      text-decoration: none;
      color: #fff;

      &.blue {
        background-color: #0070c9;
      }
      &.green {
        background-color: #2c8a3c;
      }
    }

    &.active {
      .mobile-nav-buttons {
        .bars {
          display: none;
        }
        .close {
          display: block;
        }
      }

      .top-menu-mobile {
        display: block;
      }
    }
  }

  .mobile-nav-buttons {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;

    .bars,
    .close {
      background: none;
      border: none;
      cursor: pointer;
      padding: 0.25rem;
      fill: #fff;
      stroke: #fff;
    }

    .close {
      display: none;
    }
  }

  .top-menu-mobile {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    list-style: none;
    margin: 0;
    padding: 1rem 1.5rem 1.5rem;
    border: 1px solid #000;
    background: #fff;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: -16px;
    right: -16px;

    button {
      background-color: transparent;
      border: none;
      cursor: pointer;
      font-family: inherit;
    }

    li {
      list-style: none;
    }

    ul {
      display: none;
    }

    .show {
      display: block;
    }

    .level-1 {
      .nav-item-mobile,
      .mobile-btn-style {
        margin-bottom: 1.5rem;

        &.hide {
          margin-bottom: 0;
        }
      }

      .mobile-sub-nav {
        li:last-child {
          .nav-item-mobile,
          .mobile-btn-style {
            margin-bottom: 0;

          }   
        }
      }

      &:last-child .mobile-btn-style {
        margin-bottom: 0;
      }
    }

    .hide {
      display: none !important;
    }
  }

  .mobile-btn-style {
    position: relative;
    top: 0;
    font-size: 15px;
    line-height: 20px;
    color: #333;
    justify-content: space-between;
    padding: 0;
    width: 100%;
    text-decoration: none;
    display: flex;
    align-items: center;
    text-align: left;
    cursor: pointer;
    height: auto;
    font-weight: inherit;
    font-family: inherit;

    svg {
      margin-left: auto;
      flex-shrink: 0;
    }

    &.back-button {
      color: #006482;
      justify-content: flex-start;
      font-size: 1rem;

      .text {
        margin-left: 0.53rem;
        display: inline-block;
      }

      svg {
        width: 14px;
        height: 14px;
        margin: unset;
      }
    }

    &.btn-green {
      color: #fff;
      padding: 4px 18px;
      border-radius: 4px;
      font-size: 14px;
      font-weight: normal;
      background-image: linear-gradient(to bottom, #62c462, #51a351);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.05);
      width: fit-content;
    }
  }

  .mobile-sub-nav {
    width: 100%;
    z-index: 0;
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 20px;

    &.show {
      display: block;
    }
    li {
      margin-bottom: 1.5rem;
    }

    li:last-child {
      margin-bottom: 0;

      a {
        margin-bottom: 0;
      }
    }

    li:nth-child(n + 2) .mobile-btn-style {
      border-left-color: #006482;
    }
  }

  .mobile-title {
    cursor: default;
    padding: 0.75rem 1.5rem;
    font-size: 18px;

    &.bold {
      font-weight: bold;
    }
  }

  .smaller-title {
    font-size: 16px;
  }

  @media (max-width: 799px) {
    display: block;
  }
}

/* Hide the desktop nav on mobile */
@media (max-width: 799px) {
  nav.papertrail-navigation {
    display: none;
  }
}
