/* Navigation  */
.top_bar {
  display: flex;
  padding: 0.5rem 2.5rem;
  justify-content: space-between;
  border-bottom: 1px solid var(--light-primary);
  gap: 1.5rem;
  align-items: center;

  @media screen and (max-width: 767px) {
    padding: 0.5rem 1rem;
    gap: 0;
  }

  @media screen and (max-width: 374px) {
    flex-direction: column;
  }

  a {
    color: var(--primary);
    font-size: 1rem;
    letter-spacing: -0.5px;
    line-height: 1.4;
    font-weight: 600;
  }

  .support-icon {
    width: 25px;
    height: 25px;
  }
}

.site_header {
  display: flex;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  align-items: center;
  position: relative;
  z-index: 999;

  @media screen and (max-width: 1199px) {
    padding: 1rem;
  }

  .logo_header {
    width: auto;
    overflow: hidden;
    padding: 0 !important;

    .logo-desktop {
      height: 40px;
      width: auto;
      max-inline-size: none;

      @media screen and (max-width: 991px) {
        display: none;
      }
    }
    .logo-mob {
      display: none;

      @media screen and (max-width: 991px) {
        display: block;
        height: 40px;
        width: auto;
      }
    }
  }

  .site_navigation {
    grid-column: 3;
    justify-self: end;

    @media screen and (max-width: 767px) {
      position: fixed;
      inset: 0;
      background: var(--dark-gray);
      transform: translateX(100%);
      transition: transform 0.3s ease-in-out;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 90%;
      z-index: 2;
      right: 0;
      left: auto;
      height: 100%;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      -webkit-transform: translateX(100%);

      &.active {
        transform: translateX(0);
        -webkit-transform: translateX(0);
        /* For iOS compatibility */
      }
    }

    ul {
      display: flex;
      gap: 1.25rem;

      @media (min-width: 767px) and (max-width: 1199px) {
        gap: 1rem;
      }

      a {
        text-decoration: none;
        font-weight: 700;
        color: var(--primary);

        @media (min-width: 767px) and (max-width: 1199px) {
          font-size: 0.9rem;
        }

        @media screen and (max-width: 767px) {
          font-size: 20px;
        }
      }

      @media screen and (max-width: 767px) {
        flex-direction: column;
        gap: 1.5rem;
        padding: 2rem 0;
      }
    }
  }

  .header-right {
    position: relative;
    display: flex;
    gap: 1rem;
    align-items: center;

    .dropdown-trigger {
      display: flex;
      flex-direction: column;
      gap: 4px;
      background: none;
      border: none;
      padding: 5px;
      cursor: pointer;
      justify-content: center;
    }

    a {
      font-weight: 600;
    }

    .dropdown-menu {
      position: fixed;
      top: 0;
      right: -100%;
      height: 100vh;
      background: var(--light-gray);
      width: 25%;
      padding: 4rem 1.5rem;
      transition: right 0.3s ease-in-out;
      box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
      overflow-y: auto;
      z-index: 9;

      @media screen and (min-width: 768px) and (max-width: 1199px) {
        width: 60%;
      }

      @media screen and (max-width: 767px) {
        width: 85%;
      }

      &.active {
        right: 0;
      }

      ul {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        height: 100%;

        li {
          margin: 0;

          a {
            display: block;
            padding: 0.5rem;
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--primary);
            transition: color 0.2s;
            background: transparent !important;
            backdrop-filter: unset;

            &:hover {
              color: var(--primary);
            }
          }
        }
      }
    }
  }

  .desktop-nav {
    display: flex;
    gap: 1.25rem;

    @media screen and (max-width: 767px) {
      display: none;
    }

    a {
      text-decoration: none;
      font-weight: 700;
    }
  }

  .hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
    z-index: 10;

    span {
      display: block;
      width: 30px;
      height: 3px;
      background-color: var(--primary);
      transition: 0.3s ease-in-out;
    }

    &.active {
      position: fixed;
      right: 40px;

      @media screen and (max-width: 767px) {
        right: 18px;
      }

      span:first-child {
        transform: translateY(9px) rotate(45deg);
      }

      span:nth-child(2) {
        opacity: 0;
      }

      span:last-child {
        transform: translateY(-9px) rotate(-45deg);
      }
    }

    &[aria-expanded="true"] {
      position: fixed;
      right: 40px;
      font-weight: 700;

      @media screen and (max-width: 767px) {
        right: 10px;
        top: 15px;
      }

      span:first-child {
        transform: translateY(9px) rotate(45deg);
      }

      span:nth-child(2) {
        opacity: 0;
      }

      span:last-child {
        transform: translateY(-5px) rotate(-45deg);
      }
    }

    @media screen and (max-width: 767px) {
      display: flex;
      align-items: flex-end;
    }
  }

  .mobile-nav {
    @media screen and (min-width: 768px) {
      display: none;
    }
  }
}
