#header {
  @media (max-width: 786px) {
    margin-bottom: 3.8rem;
  }
}

.header {
  box-shadow: var(--shadow-sm);

  @media (max-width: 786px) {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    background: var(--color-bg);
  }

  .wrapper {
    width: 95%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;

    @media (max-width: 480px) {
      height: 3.75rem;
    }
  }

  .logo {
    a {
      img {
        vertical-align: middle;
        width: 6.5rem;

        @media (max-width: 480px) {
          width: 5.5rem;
        }
      }
    }

    @media (max-width: 980px) {
      display: flex;
      align-items: center;
    }
  }

  .top-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xxl);

    @media (max-width: 480px) {
      display: none;
    }

    .nav-link {
      font-size: var(--font-md);
      border-bottom: 2px solid transparent;

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

  .actions {
    display: flex;
    gap: var(--space-lg);

    @media (max-width: 480px) {
      font-size: 0.8rem;
    }

    .auth-actions {
      display: flex;
      align-items: center;
      /* gap: var(--space-xl); */

      @media (max-width: 480px) {
        display: none;
      }

      a {
        /* margin-right: var(--space-lg); */
        display: flex;
        align-items: center;
        gap: var(--space-md);
      }
    }

    .theme-btn {
      /* margin-right: var(--space-lg); */
    }

    a {
      display: flex;
      align-items: center;
      gap: var(--space-md);
    }

    .logout-btn {
      margin-left: var(--space-md);

      svg {
        fill: white;
      }
    }
  }
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;

  svg {
    width: 1.75rem;
    height: 1.75rem;
    fill: var(--color-text);
    vertical-align: middle;
  }

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

  .icon-close {
    display: none;
  }

  &.open .icon-bars {
    display: none;
  }

  &.open .icon-close {
    display: inline;
  }
}

/* Mobile Menu Styling */
.mobile-menu {
  display: none;
  position: fixed;
  top: 3.5rem;
  left: 0;
  height: 100%;
  right: 0;
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  flex-direction: column;
  padding: var(--space-lg);
  gap: var(--space-lg);
  z-index: 9;
  animation: slideDown 0.3s ease forwards;

  nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-top: var(--space-lg);

    a {
      font-size: 1.1rem;
      text-decoration: none;
      color: var(--color-text);
      font-size: var(--font-md);
      &:hover {
        color: var(--color-primary);
      }
    }
  }

  .mobile-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);

    a,
    button {
      width: 100%;
    }

    .logout-btn {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: var(--space-sm);
      margin-top: var(--space-lg);
      color: white;

      svg {
        fill: white;
      }
    }
  }
}

.mobile-menu.open {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Optional: prevent scroll when menu is open */
body.menu-open {
  overflow: hidden;
}
