.top_bar {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 2.5rem;
  background: var(--white);
  border-bottom: 1px solid rgba(126, 100, 255, 0.12);
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 1000;

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

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

  a {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;

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

  .support-icon {
    width: 18px;
    height: 18px;
    opacity: 0.6;
  }
}

li {
  margin: 0;
}

.site_header {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  align-items: center;
  z-index: 999;
  position: fixed;
  width: 100%;
  top: 33px;
  background: var(--white);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(126, 100, 255, 0.12);

  &.scrolled {
    top: 0;
    padding: 0.75rem 2rem;
    background: var(--white);
    border-bottom: 1px solid rgba(126, 100, 255, 0.12);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  }

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

    &.scrolled {
      padding: 0.65rem 1rem;
    }
  }
  @media screen and (max-width: 374px) {
    top: 55px;
  }
  .logo_header {
    max-width: 200px;
    width: 100%;
    overflow: hidden;
    transition: opacity 0.2s ease;

    &:hover {
      opacity: 0.8;
    }

    .logo_desktop {
      display: block;

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

    .logo_mobile {
      display: none;

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

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

    ul {
      display: flex;
      gap: 1.5rem;
      align-items: center;

      a {
        text-decoration: none;
        font-weight: 500;
        font-size: 0.875rem;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        color: var(--black);
        transition: color 0.2s ease;

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

    .signup-link {
      background: var(--secondary);
      padding: 0.5rem 1.5rem;
      border-radius: 2px;
      color: var(--white);
      font-weight: 600;
      font-size: 0.8125rem;
      letter-spacing: 1px;
      transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;

      &:hover {
        background: var(--secondary);
        color: var(--white);
        box-shadow: 0 0 20px rgba(126, 100, 255, 0.3);
      }
    }

    &.active {
      display: block;
      position: fixed;
      top: 0;
      right: 0;
      width: 80%;
      /* height: 100%; */
      background: var(--white);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      border-left: 1px solid rgba(126, 100, 255, 0.12);
      /* transform: translateX(100%);
        -webkit-transform: translateX(100%); */
      transition: transform 0.3s ease-in-out;
      z-index: 1001;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;

      ul {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 5rem 2rem;

        a {
          text-decoration: none;
          font-weight: 500;
          font-size: 1.25rem;
          letter-spacing: 0.5px;
          text-transform: uppercase;
          color: var(--black);
          transition: color 0.2s ease;

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

        .signup-link {
          background: none;
          display: inline-block;
          padding: 0;
          border-radius: 0;
          color: var(--black);
          font-weight: 500;
          letter-spacing: 1px;
        }
      }
    }
  }

  .header-right {
    grid-column: 3;
    position: relative;
    display: flex;
    gap: 1.25rem;
    align-items: center;

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

    .unsubLink {
      font-size: 0.8125rem;
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--black);
      transition: color 0.2s ease;

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

    @media screen and (max-width: 767px) {
      gap: 0.3rem;
    }
  }

  .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: 5px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: 1px solid var(--primary);
    border-radius: 4px;
    z-index: 1002;
    transition: border-color 0.2s ease;

    &:hover {
      border-color: rgba(126, 100, 255, 0.3);
    }

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

    &.active,
    &[aria-expanded="true"] {
      span:first-child {
        transform: translateY(7px) rotate(45deg);
      }
      span:nth-child(2) {
        opacity: 0;
      }
      span:last-child {
        transform: translateY(-7px) rotate(-45deg);
      }
    }

    @media screen and (max-width: 767px) {
      display: flex;
      align-items: flex-end;
    }
  }
}
/* Close button for slide-out panels */

.nav-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;

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

/* Mobile slide-out panels (outside header to avoid backdrop-filter containing block) */

.site_navigation--mobile {
  display: none;

  @media screen and (max-width: 767px) {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateX(100%);
    -webkit-transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    &.active {
      transform: translateX(0);
      -webkit-transform: translateX(0);
    }

    ul {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      padding: 5rem 2rem;

      a {
        text-decoration: none;
        font-weight: 500;
        font-size: 1.25rem;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        color: var(--gray);
        transition: color 0.2s ease;

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

      .signup-link {
        background: none;
        display: inline-block;
        padding: 0;
        border-radius: 0;
        color: var(--gray);
        font-weight: 500;
        letter-spacing: 1px;
      }
    }
  }
}

.dropdown-menu {
  position: fixed;
  top: 0;
  right: -100%;
  height: 100%;
  background: var(--white);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  width: 25%;
  padding: 5rem 2rem;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  z-index: 1001;

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

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

  &.active {
    right: 0;
  }

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

    li a {
      display: block;
      padding: 0.625rem 0.75rem;
      font-size: 0.9375rem;
      font-weight: 500;
      letter-spacing: 0.5px;
      color: var(--black);
      transition:
        color 0.2s ease,
        padding-left 0.2s ease;
      border-radius: 4px;

      &:hover {
        color: var(--primary);
        padding-left: 1rem;
        background: rgba(126, 100, 255, 0.06);
      }
    }
  }
}
